百度智能云

All Product Document

          Cloud Compute Service

          Tag List

          Description

          • This API is used to list all tag key-value pairs conforming to conditions.
          • The tag key and the tag value can be used as the filter criteria.
          • This API is used to return all results conforming to conditions without paging.

          Request

          Request structure

          GET /v{version}/tag?tagKey={tagkey}&tagValue={tagValue} HTTP/1.1
          Host: tag.baidubce.com
          Authorization: authorization string

          Request Header Field

          There are no other special header fields except the public header field.

          Request Parameters

          Parameter Name Type Required Parameter Position Description
          version String Yes URL parameter API version number
          tagKey String No Query parameter Tag key to query. When this option does not appear or is empty, it indicates to query all tag keys.
          tagValue String No Query parameter Tag value to query. When this option does not appear, it indicates to query all tag values. When this option is empty, it indicates that the tag value to query is the empty string.

          Return

          Return a header field

          There are no other special header fields except the common header field.

          Return Parameter

          Parameter Name Type Description
          tags List<<Tag> List of tag key-value pair conforming to conditions. If no tag conforms to conditions, it returns an empty array.

          Error code

          Without special return error code

          Example

          Request example

          GET /v1/tag?tagKey=key1 HTTP/1.1
          Host: tag.baidubce.com
          Authorization: bce-auth-v1/5004fa6158924aa3a752f6897782af8d/2018-04-09T00:00:00Z/1800/host/807f9b9a5bc5c0f38fd184582f1b4028a736687864df86440c443282ddb4ca9e

          Return Example

          cache-control: no-cache
          content-length: 0
          content-type: text/plain; charset=utf-8
          date: Mon, 09 Apr 2018 00:00:00 GMT
          server: BWS
          x-bce-request-id: ec40cddb-b5d0-45ae-9325-2822ece684cf
          
          {
              "tags": [
                  {
                      "tagKey": "key1",
                      "tagValue": "value1"
                  }
              ]
          }
          Previous
          Create a Tag
          Next
          Delete a Tag