Domain name for API request: cls.intl.tencentcloudapi.com.
This API is used to create a COS import task.
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: CreateCosRecharge. |
| 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. -Obtain the log topic Id through Get Log Topic List. |
| LogsetId | Yes | String | FL instance set ID. -Obtain the logset Id by searching the logset list. |
| Name | Yes | String | COS import task name, supports up to 128 bytes. |
| Bucket | Yes | String | COS bucket, see the supported bucket naming conventions. -Get COS buckets via GET Service (List Buckets). |
| BucketRegion | Yes | String | The region where the COS bucket is located, see the supported region list. |
| LogType | Yes | String | The type of log collected. json_log: JSON logs; delimiter_log: separator logs; minimalist_log: full text in a single lineDefault value: minimalist_log |
| Prefix | No | String | The prefix of the folder where COS files are located. By default, it is null, meaning that all files under the bucket will be shipped. |
| Compress | No | String | Valid values: supported: "", "gzip", "lzop", "snappy"; Default value: ""; no compression. |
| ExtractRuleInfo | No | ExtractRuleInfo | Extraction rule. If ExtractRule is set, LogType must be set. |
| TaskType | No | Integer | COS import task type. Valid values: 1: one-time import task (default value); 2: continuous import task. |
| Metadata.N | No | Array of String | Metadata. |
| Parameter Name | Type | Description |
|---|---|---|
| Id | String | COS import 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. |
This example shows you how to create a COS import task.
POST / HTTP/1.1
Host: cls.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateCosRecharge
<Common request parameters>
{
"TopicId": "ae13f7db-xxxx-xxxx-916e-407802axxxxx",
"LogsetId": "0af7e6bb-xxxx-xxxx-ad24-1129e9cxxxxx",
"Name": "test_name",
"Bucket": "examplebucket-1250000000",
"BucketRegion": "ap-guangzhou",
"Prefix": "text_prefix",
"LogType": "minimalist_log",
"Compress": "gzip",
"ExtractRuleInfo": {
"TimeKey": "date",
"TimeFormat": "%Y-%m-%d %H:%M:%S",
"Delimiter": "|",
"LogRegex": ".*",
"BeginRegex": "^",
"Keys": [
"date",
"",
"content"
],
"AdvanceFilterRules": [
{
"Key": "response_code",
"Rule": 0,
"Value": "400|500"
}
],
"UnMatchLogKey": "testlog",
"UnMatchUpLoadSwitch": true,
"Backtracking": -1
}
}
{
"Response": {
"Id": "ca092608-98e8-xxxx-xxxx-a6b3bbexxxxx",
"RequestId": "dc78ee34-xxxx-xxxx-8fcd-601a99b271f6"
}
}
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 |
|---|---|
| FailedOperation | Operation failed. |
| FailedOperation.Timeout | Operation timed out |
| InternalError | Internal error. |
| InvalidParameter | Incorrect parameter. |
| InvalidParameter.DbDuplication | The unique key of database conflicts. |
| LimitExceeded.BillingCosRechargeOutOfLimit | A billing topic can only create one cos collection configuration |
| 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. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan