API | Operation | Description |
Setting bucket tags | Sets tags for an existing bucket | |
Querying bucket tags | Queries the existing tags of a specified bucket | |
Deleting bucket tags | Deletes specified bucket tags |
cos.putBucketTagging({Bucket: 'examplebucket-1250000000', /*Required*/Region: 'COS_REGION', /* Bucket region. Required */Tagging: {Tags: [{"Key": "k1", "Value": "v1"},{"Key": "k2", "Value": "v2"}]}}, function(err, data) {console.log(err || data);});
Parameter Name | Description | Type | Required |
Bucket | Bucket for which the bucket tag is configured in the format: BucketName-APPID | String | Yes |
Region | Bucket region. For the enumerated values, see Regions and Access Domain Names | String | Yes |
Tagging | Tag information | Object | Yes |
- Tags | Tag information | ObjectArray | Yes |
- - Key | Tag name | String | Yes |
- - Value | Tag value | String | Yes |
function(err, data) { ... }
Parameter Name | Description | Type |
err | Object returned when an error (network error or service error) occurs. If the request is successful, this is null. For more information, see Error Codes | Object |
- statusCode | HTTP status code returned by the request, such as 200 , 403 , and 404 | Number |
- headers | Headers returned by the request | Object |
data | Data returned when the request is successful. If the request fails, this is null | Object |
- statusCode | HTTP status code returned by the request, such as 200 , 403 , and 404 | Number |
- headers | Headers returned by the request | Object |
cos.getBucketTagging({Bucket: 'examplebucket-1250000000', /*Required*/Region: 'COS_REGION', /* Bucket region. Required */}, function(err, data) {console.log(err || data);});
{"Tags": [{"Key": "k1", "Value": "v1"},{"Key": "k2", "Value": "v2"}],"statusCode": 200,"headers": {}}
Parameter Name | Description | Type | Required |
Bucket | Bucket for which the bucket policy is queried in the format: BucketName-APPID | String | Yes |
Region | Bucket region. For the enumerated values, see Regions and Access Domain Names | String | Yes |
function(err, data) { ... }
Parameter Name | Description | Type |
err | Object returned when an error (network error or service error) occurs. If the request is successful, this is null. For more information, see Error Codes | Object |
- statusCode | HTTP status code returned by the request, such as 200 , 403 , and 404 | Number |
- headers | Headers returned by the request | Object |
data | Data returned when the request is successful. If the request fails, this is null. | Object |
- statusCode | HTTP status code returned by the request, such as 200 , 403 , and 404 | Number |
- headers | Headers returned by the request | Object |
- Tags | Tag information | ObjectArray |
- - Key | Tag name | String |
- - Value | Tag value | String |
cos.deleteBucketTagging({Bucket: 'examplebucket-1250000000', /*Required*/Region: 'COS_REGION', /* Bucket region. Required */}, function(err, data) {console.log(err || data);});
Parameter Name | Description | Type | Required |
Bucket | Bucket for which the bucket tag is deleted in the format: BucketName-APPID | String | Yes |
Region | Bucket region. For the enumerated values, see Regions and Access Domain Names | String | Yes |
function(err, data) { ... }
Parameter Name | Description | Type |
err | Object returned when an error (network error or service error) occurs. If the request is successful, this is null. For more information, see Error Codes | Object |
- statusCode | HTTP status code returned by the request, such as 200 , 403 , and 404 | Number |
- headers | Headers returned by the request | Object |
data | Data returned when the request is successful. If the request fails, this is null. | Object |
- statusCode | HTTP status code returned by the request, such as 200 , 403 , and 404 | Number |
- headers | Headers returned by the request | Object |
Was this page helpful?