Domain name for API request: cls.intl.tencentcloudapi.com.
This API is used to create a task to ship to COS. Note: To use this API, you need to check whether you have configured the role and permission for shipping to COS. If not, see Viewing and Configuring Shipping Authorization at https://www.tencentcloud.com/document/product/614/71623.?from_cn_redirect=1
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateShipper. |
| Version | Yes | String | Common Params. The value used for this API: 2020-10-16. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| TopicId | Yes | String | Log topic Id belonging to the created shipping rule.
|
| Bucket | Yes | String | COS bucket, see the supported bucket naming conventions.
|
| Prefix | Yes | String | New directory prefix delivered by the Shipping Rule.
|
| ShipperName | Yes | String | Shipping rule name. Supports a maximum of 255 characters. |
| Interval | No | Integer | Shipping time interval in seconds. Default: 300. Range: 300-900. |
| MaxSize | No | Integer | Maximum value of delivered files in MB. Default: 256. Range: 5-256. |
| FilterRules.N | No | Array of FilterRuleInfo | Filter rules for log shipping. Matched logs are shipped. The relationship between the rules is and. Up to 5 rules are allowed. An empty array indicates all logs are shipped without filtering. |
| Partition | No | String | Partition rules for log shipping support strftime time format representation |
| Compress | No | CompressInfo | Compression configuration of shipped logs |
| Content | No | ContentInfo | Content format configuration for shipped logs |
| FilenameMode | No | Integer | Delivery file naming configuration. 0: Random number naming, 1: Delivery time naming. Default: 0 (Random number naming). |
| StartTime | No | Integer | Starting point of the data shipping range (Unix second-level timestamp). It cannot exceed the starting point of the log topic's lifecycle. |
| EndTime | No | Integer | End time point of the data shipping range (unix second-level timestamp). It cannot be in the future. |
| StorageType | No | String | The storage type of an object. Default value is STANDARD. For enumeration values, please refer to the storage type overview document.
|
| RoleArn | No | String | Role ARN Create role |
| ExternalId | No | String | External ID |
| TimeZone | No | String | Used to generate time variables in the file path shipped to COS. Input limit: Support the following time zone list.
|
| DSLFilter | No | String | Pre-filtering process - perform pre-filtering on the original data written to COS |
| Parameter Name | Type | Description |
|---|---|---|
| ShipperId | String | Delivery task ID |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Create a cos delivery task rule
POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateShipper
<Common request parameters>
{
"TopicId": "fadcc986-xxxx-xxxx-b766-9ce9c193da32",
"Bucket": "examplebucket-1250000000",
"Prefix": "bow-test-1250000000",
"ShipperName": "bow-delivery task"
"Interval": 300,
"MaxSize": 5,
"FilenameMode": 1,
"FilterRules": [
{
"Key": "http",
"Regex": "^(\\d+\\.\\d+)\\..*",
"Value": "172.16"
}
],
"Partition": "/%Y/%m/%d/%H/",
"Compress": {
"Format": "none"
},
"RoleArn": "",
"ExternalId": "",
"Content": {
"Format": "json",
"Json": {
"EnableTag": true,
"MetaFields": [
"__SOURCE__",
"__FILENAME__",
"__HOSTNAME__",
"__TIMESTAMP__"
],
"JsonType": 1
}
},
"StartTime": 1735544418,
"EndTime": 0
}
{
"Response": {
"RequestId": "3d8b7942-xxxx-xxxx-8c14-7c665344223c",
"ShipperId": "a851ee81-xxxx-xxxx-852d-55fa5ac58269"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| AuthFailure | CAM signature/authentication error. |
| FailedOperation | Operation failed. |
| InternalError | Internal error. |
| InvalidParameter | Incorrect parameter. |
| InvalidParameter.ShipperConflict | Shipping rule naming conflict. |
| InvalidParameterValue | Incorrect parameter value. |
| LimitExceeded.Shipper | The number of shipping rules exceeds the limit. |
| MissingParameter | Missing parameter. |
| OperationDenied | Operation denied. |
| OperationDenied.ACLFailed | ACL verification failed. |
| OperationDenied.AccountDestroy | The account has been terminated. |
| OperationDenied.AccountIsolate | The account has overdue payments. |
| OperationDenied.AccountNotExists | The account does not exist. |
| ResourceNotFound.TopicNotExist | The log topic does not exist. |
文档反馈