tencent cloud

Feedback

CreateCosRecharge

Last updated: 2024-04-15 19:58:45

    1. API Description

    Domain name for API request: cls.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.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    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 No String Common Params. This parameter is not required for this API.
    TopicId Yes String ID of the log topic.
    LogsetId Yes String ID of the logset.
    Name Yes String Shipping task name.
    Bucket Yes String COS bucket, see the supported bucket naming conventions.
    BucketRegion Yes String The region where the COS bucket is located, see the supported region list.
    Prefix Yes String The prefix of the folder where COS files are located.
    LogType Yes String The type of log collected. json_log: JSON logs; delimiter_log: separator logs; minimalist_log: full text in a single line
    Default value: minimalist_log
    Compress No String Valid values: supported: "", "gzip", "lzop", "snappy"; Default value: "".
    ExtractRuleInfo No ExtractRuleInfo Extraction rule. If ExtractRule is set, LogType must be set.

    3. Output Parameters

    Parameter Name Type Description
    Id String cos_recharge record ID
    Note: This field may return null, indicating that no valid values can be obtained.
    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.

    4. Example

    Example1 Creating a COS Import Task

    This example shows you how to create a COS import task.

    Input Example

    POST / HTTP/1.1
    Host: cls.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateCosRecharge
    <Common request parameters>
    
    {
        "TopicId": "xxx-xxx-xxx-xxx",
        "LogsetId": "xxx-xxx-xxx-xxx",
        "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"
            ],
            "FilterKeyRegex": [
                {
                    "Key": "xxx",
                    "Regex": "ssss"
                }
            ],
            "UnMatchLogKey": "testlog",
            "UnMatchUpLoadSwitch": true,
            "Backtracking": -1
        }
    }
    

    Output Example

    {
        "Response": {
            "Id": "abc-dec-ff-ee",
            "RequestId": "xxx-x-xx-xx"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    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.
    InternalError Internal error.
    InvalidParameter Incorrect parameter.
    InvalidParameter.DbDuplication The unique key of database conflicts.
    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.