-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
By default, ibmcloud API endpoint is set to https://cloud.ibm.com.
But when someone passed an invalid/wrong endpoint and it fails to set the endpoint, still it resets the endpoint.
Current Behaviour:
After an invalid usage of 'ibmcloud api INVALID_ENDPOINT', endpoint is reset, and you again have to set the endpoint to https://cloud.ibm.com, using ibmcloud api https://cloud.ibm.com
This might be intentional, but I felt it should not reset the API if usage failed, and just retained the last context/endpoint
➜ ~ ibmcloud api
API endpoint: https://cloud.ibm.com
➜ ~ ibmcloud api watsonx
Setting api endpoint...
FAILED
Could not determine the API endpoint
# Endpoint has been reset
➜ ~ ibmcloud api
No api endpoint set. Use 'ibmcloud api' to set an endpoint
Default api endpoint: https://cloud.ibm.com
# Need to set the endpoint manually to the default
➜ ~ ibmcloud api https://cloud.ibm.com
Setting api endpoint...
OK
API endpoint: https://cloud.ibm.com
Not logged in. Use 'ibmcloud login' to log in.
➜ ~ ibmcloud api
API endpoint: https://cloud.ibm.com
Expected Behaviour
➜ ~ ibmcloud api
API endpoint: https://cloud.ibm.com
➜ ~ ibmcloud api watsonx
Setting api endpoint...
FAILED
Could not determine the API endpoint
# Maybe better to not change anything, since the last command failed
➜ ~ ibmcloud api
API endpoint: https://cloud.ibm.com
Metadata
Metadata
Assignees
Labels
No labels