Domain name for API request: tke.tencentcloudapi.com.
This API is used to query the log collection rules.
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: DescribeLogConfigs. |
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. |
ClusterId | Yes | String | Cluster ID |
ClusterType | No | String | Currently supported cluster types are tke and eks. The default is tke. |
LogConfigNames | No | String | Search by collection rule name. For multiple collection rules, they are separated by ",". |
Offset | No | Integer | Offset. Default value: 0 |
Limit | No | Integer | Maximum number of output entries. Default value: 20; maximum value: 100. |
Parameter Name | Type | Description |
---|---|---|
Total | Integer | Total number of collection rules when performing paged search Note: This field may return "null", indicating that no valid value can be obtained. |
Message | String | Search by specified collection rule name. If partially failed, the failed collection rule name and the last failure reason will be returned. Note: This field may return "null", indicating that no valid value can be obtained. |
LogConfigs | String | Collection rule query results Note: This field may return "null", indicating that no valid value 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. |
This example shows you how to query collection rules.
POST / HTTP/1.1
Host: tke.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeLogConfigs
<Common request parameters>
{
"ClusterId": "cls-bz7ge4wl"
}
{
"Response": {
"RequestId": "583e6c4b-ff24-42f8-87f1-37e4c00d81b7",
"Total": 1,
"LogConfigs": "{\"ItemCount\":1,\"Items\":[{\"apiVersion\":\"cls.cloud.tencent.com/v1\",\"kind\":\"LogConfig\",\"metadata\":{\"name\":\"test1\"},\"spec\":{\"clsDetail\":{\"extractRule\":{\"backtracking\":\"0\",\"isGBK\":\"false\",\"jsonStandard\":\"false\",\"unMatchUpload\":\"false\"},\"indexs\":[{\"indexName\":\"namespace\"},{\"indexName\":\"pod_name\"},{\"indexName\":\"container_name\"}],\"logFormat\":\"default\",\"logType\":\"minimalist_log\",\"maxSplitPartitions\":0,\"period\":30,\"region\":\"ap-chengdu\",\"storageType\":\"\",\"topicId\":\"2912eb16-a56c-4b9b-adb0-9828db1ad342\"},\"inputDetail\":{\"containerStdout\":{\"containerOperator\":\"in\",\"includeLabels\":{\"app\":\"test1\"},\"metadataContainer\":[\"namespace\",\"pod_name\",\"pod_ip\",\"pod_uid\",\"container_id\",\"container_name\",\"image_name\",\"cluster_id\"],\"namespace\":\"default\",\"nsLabelSelector\":\"\"},\"type\":\"container_stdout\"},\"kafkaDetail\":{\"brokers\":\"\",\"instanceId\":\"\",\"kafkaType\":\"\",\"logType\":\"\",\"messageKey\":{\"value\":\"\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"\"}}},\"metadata\":{},\"timestampFormat\":\"\",\"timestampKey\":\"\",\"topic\":\"\"}},\"status\":{\"code\":\"success\",\"reason\":\"success\",\"status\":\"Synced\"}}]}"
}
}
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.KubernetesClientBuildError | Failed to create the Kubernetes client. |
FailedOperation.KubernetesGetOperationError | |
FailedOperation.KubernetesListOperationError | Failed to obtain the kubernetes resource list. |
FailedOperation.KubernetesResourceNotFound | Kubernetes is not found. |
FailedOperation.Param | Invalid parameter. |
InvalidParameter.Param | Invalid parameter. |
Was this page helpful?