Deploy application in IBM Cloud using only Rest API - ibm-cloud

I am an intern and currently doing automation on a software. What I need to do is to automate the process of creating, and starting an application in the cloud foundry using Rest API (rest-assured). I can't start an app because to start it I need to upload bits. I searched for weeks and still cannot find how to do it. I can only use V2 of the Cloud Foundry API, because when I create an app using the V3 API it doesn't show in the dashboard. I don't know why so we decided to just leave it and use V2 instead.
My question is: Is there any way to create, and deploy/start an app using only Rest API with the V2 API of the Cloud Foundry API? If there is a way to do this by using V3 API, I'm willing to search for the solution to solve the issue.
Thank you very much.

I think others commented on your question to use the cf command line, but if you want to use whats behind the scenes of cf then you can refer to the REST API Docs. At the top the page there is a API version selector (I linked 2.9.0 since you mentioned V2).
More specifically, to create an app you can use the Create App Endpoint; then to upload the bits, you can use Upload Bits Endpoint.
I hope this helps. Definitely check out the main docs, there are tons of endpoints that might be useful. Good luck on your internship!
EDIT: Just in case you need the CF API URL its https://api.ng.bluemix.net

If you want to see how the cli uses the rest api behind the scenes you can temporarily set the environment variable BLUEMIX_TRACE with the command line EXPORT BLUEMIX_TRACE=TRUE.
Then you can try doing cf push or cf start, cf stop, etc, and you will see the http requests the CLI uses. This has helped me a lot versus digging through the CF documentation :). Hope it helps!

I solved it by combining V3 API with V2 API. I understand the upload bits in V3 API. I use link[1] mainly to start the app. I think you can't create a route in V3 API because I don't see any endpoint for that, so I use V2 API instead to create and assign. I also use V2 API to create my app because of what I stated in my question. Thanks for answering the question because without the answers given by good people here I can find the best way to solve this.
[1] Create an App using V3 : https://github.com/cloudfoundry/cloud_controller_ng/wiki/How-to-Create-an-App-Using-V3-of-the-CC-API
[2] V2 API doc : https://apidocs.cloudfoundry.org/3.1.0/routes/list_all_apps_for_the_route.html .
[3] V3 API doc : http://v3-apidocs.cloudfoundry.org/version/release-candidate/index.html#get-assigned-isolation-segment

Related

call AWS POST API with AWS Signature Version 4

did someone already called an AWS Rest API with AWS Signature Version 4 ?
I'm not sure how to generate this using the hierarchical stage Calling the Rest API ?
Thank You -
what do you mean by hierarchical stage, do you want to build the whole signature on your own?
Which language are you trying to call it with? There are different packages depending on that, I highly recommend using one of those instead of rebuilding it on your own.
agnostic-aws-signature This worked for me for example...

Creating new bot from template using API in botpress

Is it possible to create a BotPress bot entirely using the API? More specifically, can I accomplish most of all of what I would do in the UI by just using API methods? I looked, and I don't see a createBot() method, so I'm wondering if this is possible.
Second question, I read that multi-tenant support has been added in version 11. Is there any documentation on how this works?
Yes this is possible, if you use the F12 on your browser to see how Botpress works under the hood. you will find that it uses some API.
Here are some I found and used :
Bots management: /api/v1/admin/bots
QNA management: /api/v1/bots/{botid}/mod/qna/questions
Managing a specifi bot: /api/v1/admin/bots/{botid}
...
Keep looking and you will find more than that.

Dynamically Change API Environments Google Rollout Track

I'm developing an Ionic(3 / 4)(Angular 4 - 7)-Cordova / Capacitor Cross Platform Application(s). I'm interested in switching API env based on the current rollout track in the Google Play Store. For example, once an application has been successfully tested and recommended to continue staging/production. I would like to have the API env dynamically changed (e.g., using a different URI domain to connect to REST API ) dependent on the Google Play Store Track.
I'm aware that I can use Google Developer Play Store API to identify / list versions and available tracks yet, I'm unaware if there's already an implementation or solution. I'm perfectly willing to design a solution though, I figure I find out if it's been done already rather than reinvent the wheel.
I'm hoping to implement a solution either to the REST API BACKEND or in the ionic framework layer rather than an integration at the native layer for scalability per-project. The purpose of doing this would enable CI rather than rebuilding the project and change the API URI domain for every environment. Any assistance in this matter would be greatly appreciated.
So, if anyone's interested. The approach highlighted above is possible, couldn't get an answer so I just created something. Using Google Play Developer API. The process flow is as follows:
[]
For now it's a working prototype perhaps its not very efficient; I suppose it can be improved if the request was issued from a single server, or microservice. Though, I wanted to make the code recyclable and it's isolated from both the mobile application & Node Server.
If you are interested in learning more or would like to work on project. Please feel free to contact me.

What is the difference between V4 and V2 Signing Process for Google Cloud Storage's Resources?

I am using Google Cloud Storage for one of my project requirement, that also required to use Signed URL, and when I reached google documentation here https://cloud.google.com/storage/docs/access-control/signed-urls
It now talks about V4 (version) to use for signed URL, another place it also says like it's in BETA Mode? Now I am sort of on my beginner step to get SIGNED URL for the objects stored in GCS, but its documentation confused me.
If I follow V2 documentation refer here: https://cloud.google.com/storage/docs/access-control/signed-urls-v2 then it documentation say Important: This page covers legacy material related to the V2 signing process. It is recommended that users work with the V4 signing process instead.
If I follow V4 documentation then refer here: https://cloud.google.com/storage/docs/access-control/signing-urls-manually then it says This feature is in a pre-release state and might change or have limited support.
Sure I will reach to GCS support as well, but still thought to ask from the community,
A. What is the difference between V4 and V2
B. On both cases Google Cloud Storage's Documentation contradicting the SIGNED URL functioning
It seems that you have received an answer in the Public Issue Tracker from GCP of your question.
In addition to the answer posted:
A. What is the difference between V4 and V2
The difference is mostly at implementation level, how the signature is constructed. Also, in V4 you cannot create signed urls whose expiration date (X-Goog-Expires) goes beyond 7 days, whereas this can be set for years using V2. Something else is that V4 is now more suitable to carry out GCS-AWS operations, so if you need this option, this beta would be your only option for it. As this is the main purpose for V4, more details about the signature are left to the AWS documentation.
B. On both cases, Google Cloud Storage's Documentation contradicting the SIGNED URL functioning.
In V2 Doc explicitly says: "Important: This page covers legacy material related to the V2 signing process. It is recommended that users work with the V4 signing process instead.". Even when the V4 is in Beta now (Oct 2, 2019) this should not be taken as something contradicting. It is a recommendation to use the V4.
In conclusion, you can try with the V4 since there is even a way to create the signedURL from the Gsutil

Where to host Smartsheets API code

I am interested in learning to use the Smartsheets API. In the past I created workflows in Google Apps Script, which has a built in IDE that houses the script. Does Smartsheets have something similar? If not, where is a common place to keep your code and have it react to webhooks/events?
Regards,
Shawn
The API is just a way to communicate between your application and Smartsheet - there is no hosting for your executable code. Smartsheet provides a number of SDKs to help make the calls easier to perform, but in theory you could use any language to make the REST commands. So, pretty much any service that allows executable code would work, such as Amazon AWS, Google Cloud, Microsoft Azure, or others. Here's a brief comparison of services.
You can start developing on your own computer before you worry about cloud deployment. See the getting started guide and samples here: https://github.com/smartsheet-platform/getting-started
If you really need to respond to webhooks, your code will have to run somewhere that accepts incoming HTTP calls from the Internet without being blocked by a firewall. This could be in your data center, any of cloud services, or via a tunnel such as https://ngrok.com/