Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Ryan Tiffany
Ryan Tiffany

Posted on

     

Getting Started with IBM Cloud CLI Search

Overview

This guide will show you how to get started using the IBM Cloud CLIresource search function to locate resources on your account.

The examples are divided in to two sections:

  • Cloud = IBM Cloud Resources.
  • IaaS = Classic Infrastructure (SoftLayer) Resources.

If you do not have the IBM Cloud CLI installed you can refer to thisdoc for installation instructions. Alternately you can useIBM Cloud Shell which has all of the tools we will need out of the box.

Search Cloud Resources (Cloud)

$ibmcloud resource search'name:devcluster'
Enter fullscreen modeExit fullscreen mode

Search by resource name and return CRN (Cloud)

$ ibmcloud resource search 'name:devcluster' --output json | jq -r '.items[].crn'
Enter fullscreen modeExit fullscreen mode

Search by resource tag (Cloud)

$ibmcloud resource search'tags:ryantiffany'--output json
Enter fullscreen modeExit fullscreen mode

Return resource names (Cloud)

$ibmcloud resource search'tags:ryantiffany'--output json | jq-r'.items[].name'
Enter fullscreen modeExit fullscreen mode

Return resource CRNs (Cloud)

$ibmcloud resource search'tags:ryantiffany'--output json | jq-r'.items[].crn'
Enter fullscreen modeExit fullscreen mode

Return resource types (Cloud)

$ibmcloud resource search'tags:ryantiffany'--output json | jq-r'.items[].type'
Enter fullscreen modeExit fullscreen mode

Search classic infrastructure (IaaS)

$ibmcloud resource search-p classic-infrastructure--output json
Enter fullscreen modeExit fullscreen mode

Search classic infrastructure by tag (IaaS)

$ibmcloud resource search"tagReferences.tag.name:ryantiffany"-p classic-infrastructure--output json
Enter fullscreen modeExit fullscreen mode

Return resource types (IaaS)

$ibmcloud resource search"tagReferences.tag.name:ryantiffany"-p classic-infrastructure--output json | jq-r'.items[].resourceType'
Enter fullscreen modeExit fullscreen mode

Search by tag and filter on virtual instances (IaaS)

$ibmcloud resource search"tagReferences.tag.name:ryantiffany _objectType:SoftLayer_Virtual_Guest"-p classic-infrastructure--output json
Enter fullscreen modeExit fullscreen mode

Search IaaS Virtual instances by Tag and return FQDNs

$ibmcloud resource search"tagReferences.tag.name:ryantiffany _objectType:SoftLayer_Virtual_Guest"-p classic-infrastructure--output json | jq-r'.items[].resource.fullyQualifiedDomainName'
Enter fullscreen modeExit fullscreen mode

Search IaaS Virtual instances by Tag and return instance ID's

shell$ ibmcloud resource search "tagReferences.tag.name:<tag>
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Location
    Houston, TX
  • Work
    Sr. Cloud Design Engineer at IBM
  • Joined

More fromRyan Tiffany

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp