API | Operation | Description |
Setting versioning | Sets the versioning configuration of a bucket | |
Querying versioning | Queries the versioning configuration of a bucket |
Enabled
or Suspended
to enable or suspend versioning, respectively.cos.putBucketVersioning({Bucket: 'examplebucket-1250000000', /*Required*/Region: 'COS_REGION', /* Bucket region. Required */VersioningConfiguration: {Status: "Enabled"}}, function (err, data) {console.log(err || data);});
Parameter Name | Description | Type | Required |
Bucket | Bucket for which versioning is enabled or suspended in the format: BucketName-APPID | String | Yes |
Region | Bucket region. For the enumerated values, see Regions and Access Domain Names | String | Yes |
VersioningConfiguration | Defines the versioning configuration of the bucket | Object | Yes |
- Status | Versioning status; enumerated values: Enabled , Suspended | String | No |
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 | Header information 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 | Header information returned by the request | Object |
cos.getBucketVersioning({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 versioning 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 | Header information 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 | Header information returned by the request | Object |
- VersioningConfiguration | Versioning configuration of the bucket | Object |
- - Status | Versioning status; enumerated values: Enabled , Suspended | String |
Apakah halaman ini membantu?