How-tos

Where are my resources?

Share this post:

We all love leveraging cloud environments, but dealing with multiple geographically dispersed micro-services and service instances comes with the need of a robust and fast search engine that would help finding 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 login as usual in the IBM Cloud command line, select an account and then use ibmcloud resource search.

For example imagine you would like to look for all your resources named “ABC”:

ibmcloud resource search ‘name:ABC’

Now you’ll be wondering which are the resource attributes you can use in your search parameters.

Here you are:

Name of the attribute Description
name This is the user-provided name of the resource
region the geographical location where the resource has been provisioned. For example, you can use us-south, au-syd, eu-gb, eu-de
service_name the name of the service as it appear in the Name column of the output of bx catalog service-marketplace
family the cloud provider to which your resource belongs. For example you can specify cloud_foundry, containers or resource_controller
organization_id the Cloud Foundry organization GUID
space_id the Cloud Foundry space GUID
doc.resource_group_id the ID of the resource group
type the resource type. Examples of possible values are: k8-cluster, cf-service-instance, cf-user-provided-service-instance, cf-organization, cf-service-binding, cf-space, cf-application, resource-instance, resource-alias, resource-binding, resource-group
creation_date The date on which the resource has been created
modification_date The last modification date of the resource

 

Here 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 https://console.bluemix.net/docs/cli/reference/bluemix_cli/bx_cli.html#bluemix_cli

More How-tos stories

Configuring IBM Cloud App ID From the Toolchain

Learn how to configure the IBM Cloud App ID from a toolchain as part of continuous delivery process. This post gives some background and the script we use.

Continue reading

How to Backup Your IBM Cloud Linux Server

This post covers how to backup entire partitions in Linux systems. The process utilizes the tar command in IBM Cloud's unique rescue environment and showcases the simplicity and flexibility of the process.

Continue reading

Speed up your WordPress with IBM Cloud

WordPress is one of the most popular content management systems available, but the many websites and blogs that use it experience issues with speed. At IBM Cloud, there are several solutions that can help alleviate some of these issues and allow you to have a better and faster WordPress experience.

Continue reading