Skip to main content
Platform O&M/Tag Operations
POSTTag OperationsSince 3.2.0SynchronousAuth Required

AttachTagToResources

AttachTagToResources

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • tagUuidStringRequired

    The tag UUID.

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • resourceUuidsListRequired

      The resource UUID list.

    • tokensMap

      Optional. The key and the value stored by the tag.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • resultsListRequired

    See results.

    • successbooleanRequired

      操作是否成功。

    • errorErrorCodeRequired

      See error.

      • codeStringRequired

        The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

      • descriptionStringRequired

        The brief description of the error.

      • detailsStringRequired

        The details about the error.

      • elaborationStringRequired

        The reserved field. Default value: null.

      • opaqueLinkedHashMapRequired

        The reserved field. Default value: null.

      • causeErrorCodeRequired

        The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

    • inventoryUserTagInventoryRequired

      See inventory.

      • tagPatternUuidStringRequired

        标签模式UUID。

      • uuidStringRequired

        The resource UUID.

      • resourceUuidStringRequired

        资源UUID。若指定,资源会使用该字段值作为UUID。

      • resourceTypeStringRequired

        资源类型。

      • tagStringRequired

        标签。

      • typeStringRequired

        类型。

        • nameStringRequired

          The resource name.

        • ordinalintRequired

          No description provided.

      • createDateTimestampRequired

        The creation date.

      • lastOpDateTimestampRequired

        The last operation date.

      • tagPatternTagPatternInventoryRequired

        See tagPattern.

        • uuidStringRequired

          The resource UUID.

        • nameStringRequired

          The resource name.

        • valueStringRequired

          字段值。

        • descriptionStringRequired

          The detailed description of the resource.

        • colorStringRequired

          No description provided.

        • createDateTimestampRequired

          The creation date.

        • lastOpDateTimestampRequired

          The last operation date.

        • typeTagPatternTypeRequired

          See type.

          • nameStringRequired

            The resource name.

          • ordinalintRequired

            No description provided.

Endpoint

POST/zstack/v1/tags/{tagUuid}/resources

/zstack/v1/tags/{tagUuid}/resources

Operation ID

AttachTagToResources

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/tags/{tagUuid}/resources' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"resourceUuids":["<resourceUuids>"],"tokens":{}},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "results": [ { "inventory": { "tagPatternUuid": "f9060711c8453a2580f840d7aa1c5485", "uuid": "b2f817b3400232018956a4d2d198edc4", "resourceType": "DiskOfferingVO", "tag": "for-large-DB", "type": "User", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" }, "success": true } ] }

Change History

This API has no change history records yet.

View all change history