tencent cloud

Feedback

DescribeLogSwitches

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

1. API Description

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

This API is used to query Cluster Log (Auditing, Event, Common Log) Switch List.

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: DescribeLogSwitches.
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.
ClusterIds.N Yes Array of String List of cluster IDs
ClusterType No String Cluster Type, TKE or EKS

3. Output Parameters

Parameter Name Type Description
SwitchSet Array of Switch Cluster log switch collection
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.

4. Example

Example1 Querying the API examples of switch list

This example shows you how to obtain container log component switch information.

Input Example

POST / HTTP/1.1
Host: tke.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeLogSwitches
<Common request parameters>

{
    "ClusterType": "tke",
    "ClusterIds": [
        "cls-dpla09lf",
        "cls-oh0o9d8f",
        "cls-9r7hfd5h"
    ]
}

Output Example

{
    "Response": {
        "RequestId": "bd5b2352-8900-4ab7-b79b-2f51f2e92c26",
        "SwitchSet": [
            {
                "Audit": {
                    "Enable": false,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "ClusterId": "cls-oh0o9d8f",
                "Event": {
                    "Enable": false,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "Log": {
                    "Enable": false,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "MasterLog": {
                    "Enable": false,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": ""
                }
            },
            {
                "Audit": {
                    "Enable": true,
                    "LogsetId": "d12706e7-ae3b-42cf-9dab-d41e71482193",
                    "TopicId": "77b6130b-81cf-46dc-9faf-8d4b5afca77f",
                    "TopicRegion": "ap-chengdu",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "ClusterId": "cls-dpla09lf",
                "Event": {
                    "Enable": true,
                    "LogsetId": "d12706e7-ae3b-42cf-9dab-d41e71482193",
                    "TopicId": "ec5a1f8e-5234-419b-bf10-e5789e325bdf",
                    "TopicRegion": "ap-chengdu",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "Log": {
                    "Enable": true,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": "1.1.14"
                },
                "MasterLog": {
                    "Enable": false,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": ""
                }
            },
            {
                "Audit": {
                    "Enable": true,
                    "LogsetId": "299ec2db-8139-4f4c-8f83-6022e427df65",
                    "TopicId": "72d439f2-befa-47cb-924b-39c2d7a64d0b",
                    "TopicRegion": "ap-chengdu",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "ClusterId": "cls-9r7hfd5h",
                "Event": {
                    "Enable": true,
                    "LogsetId": "299ec2db-8139-4f4c-8f83-6022e427df65",
                    "TopicId": "20408e26-932a-4400-a0c8-c5874669265b",
                    "TopicRegion": "ap-chengdu",
                    "UpgradeAble": false,
                    "Version": ""
                },
                "Log": {
                    "Enable": true,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": "1.1.14"
                },
                "MasterLog": {
                    "Enable": false,
                    "LogsetId": "",
                    "TopicId": "",
                    "TopicRegion": "",
                    "UpgradeAble": false,
                    "Version": ""
                }
            }
        ]
    }
}

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.
FailedOperation.ComponentClientUnpack Internal HTTP decapsulation failed.
FailedOperation.KubernetesListOperationError Failed to obtain the kubernetes resource list.
FailedOperation.RBACForbidden The sub-account does not have the required RBAC permissions.
InternalError Internal error.
InternalError.KubernetesClientBuildError Failed to create the kubernetes client.
InternalError.KubernetesGetOperationError Failed to obtain the kubernetes resources
InternalError.Param Parameter error.
InternalError.UnexceptedInternal Internal error.
InternalError.UnexpectedInternal Unknown internal error.