app-services-cli
app-services-cli copied to clipboard
Command to show available providers and regions
First of all sorry if there is a way to do what I am going to describe but I wasn't able to find any information in the doc.
I want to use rhoas CLI for interacting with the RHOSAK service.
In order to create a new Kafka instance, it seems I can specify the --name for the instance as well as the --provider and --region but I don't see any way to get the list of available providers and regions.
I know that if I don't set any command line parameters, I get an interactive wizard which allows me to see the available providers (just aws for now) and regions (eu-west-1 and us-east-1).
rhoas kafka create
? Name: test
? Cloud Provider: aws
? Cloud Region: [Use arrows to move, type to filter, ? for more help]
eu-west-1
> us-east-1
It would be great to have a way to get providers and regions lists with a kind of new command in rhoas.
For example, when I use the Azure CLI for handling my services on Azure, there is a specific command to list the locations (aka regions) available for the current Microsoft Azure Subscription where I can create and run my service.
az account --list-locations
The above command provides a JSON output listing different information about each location/region like following.
{
"displayName": "East US",
"id": "/subscriptions/.....",
"metadata": {
"geographyGroup": "US",
"latitude": "37.3719",
"longitude": "-79.8164",
"pairedRegion": [
{
"id": "/subscriptions/......",
"name": "westus",
"subscriptionId": null
}
],
"physicalLocation": "Virginia",
"regionCategory": "Recommended",
"regionType": "Physical"
},
"name": "eastus",
"regionalDisplayName": "(US) East US",
"subscriptionId": null
}
Of course, we don't want all this info because with az we are already on Azure and it provides details about locations but having just a list of regions as eu-west-1 and us-east-1 would be useful. The same applies to providers of course.
Already done in but not released yet
https://github.com/redhat-developer/app-services-cli/pull/1362
Yeah that PR is really cool and great to have. What I am suggesting is slightly different, it's about having a dedicated command to get providers and regions before "trying" to create a Kafka instance. With that PR you have to make a mistake first to get suggestions or you know the valid values from the beginning, but having a way to have a valid list up front would be useful imho.
@rkpattnaik780 FYI
Looking for feedback and good cmd name
rhoas kafka locations?
How does rhoas kafka list-regions sound?
@craicoverflow will be expert in terms of guidance.
Service registry has some examples of 2 part commands
rhoas kafka list-regions
I love it. It fits very nicely with the existing language.