IBM Cloud Shell API needs to exist! I want to be able to run commands for my command that are best run through the cli. Imagine if I have an application that can make API calls to cloud shell to run those commands on my account instead of having to rely on a Docker file with linux ibmcloud cli installed.
**EDIT: added more info
| Idea priority | High |
| Needed By | Quarter |
By clicking the "Post Comment" or "Submit Idea" button, you are agreeing to the IBM Ideas Portal Terms of Use.
Do not place IBM confidential, company confidential, or personal information into any field.
Thank you so much for providing all of this detail, it is super helpful. I will send this on to the CLI product team to review and they will get back to you with an answer.
@Gilly Dekel
Hi Gilly
For the most part, calling the API directly is the solution. However there are limitations. For example, APIs are defined called by an API key. Our use case need came about because our org is using IBM Enterprise. We are creating IBM Sub-accounts.
In our automation, the big problem was that we used one API key to call the enterprise api to create sub-account but then we needed the sub-accounts api to call schematics api to stand up environments from TF file.
The problem was there exists no API to achieve this, you need an API call on an account to interact with it programmatically.
After consulting IBM Architects and Federation team, we were advised, the only way to create new api-keys for new sub-accounts is through the CLI.
In order to generate a new api key on a sub-account during automated account creation, we created a docker image that logs onto the cli, into the default account and then switches to the target account using ibmcloud target -c subaccountid
Then we have the ibmcloud cli generate a new apikey and we retrieve its value and send it back to our provisioning system through a Flask endpoint.
ibmcloud iam api-key-create NAME --output JSON
Our biggest need was to use ibm cloud shell in any way to simply execute this. It was not possible when I evaluated it.
If we would have this feature, we hope it works something like this
Enterprise user creates sub-account using the apikey
Enterprise user uses same apikey to interact with cloud shell api to then pass in commands, like ibmcloud target -c subaccountidhere and get subaccount apikey or other values.
ibmcloud cli is also useful for info that current apis don't provide like IMS id, no api we know gets this info, we got it again using ibmcloud account show
ibmcloud account show --output JSON
Our docker solution was very helpful but many instances we wished to run even bash scripts and we looked at code platforms and had to bring our own docker image solution through code engine and using os library on functions, but this can all be avoided if we could just use the cloud shell and pass in linux terminal commands to either store and load a bash script and execute it and gets output through cloudshell api and retrieve it using api. That would be wonderful as cloud shell is already integrated onto the ibmcloud account.
We didn't fully understand the use case here - are you asking to have an API for the CLI to call the API ? wouldn't it be easier to call the API directly ?