Skip to content

Commit

Permalink
Kent Hall: Update cli_resource_group.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KentHall2018 committed Jun 11, 2024
1 parent da70f08 commit b3e2ac3
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions reference/ibmcloud/cli_resource_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

copyright:
years: 2018, 2024
lastupdated: "2024-06-05"
lastupdated: "2024-06-11"

keywords: cli, manage resources, resource group, ibmcloud resource group, ibmcloud resource, service-instance, quotas, resource group cli, resource cli

Expand Down Expand Up @@ -878,7 +878,7 @@ This command is only valid for access management tags. For example:

Attach one or more tags to a resource:
```bash
ibmcloud resource tag-attach --tag-names TAG_NAMES (--resource-name NAME | --resource-id RESOURCE_ID ) [--resource-type RESOURCE_TYPE] [--tag-type TAG_TYPE] [--account-id ACCOUNT_ID]
ibmcloud resource tag-attach --tag-names TAG_NAMES (--resource-name NAME | --resource-id RESOURCE_ID ) [--resource-type RESOURCE_TYPE] [--tag-type TAG_TYPE] [--account-id ACCOUNT_ID] [--replace] [--update]
```
{: codeblock}

Expand All @@ -903,6 +903,12 @@ ibmcloud resource tag-attach --tag-names TAG_NAMES (--resource-name NAME | --res
--account-id value
: The ID of the account that owns the resources to be tagged (required if tag-type is set to service).

--replace
: The list of tag names will replace the current list of tag names attached to the resource.

--update
: The tag names in the format `key:value` will be updated. The option has no effect on tag names that are not in that format.

-q, --quiet
: Suppress verbose output.

Expand Down Expand Up @@ -933,7 +939,6 @@ ibmcloud resource tag-attach --tag-names TAG_NAMES (--resource-name NAME | --res
```
{: codeblock}


* To attach the user tag `MyTag` to a classic infrastructure virtual guest named `MyVM`, first look for the ID of the virtual guest you would like to tag:
```bash
ibmcloud resource search 'fullyQualifiedDomainName:MyVM _objectType:SoftLayer_Virtual_Guest' -p classic-infrastructure
Expand All @@ -954,6 +959,34 @@ ibmcloud resource tag-attach --tag-names TAG_NAMES (--resource-name NAME | --res
```
{: codeblock}

* To update to `production` the value of the `env` user tag on a resource named `MyResource` run the following command:

```bash
ibmcloud resource tag-attach --tag-names 'env:production' --resource-name 'MyResource' --update
```
{: codeblock}

* To update to `production` the value of the `env` access management tag on a resource named `MyResource` run the following command:

```bash
ibmcloud resource tag-attach --tag-names 'env:production' --resource-name 'MyResource' --update --tag-type access
```
{: codeblock}

* To replace all user tags of `MyResource` with a new set of tags `tag1`, `tag2`, and `tag3` run the following command:

```bash
ibmcloud resource tag-attach --tag-names 'tag1,tag2,tag3' --resource-name 'MyResource' --replace
```
{: codeblock}

* To replace all access management tags of `MyResource` with the tag `compliance:hipaa` run the following command:

```bash
ibmcloud resource tag-attach --tag-names 'compliance:hipaa' --resource-name 'MyResource' --replace --tag-type access
```
{: codeblock}

## ibmcloud resource tag-detach
{: #ibmcloud_resource_tag_detach}

Expand Down Expand Up @@ -1014,7 +1047,6 @@ ibmcloud resource tag-detach --tag-names TAG_NAMES (--resource-name NAME | --res
```
{: codeblock}


* To detach the user tag `MyTag` to a classic infrastructure virtual guest named `MyVM`, first look for the ID of the virtual guest you would like to detach the tag from:
```bash
ibmcloud resource search 'fullyQualifiedDomainName:MyVM _objectType:SoftLayer_Virtual_Guest' -p classic-infrastructure
Expand All @@ -1035,6 +1067,19 @@ ibmcloud resource tag-detach --tag-names TAG_NAMES (--resource-name NAME | --res
```
{: codeblock}

* To detach the `env:value` tag from `MyResource`, regardless of its value, run the following command:

```bash
ibmcloud resource tag-detach --tag-names 'env:*' —resource-name 'MyResource'
```
{: codeblock}

* To detach all tags from `MyResource` run the following command:

```bash
ibmcloud resource tag-detach --tag-names '*' —resource-name 'MyResource'
```
{: codeblock}

## ibmcloud resource tag-delete
{: #ibmcloud_resource_tag_delete}
Expand Down

0 comments on commit b3e2ac3

Please sign in to comment.