tencent cloud

文档反馈

DescribeCcns

最后更新时间:2023-08-23 14:11:37

1. API Description

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

This API (DescribeCcns) is used to query the CCN list.

A maximum of 100 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: DescribeCcns.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region No String Common Params. This parameter is not required for this API.
CcnIds.N No Array of String The CCN instance ID, such as ccn-f49l6u0z. Each request can have a maximum of 100 instances. CcnIds and Filters cannot be specified at the same time
Filters.N No Array of Filter Filter conditions. CcnIds and Filters cannot be specified at the same time.
  • ccn-id - String - (Filter condition) The unique ID of the CCN, such as vpc-f49l6u0z.
  • ccn-name - String - (Filter condition) The CCN name.
  • ccn-description - String - (Filter condition) CCN description.
  • state - String - (Filter condition) The instance status. 'ISOLATED': Isolated (the account is in arrears and the service is suspended.) 'AVAILABLE': Running.
  • tag-key - String - Required: no - (Filter condition) Filters by tag key.
  • tag:tag-key - String - Required: no - (Filter condition) Filters by tag key pair. For this parameter, tag-key will be replaced with a specific tag key. For more information, see this example: Querying the list of CCNs bound to tags.
  • Offset No Integer Offset
    Limit No Integer The returned quantity
    OrderField No String Order fields support CcnId, CcnName, CreateTime, State, and QosLevel
    OrderDirection No String Order methods. Ascending: ASC, Descending: DESC.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer The number of objects meeting the condition.
    CcnSet Array of CCN CCN object.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying CCN instances by IDs

    Input Example

    POST / HTTP/1.1
    Host: vpc.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeCcns
    <Common request parameters>
    
    {
        "CcnIds": [
            "ccn-8j0phqix"
        ]
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "RequestId": "73159790-39b3-48e8-9d61-29e11eed1acd",
            "CcnSet": [
                {
                    "InstanceCount": 1,
                    "TagSet": [
                        {
                            "Value": "env",
                            "Key": "test"
                        }
                    ],
                    "RoutePriorityFlag": true,
                    "CcnId": "ccn-8j0phqix",
                    "CcnDescription": "test",
                    "State": "AVAILABLE",
                    "InstanceChargeType": "POSTPAID",
                    "CcnName": "test",
                    "QosLevel": "AU",
                    "BandwidthLimitType": "INTER_REGION_LIMIT",
                    "CreateTime": "2020-09-22 00:00:00",
                    "RouteTableFlag": null,
                    "RouteTableCount": null
                }
            ]
        }
    }
    

    Example2 Querying CCN instances by names

    Input Example

    POST / HTTP/1.1
    Host: vpc.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeCcns
    <Common request parameters>
    
    {
        "Filters": [
            {
                "Values": [
                    "test"
                ],
                "Name": "ccn-name"
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "RequestId": "73159790-39b3-48e8-9d61-29e11eed1acd",
            "CcnSet": [
                {
                    "InstanceCount": 1,
                    "TagSet": [
                        {
                            "Value": "env",
                            "Key": "test"
                        }
                    ],
                    "RoutePriorityFlag": true,
                    "CcnId": "ccn-8j0phqix",
                    "CcnDescription": "test",
                    "State": "AVAILABLE",
                    "InstanceChargeType": "POSTPAID",
                    "CcnName": "test",
                    "QosLevel": "AU",
                    "BandwidthLimitType": "INTER_REGION_LIMIT",
                    "CreateTime": "2020-09-22 00:00:00",
                    "RouteTableFlag": null,
                    "RouteTableCount": null
                }
            ]
        }
    }
    

    Example3 Querying the list of CCN instances bound with the specified tag

    This example shows you how to query the CCN instances associated with the tag env:test.

    Input Example

    POST / HTTP/1.1
    Host: vpc.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeCcns
    <Common request parameters>
    
    {
        "Filters": [
            {
                "Values": [
                    "test"
                ],
                "Name": "tag:env"
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "RequestId": "73159790-39b3-48e8-9d61-29e11eed1acd",
            "CcnSet": [
                {
                    "InstanceCount": 1,
                    "TagSet": [
                        {
                            "Value": "env",
                            "Key": "test"
                        }
                    ],
                    "RoutePriorityFlag": true,
                    "CcnId": "ccn-8j0phqix",
                    "CcnDescription": "test",
                    "State": "AVAILABLE",
                    "InstanceChargeType": "POSTPAID",
                    "CcnName": "test",
                    "QosLevel": "AU",
                    "BandwidthLimitType": "INTER_REGION_LIMIT",
                    "CreateTime": "2020-09-22 00:00:00",
                    "RouteTableFlag": null,
                    "RouteTableCount": null
                }
            ]
        }
    }
    

    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
    InvalidParameter A parameter error occurred.
    InvalidParameter.Coexist The parameters cannot be specified at the same time.
    InvalidParameter.FilterInvalidKey The specified filter condition does not exist.
    InvalidParameter.FilterNotDict The specified filter condition should be a key-value pair.
    InvalidParameter.FilterValuesNotList The specified filter value should be a list.
    InvalidParameterValue.LimitExceeded The parameter value exceeds the limit.
    InvalidParameterValue.Malformed Invalid input parameter format.
    InvalidParameterValue.Range The parameter value is not in the specified range.
    InvalidParameterValue.TooLong Invalid parameter value. The parameter value is too long.
    ResourceNotFound The resource does not exist.
    UnsupportedOperation Unsupported operation.
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持