UntagResources

Updated at:

Removes tags from the specified Wuying app instance groups according to Alibaba Cloud tag specifications. You can remove specific tags by tag key, or remove all custom tags from the resources at once by setting All to true without specifying tag keys. Currently, only the app instance group (APPINSTANCEGROUP) resource type is supported.

Operation description

Prerequisites

When you call this operation as a RAM user or by using STS credentials, you must have the appstreaming:UntagResources permission.

The resources from which you want to remove tags must belong to the current Alibaba Cloud account. This operation currently supports only app instance group resources. You must set ResourceType to APPINSTANCEGROUP. You can call the ListAppInstanceGroup operation to obtain the app instance group ID, and call the ListTagResources operation to query the tags bound to the resources.

metric description

  • A single request can remove labels from up to 50 resources. Duplicate resource IDs are automatically deduplicated.

  • You must specify at least one of TagKey.N and All: If neither is specified, or if TagKey.N is not specified and All is set to false, the error code InvalidParameter.TagKeyListOrAll is returned.
    • If TagKey.N is specified: Only the labels corresponding to these label keys are removed. A maximum of 20 label keys can be specified in a single request. In this case, the All parameter is ignored.

    • If TagKey.N is not specified and All is set to true: All custom labels on the resources are removed, including Wuying system labels that start with System/ and are attached by calling the TagResources operation.

  • If a specified label key does not exist on a resource, the label key is skipped and no fault is returned.

  • Label keys that start with System/ are Wuying system labels. Only System/Scheduler/GRAYSCALE and System/Scheduler/STOP_NEW_USER_CONNECTION are supported. If you specify other label keys that start with System/, the error code InvalidTagPolicy.KeyInvalid or InvalidTag.SystemKeyNotAllow is returned.

Execution results

  • If any specified app instance group does not exist or does not belong to the current account, the entire request fails, and the error code InvalidAppInstanceGroup.NotFound is returned. No tags are removed from any resources.

  • If tags are successfully removed, the response contains only RequestId and does not return tag details.

  • If multiple resources are specified and tags are removed from only some of the resources, the operation still returns a success response, and the response does not contain failure details. You can call the ListTagResources operation to verify the tag removal results. If only one resource is specified and tag removal fails, the operation directly returns the corresponding error code.

Call sequence

  1. Call the ListAppInstanceGroup operation to obtain the app instance group ID. To confirm the tag keys bound to the resources, call the ListTagResources operation.

  2. Call this operation, set ResourceType to APPINSTANCEGROUP, specify ResourceId.N, and specify TagKey.N or set All to true to indicate the tags to be removed.

  3. To bind tags again, call the TagResources operation.

The desensitized identifiers in the examples are used to demonstrate the format. Replace them with your actual identifiers when you call the operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

appstreaming:UntagResources

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. This parameter is required. Set this parameter to the ID of the region where the app instance group resides, such as cn-hangzhou.

cn-hangzhou

ResourceType

string

Yes

The resource type. This parameter is required. Currently, only app instance groups are supported. The value is not case-sensitive, but we recommend that you use uppercase letters:

  • APPINSTANCEGROUP: Wuying app instance group.

If you specify other values, the error code InvalidResourceType.Invalid is returned.

Valid values:

  • APPINSTANCEGROUP :

    Wuying app instance group.

APPINSTANCEGROUP

ResourceId

array

Yes

The list of resource IDs from which you want to remove tags. This parameter is required. Specify the app instance group IDs. A maximum of 50 IDs can be specified in a single request. Duplicate IDs are automatically deduplicated.

All IDs must belong to existing app instance groups within the current Alibaba Cloud account. If any ID does not exist or does not belong to the current account, the entire request fails and the error code InvalidAppInstanceGroup.NotFound is returned. No tags are removed from any resources.

string

Yes

The app instance group ID. You can call the ListAppInstanceGroup operation to obtain the ID.

aig-9ciijz60n4xsv****

TagKey

array

No

The list of tag keys to be removed. A maximum of 20 tag keys can be specified in a single request. You must specify at least one of TagKey.N and All. If neither is specified, the error code InvalidParameter.TagKeyListOrAll is returned.

  • If TagKey.N is specified, only the tags corresponding to these tag keys are removed, and the All parameter is ignored.

  • If a specified tag key does not exist on a resource, the tag key is skipped and no error is returned.

  • If TagKey.N is not specified, you must set All to true to remove all custom tags from the resources.

Tag keys that start with System/ are Wuying system tags. Only the following values are supported:

  • System/Scheduler/GRAYSCALE: The grayscale tag for the app instance group.

  • System/Scheduler/STOP_NEW_USER_CONNECTION: Prevents new connections from users newly bound to the app instance group.

If you specify other tag keys that start with System/, the error code InvalidTagPolicy.KeyInvalid or InvalidTag.SystemKeyNotAllow is returned.

string

Yes

The tag key. This parameter cannot be empty. You can call the ListTagResources operation to query the tag keys bound to the resources.

Resolution

All

boolean

No

Specifies whether to remove all custom tags from the resources. This parameter takes effect only when TagKey.N is not specified. If TagKey.N is specified, this parameter is ignored. Valid values:

  • true: Removes all custom tags from the resources, including Wuying system tags that start with System/ and are bound by calling the TagResources operation.

  • false (default): Does not remove all tags. If TagKey.N is also not specified, the error code InvalidParameter.TagKeyListOrAll is returned.

false

Response elements

Element

Type

Description

Example

object

The response of the request. If tags are successfully removed, only the request ID is returned.

RequestId

string

The request ID. You can use the request ID to troubleshoot issues.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

Examples

Success response

JSON format

{
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}

Error codes

HTTP status code

Error code

Error message

Description

500 ServiceUnavailable Service unavailable. Please try again later. Service unavailable. Please try again later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.