tencent cloud

Feedback

DescribeExistedInstances

Last updated: 2023-09-18 16:00:21

1. API Description

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

This API is used to query one or more existing node and determine whether they can be added to a cluster.

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: DescribeExistedInstances.
Version Yes String Common Params. The value used for this API: 2018-05-25.
Region No String Common Params. This parameter is not required for this API.
ClusterId No String Cluster ID. Enter the ClusterId field returned when you call the DescribeClusters API (Only VPC ID obtained through ClusterId need filtering conditions. When comparing statuses, the nodes on all clusters in this region will be used for comparison. You cannot specify InstanceIds and ClusterId at the same time.)
InstanceIds.N No Array of String Query by one or more instance ID(s). Instance ID format: ins-xxxxxxxx. (Refer to section ID.N of the API overview for this parameter's specific format.) Up to 100 instances are allowed for each request. You cannot specify InstanceIds and Filters at the same time.
Filters.N No Array of Filter Filter condition. For fields and other information, see the DescribeInstances API. If a ClusterId has been set, then the cluster's VPC ID will be attached as a query field. In this situation, if a "vpc-id" is specified in Filter, then the specified VPC ID must be consistent with the cluster's VPC ID.
VagueIpAddress No String Filter by instance IP (Supports both private and public IPs)
VagueInstanceName No String Filter by instance name
Offset No Integer Offset. Default value: 0. For more information on Offset, see the relevant section in the API Introduction.
Limit No Integer Number of returned results. Default value: 20. Maximum value: 100. For more information on Limit, see the relevant section in the API Introduction.
IpAddresses.N No Array of String Filter by multiple instance IPs

3. Output Parameters

Parameter Name Type Description
ExistedInstanceSet Array of ExistedInstance Array of existing instance information.
Note: This field may return null, indicating that no valid values can be obtained.
TotalCount Integer Number of instances that match the filter condition(s).
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying the list of existing nodes

This example shows you how to query whether the specified existing nodes can be added to a cluster.

Input Example

https://tke.tencentcloudapi.com/?Action=DescribeExistedInstances
&ClusterId=cls-xxxxxxxx
&<Common request parameters>

Output Example

{
    "Response": {
        "TotalCount": 1,
        "ExistedInstanceSet": [
            {
                "Usable": true,
                "UnusableReason": "",
                "AlreadyInCluster": "",
                "InstanceId": "ins-xxxxxxxx",
                "InstanceName": "Not named",
                "PrivateIpAddresses": [
                    "192.168.x.x"
                ],
                "PublicIpAddresses": [
                    "118.24.x.x"
                ],
                "CreatedTime": "2019-05-13T03:37:24Z",
                "CPU": 2,
                "Memory": 4,
                "OsName": "Ubuntu xxxxxxxxx",
                "InstanceType": "Sxxxxxx"
            }
        ],
        "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 Operation failed.
FailedOperation.AsCommon An error occurs while creating scaling group resources.
FailedOperation.ClusterNotFound The cluster is not found.
FailedOperation.ClusterState Cluster status error.
FailedOperation.CvmCommon Failed to create the node due to a CVM error
FailedOperation.Db Database error.
FailedOperation.Param Invalid parameter.
InternalError Internal error.
InternalError.AccountUserNotAuthenticated Account not verified.
InternalError.AsCommon Error creating scaling group resource.
InternalError.ClusterNotFound Cluster not found.
InternalError.ClusterState Cluster status error.
InternalError.CreateMasterFailed Failed to create cluster.
InternalError.CvmCommon Error in node creation.
InternalError.CvmNotFound CVM does not exist.
InternalError.Db DB error.
InternalError.DbAffectivedRows Database error.
InternalError.DbRecordNotFound Record not found.
InternalError.ImageIdNotFound Image not found.
InternalError.InitMasterFailed Failed to initialize Master.
InternalError.InvalidPrivateNetworkCidr Invalid CIDR.
InternalError.OsNotSupport Image OS not supported.
InternalError.Param Parameter error.
InternalError.UnexceptedInternal Internal error.
InternalError.VpcCommon VPC error
InternalError.VpcRecodrNotFound VPC record not found
InvalidParameter Parameter error.
LimitExceeded Quota limit is exceeded.
MissingParameter Missing parameter.
ResourceInUse The resource is occupied.
ResourceNotFound The resource does not exist.
ResourceUnavailable Resource is unavailable
UnauthorizedOperation Unauthorized operation.
UnknownParameter Unknown parameter.
UnsupportedOperation Unsupported operation.