Search code examples
ibm-cloud-infrastructure

Softlayer SLCLI server list by pattern


I want to query my list of servers, but only return servers that match a pattern; reason for this is I want to contact a specific set of servers, for example: server_apisX, and server_uiX.

I tried slcli vs list -H myhostprefix but it only matches exact matches.

Thanks


Solution

  • Complementing the previous answer …

    Please, try the following examples:

    Hostname to test: “myhostname-vsi-test

    • Contains part of the hostname:

      slcli vs list –H “*=vsi”

    • Begins with:

      slcli vs lsit –H “^= myhost”

    • Ends with:

      slcli vs lsit –H “$= test”

    References:

    https://docs.omniref.com/ruby/gems/softlayer_api/2.1.1/symbols/SoftLayer::ObjectFilter#line=2