Reputation: 221
I have downloaded and installed the Cloud Foundry CLI tool "cf". However, I am not able to login because I could not set the API endpoint.
What is the API endpoint that I should provide? Where can I find the related information?
Upvotes: 22
Views: 26951
Reputation: 76
This is an old question, but since it still tops nicely on googled results, maybe throw in the current commands ( choose one that applies for you ):
$ ibmcloud target --cf-api https://api.us-south.cf.cloud.ibm.com
$ ibmcloud target --cf-api https://api.us-east.cf.cloud.ibm.com
$ ibmcloud target --cf-api https://api.eu-de.cf.cloud.ibm.com
$ ibmcloud target --cf-api https://api.eu-gb.cf.cloud.ibm.com
$ ibmcloud target --cf-api https://api.au-syd.cf.cloud.ibm.com
Upvotes: 1
Reputation: 2488
For future users who may stumble across this question using the IBM Cloud CLI, the commands to set the API Endpoint are very similar:
US South
ibmcloud api https://api.ng.bluemix.net
US East
ibmcloud api https://api.us-east.bluemix.net
United Kingdom
ibmcloud api https://api.eu-gb.bluemix.net
Germany
ibmcloud api https://api.eu-de.bluemix.net
Sydney
ibmcloud api https://api.au-syd.bluemix.net
After setting the API Endpoint, you can login:
ibmcloud login
Official docs here:
https://console.bluemix.net/docs/cli/reference/ibmcloud/bx_cli.html#bluemix_cli
Upvotes: 16
Reputation: 4671
for change region login, example:
bx login -a https://api.ng.bluemix.net
Upvotes: 1
Reputation: 1249
If you are using US South Region:
use these commands:
cf api https://api.ng.bluemix.net
cf login -u bluemix_id -o myorg
If you are using United Kingdom region:
use these commands:
cf api https://api.eu-gb.bluemix.net
cf login -u bluemix_id -o myorg
for Sydney region
cf api https://api.au-syd.bluemix.net
cf login -u bluemix_id -o myorg
for Germany region
cf api https://api.eu-de.bluemix.net
cf login -u bluemix_id -o myorg
you can know which region, org and space is currently set typing:
cf target
If you are using the 'bluemix' plugin you can use the below command
example:
bx api <apiLink>
and bx target
Upvotes: 21
Reputation: 17186
The endpoint depends on the Bluemix region/data center, this one is for the default in North America/Dallas ("US South"):
cf login -a https://api.ng.bluemix.net
Instead of "ng" you could also have "eu-gb" for London or "au-syd" for Sydney. The regions for Bluemix Public are documented here. If you are on Bluemix Dedicated or Bluemix Local you would need to ask your administrator for the correct name of the API endpoint.
For Bluemix Public:
cf api https://api.ng.bluemix.net
cf api https://api.eu-gb.bluemix.net
cf api https://api.eu-de.bluemix.net
cf api https://api.au-syd.bluemix.net
cf api https://api.us-east.bluemix.net
You can also get an overview of existing endpoints using the IBM Cloud CLI with the regions
command:
>> bx regions
Listing regions...
Name Geolocation Customer Deployment Domain CF API Endpoint Type
eu-de Germany IBM Production eu-de.bluemix.net https://api.eu-de.bluemix.net public
au-syd Sydney IBM Production au-syd.bluemix.net https://api.au-syd.bluemix.net public
us-east US East IBM Production us-east.bluemix.net https://api.us-east.bluemix.net public
us-south US South IBM Production ng.bluemix.net https://api.ng.bluemix.net public
eu-gb United Kingdom IBM Production eu-gb.bluemix.net https://api.eu-gb.bluemix.net public
Upvotes: 15
Reputation: 427
You should use the extended cf cli which is now bx cli (the BlueMix CLI). With the bx cli installed you simply type: bx regions
This will list all the available regions and api endpoints available. With that in hand now you can connect to your preferred region/api. Below is the output from the bx regions command:
bx regions
Listing Bluemix regions...
Name Geolocation Customer Deployment Domain CF
API Endpoint Type
eu-de Germany IBM Production eu-de.bluemix.net
https://api.eu-de.bluemix.net public
au-syd Sydney IBM Production au-syd.bluemix.net
https://api.au-syd.bluemix.net public
us-south US South IBM Production ng.bluemix.net
https://api.ng.bluemix.net public
eu-gb United Kingdom IBM Production eu-gb.bluemix.net
https://api.eu-gb.bluemix.net public
You can get the bx cli from here https://clis.ng.bluemix.net/ui/all_versions.html.
Hope this helps.
Upvotes: 0
Reputation: 1
Please follow these instructions.
Use the below command to verify your credentials: cf login -a https://api.example.com -u [email protected] -p Password
use cf login -a $url -u [email protected] -p xxxxx
instead of cf login -a $url
command.
Upvotes: 0