DescribeMachines

Last updated: 2020-04-10 10:54:45

PDF

1. API Description

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

This API is used to get the list of servers in a specified region.

A maximum of 20 requests can be initiated per second for this API.

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: DescribeMachines.
Version Yes String Common parameter. The value used for this API: 2018-02-28.
Region No String Common parameter. This parameter is not required for this API.
MachineType Yes String Server type.
  • CVM: CVM
  • BM: BM
  • MachineRegion Yes String Server region, such as ap-guangzhou or ap-shanghai
    Limit No Integer Number of results to be returned. Default value: 10. Maximum value: 100.
    Offset No Integer Offset. Default value: 0.
    Filters.N No Array of Filter Filter.
  • Keywords - String - Required: No - Query keywords
  • Status - String - Required: No - Agent status (OFFLINE: offline, ONLINE: online)
  • Version - String Required: No - Current CWP edition (PRO_VERSION: Pro, BASIC_VERSION: Basic)

  • Each filter supports only one value. Query with multiple values in "OR" relationship is not supported for the time being

    3. Output Parameters

    Parameter Name Type Description
    Machines Array of Machine Server list
    TotalCount Integer Number of servers
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Getting the list of servers in region

    This example shows you how to get the list of servers in a specified region.

    Input Example

    https://yunjing.tencentcloudapi.com/?Action=DescribeMachines
    &MachineType=CVM
    &MachineRegion=ap-shanghai
    &Filters.0.Name=Keywords
    &Filters.0.Values.0=10.0.1.1
    &Limit=10
    &Offset=0
    &<Common request parameters>

    Output Example

    {
      "Response": {
        "RequestId": "354f4ac3-8546-4516-8c8a-69e3ab73aa8a",
        "Machines": [
          {
            "MachineName": "h2-stevenyu",
            "MachineIp": "10.104.86.62",
            "MachineWanIp": "132.104.86.62",
            "MachineOs": "centos6.5",
            "MachineStatus": "ONLINE",
            "Quuid": "6b6cd843-6bc1-4011-a74c-dc3fd26a7dd1",
            "Uuid": "9c6cd943-dbc1-4011-a74c-x4d9d26a7891",
            "IsProVersion": true,
            "PayMode": "PREPAY",
            "Tag": [
              {
                "Name": "Name",
                "Rid": 100
              }
            ],
            "VulNum": 10
          }
        ],
        "TotalCount": 100
      }
    }

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