tencent cloud

文档反馈

DescribeMachines

最后更新时间:2024-08-27 11:35:01

    1. API Description

    Domain name for API request: cwp.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 Type of the machine's zone
    CVM: Cloud Virtual Machine
    BM: BMECM: Edge Computing Machine
    LH: Lighthouse
    Other: Hybrid Cloud Zone
    MachineRegion Yes String Machine region. For example, ap-guangzhou and ap-shanghai.
    Limit No Integer Number of returns. It is 10 by default, 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 - instance ID for query
  • Status - String - required: no - client online status (OFFLINE: offline/shut down | ONLINE: online | UNINSTALLED: not installed | AGENT_OFFLINE: agent offline | AGENT_SHUTDOWN: agent shut down)
  • Version - String required: no - current edition ( PRO_VERSION: Pro Edition | BASIC_VERSION: Basic Edition | Flagship: Ultimate Edition | ProtectedMachines: Pro + Ultimate Editions)
  • Risk - String - required: no - risky host (yes)
  • Os - String - required: no - operating system (value of DescribeMachineOsList)

  • Each filter criterion supports only one value.
  • Quuid - String - required: no - CVM instance UUID. Maximum value: 100.
  • AddedOnTheFifteen - String required: no - whether to query only hosts added within the last 15 days (1: yes)
  •  TagId - String required: no - query the list of hosts associated with the specified tag 
  • ProjectIds.N No Array of Integer ID List of Businesses to which machines belong

    3. Output Parameters

    Parameter Name Type Description
    Machines Array of Machine List of hosts
    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 Getting Regional Host List

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

    Input Example

    POST / HTTP/1.1
    Host: cwp.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": [
                {
                    "MachineName": "test",
                    "MachineOs": "CentOS 7.6 64-bit",
                    "Uuid": "3377add2-ee61-4c9a-99a3-81d259dfc11a",
                    "Quuid": "3377add2-ee61-4c9a-99a3-81d259dfc11a",
                    "MachineIp": "1.1.1.1",
                    "MachineWanIp": "1.1.1.1",
                    "InstanceState": "NORMAL",
                    "InstanceId": "ins-111",
                    "ProjectId": 0,
                    "VpcId": "",
                    "IsProVersion": false,
                    "MachineStatus": "ONLINE",
                    "PayMode": "",
                    "Tag": [],
                    "CloudTags": null,
                    "MalwareNum": 0,
                    "VulNum": 0,
                    "BaselineNum": 0,
                    "CyberAttackNum": 0,
                    "InvasionNum": 3,
                    "SecurityStatus": "RISK",
                    "RegionInfo": {
                        "Region": "ap-nanjing",
                        "RegionName": "East China (Nanjing)",
                        "RegionId": 33,
                        "RegionCode": "nj",
                        "RegionNameEn": "East China (Nanjing)"
                    },
                    "MachineType": "CVM",
                    "LicenseStatus": 0,
                    "HasAssetScan": 0,
                    "KernelVersion": "3.10.0-1160.88.1.el7.x86_64",
                    "ProtectType": "BASIC_VERSION",
                    "IsAddedOnTheFifteen": 1,
                    "IpList": "1.1.1.1",
                    "Remark": "",
                    "MachineExtraInfo": {
                        "WanIP": "1.1.1.1",
                        "PrivateIP": "1.1.1.1",
                        "NetworkType": 1,
                        "NetworkName": "vpc-111",
                        "InstanceID": "ins-111",
                        "HostName": ""
                    }
                }
            ],
            "RequestId": "621b6063-12b2-43fa-809e-5481c8374c0a",
            "TotalCount": 1
        }
    }
    

    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.