Where Are My Resources? (Part 1)
5 min read
By: Rossella De Gaetano
Using the IBM Cloud command line to find resources
We all love leveraging cloud environments, but dealing with multiple geographically dispersed microservices and service instances requires a robust and fast search engine that can help find resources quickly despite their nature (e.g., service instance, application, container) and their location.
Starting from build 0.6.7, the IBM Cloud command line has the capability to search across all your resources using Lucene query syntax, with a single instruction.
To use it, simply log in as usual in the IBM Cloud command line, select an account, and use ibmcloud resource search.
For example, imagine you would like to look for all your resources named “ABC”:
ibmcloud resource search ‘name:ABC’
The following table shows the resource attributes you can use in your search parameters:
Below, you can see some search examples:
All resources named MyResource:ibmcloud resource search ‘name:MyResource’
All cloud foundry applications named MyResource :ibmcloud resource search ‘name:my* AND type:cf-application’
All service instances of Message Hub:ibmcloud resource search ‘service_name:messagehub’
All resources in either the cloud foundry organization a07181ca-f917-4ee6-af22-b2c0c2a2d5d7 or in the resource group c900d9671b235c00461c5e311a8aeced in region us-south:ibmcloud resource search (organization_id:a07181ca-f917-4ee6-af22-b2c0c2a2d5d7 OR doc.resource_group_id:c900d9671b235c00461c5e311a8aeced) AND ‘region:us-south’
All resources created between May 16th 2018 and May 20th 2018:ibmcloud resource search “creation_date:[2018-05-16T00:00:00Z TO 2018-05-20T00:00:00Z]”
To learn more about the IBM Cloud command line, see the linked documentation.
To learn about more ways to search for IBM Cloud resources, please see the second article in this series: “Where Are My Resources? (Part 2)“