DescribeCcns

Last updated: 2020-07-17 11:42:33

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.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com

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 parameter. The value used for this API: DescribeCcns.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
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 the CCN list by ID

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeCcns
    &<Common request parameters>
    &CcnIds.0=ccn-8j0phqix
    &CcnIds.1=ccn-gree226l

    Output Example

    {
      "Response": {
        "CcnSet": [
          {
            "CcnId": "ccn-8j0phqix",
            "CcnName": "test",
            "CcnDescription": "",
            "InstanceCount": 0,
            "CreateTime": "2018-06-10 16:21:35",
            "State": "AVAILABLE"
          },
          {
            "CcnId": "ccn-gree226l",
            "CcnName": "test",
            "CcnDescription": "",
            "InstanceCount": 1,
            "CreateTime": "2018-06-10 22:04:56",
            "State": "ISOLATED"
          }
        ],
        "TotalCount": 2,
        "RequestId": "73159790-39b3-48e8-9d61-29e11eed1acd"
      }
    }

    Example2 Querying the CCN list by name

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeCcns
    &<Common request parameters>
    &Filters.0.Name=ccn-name
    &Filters.0.Values.0=test

    Output Example

    {
      "Response": {
        "CcnSet": [
          {
            "CcnId": "ccn-8j0phqix",
            "CcnName": "test",
            "CcnDescription": "",
            "InstanceCount": 0,
            "CreateTime": "2018-06-10 16:21:35",
            "State": "AVAILABLE"
          },
          {
            "CcnId": "ccn-gree226l",
            "CcnName": "test",
            "CcnDescription": "",
            "InstanceCount": 1,
            "CreateTime": "2018-06-10 22:04:56",
            "State": "ISOLATED"
          },
          {
            "CcnId": "ccn-nzwnkrgt",
            "CcnName": "test name",
            "CcnDescription": "test description",
            "InstanceCount": 0,
            "CreateTime": "2018-06-18 11:18:30",
            "State": "AVAILABLE"
          },
          {
            "CcnId": "ccn-nrych3fn",
            "CcnName": "test name",
            "CcnDescription": "test description",
            "InstanceCount": 0,
            "CreateTime": "2018-06-18 11:20:58",
            "State": "AVAILABLE"
          }
        ],
        "TotalCount": 4,
        "RequestId": "d1f17eef-c7c9-4abe-b9ea-843fa5c8db16"
      }
    }

    Example3 Querying the list of CCNs bound to tags

    Query the CCNs bound to the tag key-value pair (env:test).

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeCcns
    &<Common request parameters>
    &Filters.0.Name=tag:env
    &Filters.0.Values.0=test

    Output Example

    {
      "Response": {
        "CcnSet": [
          {
            "CcnId": "ccn-nzwnkrgt",
            "CcnName": "test name",
            "CcnDescription": "test description",
            "InstanceCount": 0,
            "CreateTime": "2018-06-18 11:18:30",
            "State": "AVAILABLE",
            "TagSet": [
              {
                "Key": "env",
                "Value": "test"
              },
              {
                "Key": "TAG_TEST",
                "Value": "1111"
              }
            ]
          },
          {
            "CcnId": "ccn-nrych3fn",
            "CcnName": "test name",
            "CcnDescription": "test description",
            "InstanceCount": 0,
            "CreateTime": "2018-06-18 11:20:58",
            "State": "AVAILABLE",
            "TagSet": [
              {
                "Key": "TAG_TEST1",
                "Value": "tag1"
              },
              {
                "Key": "env",
                "Value": "test"
              }
            ]
          }
        ],
        "TotalCount": 2,
        "RequestId": "d1f17eef-c7c9-4abe-b9ea-843fa5c8db16"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    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 Invalid input parameter.
    InvalidParameter.Coexist The parameters cannot be specified at the same time.
    InvalidParameterValue.LimitExceeded The parameter value exceeds the limit.
    InvalidParameterValue.Malformed Invalid input parameter format.
    ResourceNotFound The resource does not exist.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help