I have provisioned several services in my IBM Cloud account. How can I easily find a specific resource from the command line (CLI)?
You can use the ibmcloud resource command with the search option:
This finds all Cloud Foundry resources:
ibmcloud resource search 'type:cf-service-instance'
This finds all resources where the name includes "db2":
ibmcloud resource search 'name: *db2*'
Combining the two, find Cloud Foundry services with a name that includes "db2":
ibmcloud resource search 'name: *db2* AND type:cf-service-instance'
There are many more options and the search syntax is based on Lucene. Some is also explained in this cloud solution tutorial on accessing resource usage.
Related
I am searching for the credentials to access my cloud function from Watson assistant. Both are in Dallas region.
I have looked at various docs and blogs, all looks obsolete. I could not find the credentials that could work in Watson Assistant.
Below is one example location where i could not find credentials:
https://developer.ibm.com/recipes/tutorials/connect-watson-assistant-with-wikipedia-api-via-cloud-functions/
Could someone provide me steps or link to find or generate credentials?
More trials added
https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-actions
above link provide another link that is supposed to show me credentials but no success
Note: I can see CF-based API key for the namespace in London but not in Dallas on link -- https://cloud.ibm.com/functions/namespace-settings
Namespace
Below is a part of Watson json.
"actions": [
{
"name": "Namespace-Y1N/irs/helloworld",
"type": "cloud_function",
"parameters": {
},
"credentials": "$private.my_creds",
"result_variable": "$my_result"
}
]
Below is the cloud function
Well, the official IBM Watson Assistant docs on creating programmatic calls have that information. Look for <reference_to_credentials>. There are instructions on how to access Cloud Functions and extract the API key. Some of that is not needed if working with web actions.
The official tutorial on how to build a database-driven Slackbot with Watson Assistant also offers a way on integrating those credentials once for multiple dialog nodes. It uses a "credential node" to manage the info on how to access Cloud Function actions.
Note that Cloud Functions have the old Cloud Foundry-based namespaces and the new IAM-based namespaces. You can only see the authentication key for the Cloud Foundry namespaces. It seems that your Dallas namespace is new and IAM-enabled.
As an alternative, use the IBM Cloud CLI, log in to your org / space or namespace and then use this command to obtain the Cloud Function properties including the authentication key:
ibmcloud fn property get --auth
Create a new API key. Select Menu(Top-left), Manage, Access (AIM), IBM Cloud API Keys. Create an IBM Cloud API Key, then make sure that you save it somewhere because you will never see the key again. I hope that will help.
Your namespace "Namespade-Y1N" in Dallas is a IAM-enabled namespace. Server-based actions in dialog node of Watson Assistant does not support IAM based authentication. It can only work with CF based namespaces and CF based Cloud foundry functions. This is restriction of Watson Assistant.
I tried to create the Tone Analyzer service in IBM Cloud using
cf create-service tone_analyzer beta rtt-tone-analyzer
but I got "Could not find plan with name beta".
What is the correct cf command or service plan?
You can find information about the Tone Analyzer in the IBM Cloud Catalog. There is a Lite, Standard and Premium plan available. Those plans can be specified in the create-service command.
As an alternative, you could use the inofficial tool mycatalog, select the Tone Analyzer service, click on the CLI link. It brings up the possible CLI commands to create the different services. Here is the syntax for the free Lite plan.
ibmcloud cf create-service tone-analyzer lite <service-name>
Because most services are IAM-controlled, the Cloud Foundry-related syntax above should be replaced with the general resource command:
ibmcloud resource service-instance-create <service-name> tone-analyzer lite <region>
I am using the CLI command bx service create to provision a new service. Some of the services support resource groups. For them, I noticed that the service itself has a long generic name and is listed under "Services". The name I chose is only associated with an alias, listed under "Cloud Foundry Services".
How can I get those services to use the name I picked?
The trick is to use another IBM Cloud CLI command. It is part of the set of commands to manage resource groups and its objects:
bx resource service-instance-create
Using the above command, the name is used for the service and there is no alias created. The service is only listed under "Services". Here is a full example:
bx resource service-instance-create ghstatsDDE dynamic-dashboard-embedded lite us-south
I'd like to know how I can find my object storage service name or GUID. I executed:
bx service list
to each resource group. But I cannot get any object storage service name. Please advise. Thank you.
You need 2 commands:
1) To get the list of all your service instances:
$ bx resource service-instances
2) To get the ID and other details for a specific service instance:
$ bx resource service-instance "<An instance listed from output above>"
Note: Surrounding quotes ("") in step 2 are important as an instance
name may contain spaces.
Cloud object storage deviates from the traditional cloud foundry service model:
Cloud Object Storage service that was released on our public cloud about a month ago. It’s one of the first services to take advantage of resource groups, giving you some specific advantages as you use it and services like it. You’ll also notice when you deploy an instance of the service, you’re prompted to specify a resource group and a location depending on the plan you selected.
Source: https://www.ibm.com/blogs/bluemix/2017/11/organize-navigate-manage-resources-ibm-cloud/
Try using this cli:
bluemix resource service-instances
Source: https://console.bluemix.net/docs/cli/reference/bluemix_cli/bx_cli.html#bluemix_cli
Is there a valid list of label names for the "declared services" (https://github.com/IBM/watson-calorie-counter/blob/master/manifest.yml#L4) that can be used in a bluemix deployment documented somewhere?
This blog post describes how to get the label name for a specific service with the UI: https://www.ibm.com/blogs/bluemix/2016/01/deploy-to-bluemix-button-example/ -- But I was hoping there was a single source of truth documented somewhere, or I could find the information programmatically with the cf or bx CLIs.
What you are looking for is the documentation on how the declared-services section work. It is an IBM extension to regular Cloud Foundry manifest files. The extension is described in the IBM Cloud documentation for Continuous Delivery. That section also has details on how to look up the service names, labels:
Declared services, a manifest extension which creates or looks for the
required or optional services that are expected to be set up before
the app is deployed, such as a data cache service. You can find a list
of the eligible Bluemix services, labels, and plans by using the CF
Command Line Interface command cf marketplace or by browsing the Bluemix catalog.
So you would look up how a service is named and what plans are offered.