What is the difference between api.mybluemix vs api.ng.bluemix? - ibm-cloud

What is the difference between the two?
I am using cf api https://api.ng.bluemix.net.
Another tutorial on the IBM website uses cf api https://api.mybluemix.net.
Which doesn't seem to be working. Is it outdated and not working or am I using it wrong? On the Bluemix website they only show two CF API endpoints.
api.ng.bluemix.net
api.eu-gb.bluemix.net
https://www.ng.bluemix.net/docs/#overview/overview.html
Cheers

You should be using the api.ng.bluemix.net or api.eu-gb.bluemix.net as these are to two addresses for the two regions that are currently available in Bluemix. When new regions are created then you would use the api endpoint for that new region to log into it.
So if you have apps and services in the eu-gb (UK) region then you would log into api.eu-gb.bluemix.net. If you are using us-south region then you would log into api.ng.bluemix.net
The difference between a mybluemix.net address and a bluemix.net address is that the bluemix.net address is reserved for official IBM Bluemix provided applications such as console.ng.bluemix.net, api.ng.bluemix.net or status.ng.bluemix.net. The mybluemix.net addresses are the user applications that are running on Bluemix, these might or might not be developed by IBM.

I am not sure why are you getting the SSL Cert error.
Will you please try and see if cf login works for you by giving it the endpoint directly ? http://docs.cloudfoundry.org/devguide/installcf/whats-new-v6.html
Example =>
>>cf login -a api.ng.bluemix.net -u xxx#yy.zz -o xxx#yy.zz -s dev
API endpoint: api.ng.bluemix.net
Password>
Authenticating...
OK
Targeted org xxx#yy.zz
Targeted space dev
API endpoint: https://api.ng.bluemix.net (API version: 2.14.0)
User: xxx#yy.zz
Org: xxx#yy.zz
Space: dev

Related

How to set Cloud foundry API endpoint?

I am trying to login to bluemix account through cloud foundry cli using command CF login and I am getting output as 'API endpoints > '
I tried CF API then I got message as 'No API endpoint set . Use 'cf api' to set an endpoint .' what is the API endpoint ?
The API endpoint is the server your CLI program talks to to execute the commands and obtain information. For IBM Bluemix the API endpoints are documented here.
You could do cf api api.eu-de.bluemix.net to set the endpoint for Bluemix in Frankfurt, Germany. Or cf api api.ng.bluemix.net to configure Dallas, USA, as endpoint. See the above linked documentation for the full list of Bluemix Public. Bluemix Dedicated and Bluemix Local have other API endpoints.
You can also set the api endpoint and login using just one command using, e.g. for the Dallas, USA, endpoint:
cf login -a https://api.ng.bluemix.net
Alternatively you can use new API endpoints:
https://api.us-south.cf.cloud.ibm.com
https://api.eu-gb.cf.cloud.ibm.com
https://api.eu-de.cf.cloud.ibm.com
https://api.au-syd.cf.cloud.ibm.com
with:
cf login -a <API_ENDPOINT>
or you can use ibmcloud cli:
ibmcloud login -a 'https://cloud.ibm.com' -r 'us-south'
ibmcloud target --cf-api 'https://api.us-south.cf.cloud.ibm.com'

Swisscom Passeport two-step login with Cloud Foundry CLI

How can I login with the Cloud Foundry CLI to the Swisscom Application Cloud when I have activated the two-step login method (password and SMS code) in my Swisscom Passeport account?
$ cf login -a https://….appcloud.swisscom.com -u …
API endpoint: https://….appcloud.swisscom.com
Password>
Authenticating...
Credentials were rejected, please try again.
After entering my Passeport password on the command line I do receive the SMS code, however there's no possibility to enter it on the command line.
If you enable Passeport's two-factor authentication, you have to use the --sso flag and follow the instructions:
cf login -a https://api.lyra-836.appcloud.swisscom.com --sso
API endpoint: https://api.lyra-836.appcloud.swisscom.com
One Time Code ( Get one at https://login.lyra-836.appcloud.swisscom.com/passcode )>
Switching to the browser and obtaining an OTP is needed because the cf cli does not support two-step auth directly on the cli yet.
We will add this info to the official documentation.
Because lots of users have problems to login to iAPC (internal Application Cloud) I post here the steps. For external users this API endpoint is not reachable, you need to be in Corproot network (with proxy configured).
unset https_proxy http_proxy HTTP_PROXY HTTPS_PROXY
cf login -a https://api.scapp-console.swisscom.com --sso
API endpoint: https://api.scapp-console.swisscom.com
One Time Code ( Get one at https://login.scapp-console.swisscom.com/passcode )>
Authenticating...
OK
Select an org (or press enter to skip):
(...)
Select a space (or press enter to skip):
(...)
Space> test
Targeted space Test
API endpoint: https://api.scapp-console.swisscom.com (API version: 2.92.0)
User: xxx.xxx#swisscom.com
Org: xxx
Space: xxx
A screenshot how the One Time Code looks like (you need to copy and paste into CF CLI)
This CF installation is connected to Corproot domain. You need to use your Corproot credentials (the same you use for your Desktop).
This how to error (Credentials were rejected, please try again) looks if you are doing it wrong:
cf push
FAILED
Not logged in. Use 'cf login' to log in.
cf login
API endpoint: https://api.scapp-console.swisscom.com
Email> xxx.xxx#swisscom.com
Password>
Authenticating...
Credentials were rejected, please try again

is it possible to retrieve the app/service usage information ( the fee/the money) via api?

Is it possible to retrieve the app/service usage information ( the fee/the money) via api?
I noticed that my current cf command 's version is 2.40.0
API endpoint: https://api.ng.bluemix.net (API version: 2.40.0)
I checked the api list and cannot find any useful information about my request.
Billing information for Bluemix services and application usage is not available through an API; it is only available through the Bluemix console. However, feel free to submit the request on the IBM Bluemix Ideas site for future consideration. Bluemix Project Management reviews the ideas regularly.
Using CF CLI you could use:
cf curl /v2/organizations/ORG_GUID/summary
to retrieve the org guid you can use
cf org <orgName> --guid
This provides you information about the number of services and applications, and the memory usage.

How to retrieve api key for IBM containers after first usage

the api key, used in 'ice login -k xxx', was shown when I started to use IBM containers beta. After that, where can I retrieve my api key in case I forgot it?
If you have the latest version of the cli you just need to type ice login and it will log you into to the Containers Service. The cli with authenticate you with your Bluemix username and password.
To check what version of the CLI you have installed type the following.
[09:18 PM]>pip list | grep icecli
icecli (2.0)
As of this writing the latest version is 2.0.
The latest installer as of this writing can be fetched from https://static-ice.ng.bluemix.net/icecli-2.0.zip.
The 'ice login' does not require -k option any more. If unauthorized error is shown after 'ice login', delete lines 'x_auth_token' and 'api_key' from ~/.ice/ice-cfg.ini, and try 'ice login' again, everything should work fine.

Unable to push my app to bluemix

I developed an app using watson and cloudant. Completed the coding part using eclipse.
Build was successful and I got war file.
When I am trying to push this to bluemix, I am facing problem.
on giving the command
cf api https://api.eu-gb.bluemix.net
or
cf api https://api.ng.bluemix.net
I get the following in response
setting api endpoint to https://api.eu-gb.bluemixnet...
FAILED
Invalide SSL Cert for api.eu-gb.bluemix.net
TIP:Use 'CF api --skip--ssl-validation' to continue with an insecure API endpoint
Please help out, or tell some way to push my application.
I am not sure why are you getting the SSL Cert error.
Will you please try and see if cf login works for you by giving it the endpoint directly ?
http://docs.cloudfoundry.org/devguide/installcf/whats-new-v6.html
-u is the Bluemix user-id and this will prompt you for password. Let me know if this resolves for you or you get the same SSL error
Example =>
>>cf login -a api.ng.bluemix.net -u xxx#yy.zz -o xxx#yy.zz -s dev
API endpoint: api.ng.bluemix.net
Password>
Authenticating...
OK
Targeted org xxx#yy.zz
Targeted space dev
API endpoint: https://api.ng.bluemix.net (API version: 2.14.0)
User: xxx#yy.zz
Org: xxx#yy.zz
Space: dev