tencent cloud

APIs

DescribeMachines

Download
Focus Mode
Font Size
Last updated: 2026-06-18 16:10:17

1. API Description

Domain name for API request: cwp.intl.tencentcloudapi.com.

This API is used to obtain the list of hosts in a specific region.

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: DescribeMachines.
Version Yes String Common Params. The value used for this API: 2018-02-28.
Region No String Common Params. This parameter is not required.
MachineType Yes String

Machine zone type
CVM: Cloud Virtual Machine
BM: Blackstone
ECM: Edge Computing Machine
LH: Lighthouse
Other: Hybrid cloud zone

MachineRegion Yes String

Machine region, for example, ap-guangzhou or ap-shanghai. For non-Tencent Cloud hosts, use ap-others.

Limit No Integer

Number of returned results. The default number is 10, and the maximum value is 100.

Offset No Integer

Offset. Default value: 0.

Filters.N No Array of Filter

Filter criteria.

  • Ips - String - Required: No - Query by IP
  • Names - String - Required: No - Query by instance name
  • InstanceIds - String - Required: No - Query by instance id
  • Version - String - Required: No - Current protection edition (PRO_VERSION: Pro Edition
  • ProjectIds.N No Array of Integer

    List of business IDs to which the machines belong

    MachineAppId No Integer

    APPID of the machine

    3. Output Parameters

    Parameter Name Type Description
    Machines Array of Machine

    Host list

    TotalCount Integer

    Number of hosts

    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 Obtaining the List of Hosts in a Specific Region

    This example shows you how to get the regional host list by the API (DescribeMachines).

    Input Example

    POST / HTTP/1.1
    Host: cwp.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeMachines
    <Common request parameters>
    
    {
        "Limit": 10,
        "MachineRegion": "ap-shanghai",
        "MachineType": "CVM",
        "Filters": [
            {
                "Values": [
                    "10.0.1.1"
                ],
                "Name": "Keywords"
            }
        ],
        "Offset": 0
    }
    

    Output Example

    {
        "Response": {
            "Machines": [
                {
                    "BaselineNum": 0,
                    "CloudTags": [
                        {
                            "TagKey": "Department",
                            "TagValue": "dev"
                        }
                    ],
                    "CyberAttackNum": 0,
                    "HasAssetScan": 0,
                    "InstanceId": "ins-111",
                    "InstanceState": "NORMAL",
                    "InvasionNum": 3,
                    "IpList": "1.1.1.1",
                    "IsAddedOnTheFifteen": 1,
                    "IsProVersion": false,
                    "KernelVersion": "3.10.0-1160.88.1.el7.x86_64",
                    "LicenseStatus": 0,
                    "MachineExtraInfo": {
                        "HostName": "demo-instance",
                        "InstanceID": "ins-111",
                        "NetworkName": "vpc-111",
                        "NetworkType": 1,
                        "PrivateIP": "1.1.1.1",
                        "WanIP": "1.1.1.1"
                    },
                    "MachineIp": "1.1.1.1",
                    "MachineName": "name01",
    "MachineOs": "CentOS 7.6 64-bit",
                    "MachineStatus": "ONLINE",
                    "MachineType": "CVM",
                    "MachineWanIp": "1.1.1.1",
                    "MalwareNum": 0,
                    "PayMode": "POSTPAY",
                    "ProjectId": 0,
                    "ProtectType": "BASIC_VERSION",
                    "Quuid": "3377add2-ee61-4c9a-99a3-************",
                    "RegionInfo": {
                        "Region": "ap-nanjing",
                        "RegionCode": "nj",
                        "RegionId": 33,
    "RegionName": "East China (Nanjing)"
                        "RegionNameEn": "East China (Nanjing)"
                    },
                    "Remark": "do not remove",
                    "SecurityStatus": "RISK",
                    "Tag": [
                        {
                            "Rid": 1001,
                            "Name": "cwp",
                            "TagId": 1022
                        }
                    ],
                    "Uuid": "3377add2-ee61-4c9a-99a3-************",
                    "VpcId": "vpc-1dj4***",
                    "VulNum": 0
                }
            ],
            "RequestId": "621b6063-12b2-43fa-809e-************",
            "TotalCount": 192
        }
    }
    

    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
    InternalError Internal error
    InvalidParameter Incorrect parameter.
    InvalidParameter.InvalidFormat Incorrect parameter format.
    InvalidParameter.MissingParameter Missing parameter.
    InvalidParameter.ParsingError Incorrect parameter parsing.
    InvalidParameterValue Invalid parameter value.
    MissingParameter Missing parameter error.

    Help and Support

    Was this page helpful?

    Help us improve! Rate your documentation experience in 5 mins.

    Feedback