tencent cloud

Feedback

CreateCLSLogConfig

Last updated: 2024-11-14 14:52:35

1. API Description

Domain name for API request: tke.tencentcloudapi.com.

This API is used to create log collection configuration.

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: CreateCLSLogConfig.
Version Yes String Common Params. The value used for this API: 2018-05-25.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
LogConfig Yes String Log collection configuration in json form
ClusterId Yes String Cluster ID
LogsetId No String CLS Logset ID
ClusterType No String Current cluster types support tke, eks.

3. Output Parameters

Parameter Name Type Description
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 log collection rule

This example shows you how to create the collection rules as calling.

Input Example

https://tke.tencentcloudapi.com/?Action=CreateCLSLogConfig
&LogConfig={\"apiVersion\":\"cls.cloud.tencent.com/v1\",\"kind\":\"LogConfig\",\"metadata\":{\"name\":\"stdout\"},\"spec\":{\"clsDetail\":{\"logType\":\"minimalist_log\",\"logFormat\":\"default\",\"topicId\":null,\"userDefineRule\":null,\"extractRule\":{\"timeKey\":null,\"timeFormat\":null,\"delimiter\":null,\"logRegex\":null,\"beginningRegex\":null,\"keys\":[],\"filterKeys\":[],\"filterRegex\":[],\"unMatchUpload\":\"false\",\"unMatchedKey\":null,\"backtracking\":\"0\"},\"topicName\":null,\"indexs\":[],\"region\":null},\"inputDetail\":{\"type\":\"container_stdout\",\"containerStdout\":{\"allContainers\":false,\"namespace\":null,\"workloads\":[{\"namespace\":\"default\",\"kind\":\"deployment\",\"name\":\"stdout\",\"container\":\"\"}],\"includeLabels\":null,\"container\":null,\"metadataLabels\":[]},\"containerFile\":null,\"hostFile\":null},\"kafkaDetail\":null}}
&ClusterId=cls-kaftesta
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "f12a6e20-f950-4af9-8f8b-b6329a4961c2"
    }
}

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.ClusterState Cluster status error.
FailedOperation.ComponentClientCommon Internal client error.
FailedOperation.ComponentClientHttp Internal HTTP client error.
FailedOperation.ComponentClientUnpack Internal HTTP decapsulation failed.
FailedOperation.CreateClsClient Failed to create CLS Client.
FailedOperation.CreateClsConfig Failed to create CLS collection configuration.
FailedOperation.CreateClsIndex Failed to create CLS index.
FailedOperation.CreateClsLogSet Failed to create the CLS log set.
FailedOperation.CreateClsMachineGroup Failed to create CLS machine group.
FailedOperation.CreateClsTopic Failed to create CLS topic.
FailedOperation.GetClsConfig Failed to obtain CLS collection configuration.
FailedOperation.GetClsConfigMachineGroups Failed to obtain the machine group bound to the CLS collection configuration.
FailedOperation.GetClsIndex Failed to obtain CLS index configuration.
FailedOperation.GetClsLogSet Failed to query the topic set.
FailedOperation.GetClsMachineGroup Failed to obtain the CLS machine group.
FailedOperation.GetClsMachineGroupConfigs Failed to obtain the collection configuration bound to the CLS machine group.
FailedOperation.GetClsTopic Failed to obtain CLS log topic.
FailedOperation.K8sClientBuildError Failed to create the Kubernetes client.
FailedOperation.KubeClientConnection Failed to connect to the customer Kubernetes cluster.
FailedOperation.KubeCommon Kubernetes API error.
FailedOperation.KubernetesClientBuildError Failed to create the Kubernetes client.
FailedOperation.KubernetesCreateOperationError An error occurs while creating the cluster client.
FailedOperation.KubernetesGetOperationError
FailedOperation.KubernetesInternal Unknown Kubernetes error.
FailedOperation.ModifyClsConfig Failed to modify CLS collection configuration.
FailedOperation.ModifyClsIndex Failed to modify CLS index.
FailedOperation.ModifyClsTopic Failed to modify CLS log topic.
InternalError.ComponentClientHttp Internal HTTP client error
InternalError.ComponentClinetHttp Error while requesting (HTTP) other Tencent Cloud services
InternalError.UnexceptedInternal Internal error.
InternalError.UnexpectedInternal Unknown internal error.
InvalidParameter.Param Invalid parameter.