bluemix cf reports "No orgs found" - ibm-cloud

I can see and operate organization in dashboard. But cannot find any org in cf command line.
C:\Users\zlf>cf login -u 3218789763#qq.com -o suisl -s dev
API endpoint: https://api.ng.bluemix.net
Password>
Authenticating...
OK
FAILED
Error finding org suisl
Organization suisl not found
API endpoint: https://api.ng.bluemix.net (API version: 2.40.0)
User: 3218789763#qq.com
No org or space targeted, use 'cf target -o ORG -s SPACE'
C:\Users\zlf>cf orgs
Getting orgs as 3218789763#qq.com...
name
No orgs found
http://imgur.com/a/rLKJi

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

you have created the org in the Sydney Region but you are looking for the Org in the US region (https://api.ng.bluemix.net).
For Sydney please use the following API endpoint: api.au-syd.bluemix.net
To find the CF API endpoints for each region please refer to the docs.

Could you please change the region to your region and then target the org and space. You may target your region using below command:
ibmcloud target --cf-api 'https://api.REGION.cf.cloud.ibm.com' -r REGION -o
Change REGION with your region(eu-gb) for London use your ibm cloud email id for org.
Thanks,
This message was taken from Anamika Agawarl from Coursera.

Related

Azure CLI function app access-restriction "has host bits set"

I'm trying to add a rule to enable requests from a devops pipeline to an azure function app.
I run the following az cli command (either from the pipeline or from a VS Code terminal window)
az functionapp config access-restriction add -g rg-name-here -n func-name-here --rule-name devopsRB --action Allow --ip-address "51.142.236.175/27" --priority 146
This gives back the following error:
51.142.236.175/27 has host bits set
If I add the same rule via the Azure portal it works ok.
Anyone see what I'm doing wrong?
The error 51.142.236.175/27 has host bits set also occurred to me. But I ran Azure CLI task with command
az functionapp config access-restriction add -g GROUP -n NAME --rule-name RULEname --action Allow --ip-address 51.142.0.0/27 --priority 300
successfully. Consider using 51.142.0.0/27.

When running cf target I get No org or space targeted, use 'cf.exe target -o ORG -s SPACE'

I am using "Cloud Foundry apps" to deploy my applications to the IBM Cloud. Haven't used this service before.
I am using Windows for converging. I did everything step by step as described on the site.
Logged into my IBM Cloud account and selected the API endpoint.
ibmcloud login
Targeting Cloud Foundry organization and space:
ibmcloud target --cf
But in the third step. When needed from the get-start-python directory
submit my app to IBM Cloud
i am getting error when running command:
ibmcloud cf push
error:
$ ibmcloud cf push
FAILED
No CF API endpoint set.
Use 'C: \ Users \ ami \ .bluemix \ .cf \ cfcli \ ibmcloud.exe target --cf-api ENDPOINT [-o ORG] [-s SPACE]' to target Cloud Foundry, or 'C: \ Users \ ami \ .bluemix \ .cf \ cfcli \ ibmcloud.exe target --cf 'to target it interactively.
Then I decided to look at cf target
and I get the inscription:
No org or space targeted, use 'cf.exe target -o ORG -s SPACE'
What am I doing wrong?
My understanding is that you are trying to create a Cloud Foundry org in us-south, but your home region is eu-uk. Per definition of Lite accounts you can only create one org in one region. That region is your "home" region.
You would need to set the API endpoint to api.eu-uk.cf.cloud.ibm.com, set ibmcloud target -r eu-uk for the region. Then try again with creating a region or setting the org and space.

How to create an SSH in gcloud, but keep getting API error

I am trying to set up datalab from my chrome book using the following tutorial https://cloud.google.com/dataproc/docs/tutorials/dataproc-datalab. However when trying to set up an SSH tunnel using the following guidelines https://cloud.google.com/dataproc/docs/concepts/accessing/cluster-web-interfaces#create_an_ssh_tunnel I keep on receiving the following error.
ERROR: (gcloud.compute.ssh) Could not fetch resource:
- Project 57800607318 is not found and cannot be used for API calls. If it is recently created, enable Compute Engine API by visiting https://console.developers.google
.com/apis/api/compute.googleapis.com/overview?project=57800607318 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our sy
stems and retry.
The error message would lead me to believe my "Compute Engine API" is not enabled. However, I have double checked and "Compute Engine API" is enabled.
Here is what I am entering into the cloud shell
gcloud compute ssh ${test-cluster-m} \
--project=${datalab-test-229519} --zone=${us-west1-b} -- \
-4 -N -L ${8080}:${test-cluster-m}:${8080}
The ${} is for accessing the local environment variable. You set them in the step before with:
export PROJECT=project;export HOSTNAME=hostname;export ZONE=zone;PORT=number
In this case would be:
export PROJECT=datalab-test-229519;export HOSTNAME=test-cluster-m;export ZONE=us-west1-b;PORT=8080
Either try this:
gcloud compute ssh test-cluster-m \
--project datalab-test-229519 --zone us-west1-b -- \
-D 8080 -N
Or access the enviroment variables with:
gcloud compute ssh ${HOSTNAME} \
--project=${PROJECT} --zone=${ZONE} -- \
-D ${PORT} -N
Also check the VM you are trying to access is running.

Unable to login to Bluemix via CLI

I am unable to login to my Bluemix account using CLI.
Here are the steps that I followed:
Connected to Bluemix from CLI
E:\myStuff\Coding\Node.js\CloudantDB-NodeApp>bluemix api https://api.ng.bluemix.net
Invoke 'cf api https://api.ng.bluemix.net'...
Setting api endpoint to https://api.ng.bluemix.net...
OK
API endpoint: https://api.ng.bluemix.net (API version: 2.44.0)
Not logged in. Use 'bluemix login' to log in.
Login to Bluemix
Here is the error that I am getting -
E:\myStuff\Coding\Node.js\CloudantDB-NodeApp>bluemix login -u arindam.chattopadhya#wipro.com -o BAS-CES-IBM INTEGRATION -s DEV
Invoke 'cf login -u arindam.chattopadhya#wipro.com -o BAS-CES-IBM INTEGRATION -s DEV'...
API endpoint: https://api.ng.bluemix.net
Password>
Authenticating...
OK
API endpoint: https://api.ng.bluemix.net (API version: 2.44.0)
User: arindam.chattopadhya#wipro.com
No org or space targeted, use 'cf target -o ORG -s SPACE'
FAILED
Error finding org BAS-CES-IBM
Organization BAS-CES-IBM not found
The following command works -
bluemix login -u arindam.chattopadhya#wipro.com -o 'BAS-CES-IBM INTEGRATION' -s DEV

How do I use Cloud Foundry to login to IBM Bluemix?

I am trying to get started using IBM Bluemix and want to use the Cloud Foundry CLI to login and manage my applications. But I cannot figure out how to login using the cf command. I think what I am missing is the API endpoint I need to provide for the cf login command:
cf login -a [API_URL] -u [USERNAME] -p [PASSWORD]
I suspect I use my IBM ID username and password, but I'm not sure about the API_URL. Seems like this should be an easy question to search, but I have not been able to find an answer.
You set the api endpoint like this:
cf api https://api.ng.bluemix.net
and then you login with cf login.
Alternatively you can use the European endpoint:
cf api https://api.eu-gb.bluemix.net
EDIT:
Alternatively, as you were implying, you can pass the API endpoint to cf login directly via the -a option:
cf login -a https://api.ng.bluemix.net -u <ibm.com id>
Found the answer to my question. The API endpoint for IBM bluemix is https://api.ng.bluemix.net. That was the key piece of information I was missing to login to IBM Bluemix using the Cloud Foundry CLI:
cf login -a https://api.ng.bluemix.net -u <IBM ID Name> -p <IBM ID Password>
I'm impressed with how easy the rest of the cf command is to manage apps.