Skip to Main Content
Status Delivered
Workspace * IBM Cloud Ideas
Categories CLI
Created by Guest
Created on Oct 1, 2019

Resource group as parameter for cli commands

When querying or updating resources that are tied to a resource group, you first have to target this specific resource group. That retarget takes quite a while and is also cumbersome when chaining commands. Therefore it would be nice, if you could pass the resource group to all such commands as a parameter. For some commands this is possible, for others it is not. Also it would be nice, if there was a parameter to do something on all resource groups at once. For example in the case where we were asked to provide the versions of postgres that we use, putting together that command was unnecessarily hard to do. (e.g.

ibmcloud resource groups | grep ACTIVE | sort | awk '{print $1}' | while read -r rg; do ibmcloud target -g "$rg" >/dev/null; echo "\n$rg\n================";ibmcloud cdb ls | grep eu-de | awk '{print $1; system( "ibmcloud cdb about "$1 "| grep -B1 Version")}'; done >> services)

  • Guest
    Oct 29, 2019

    Marking this as Accepted, to be considered to be included in a future CLI release. Thank you for the feedback!