Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid API endpoint causes the API endpoint to be reset #208

Open
adi-g15-ibm opened this issue Jul 17, 2024 · 0 comments
Open

Invalid API endpoint causes the API endpoint to be reset #208

adi-g15-ibm opened this issue Jul 17, 2024 · 0 comments

Comments

@adi-g15-ibm
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant