Getting a list of virtual machines

Ops Center Analyzer REST API Reference Guide

Version
11.0.x
Audience
anonymous
Part Number
MK-99ANA003-18

You can obtain a list of virtual machines and information about virtual machines, such as names and status.

Execution permission

Admin, Modify

Request line

GET baseURL/v1/objects/VirtualMachines?page={page}&pageSize={size}

Query parameters

The following table describes the values for the supported parameters of a query string:

Parameter

Description

page={page}

(Optional) Specify the paging information (page to be obtained).

Filtering conditions:

Checks whether the comparison target is equal to the value

pageSize={size}

(Optional) Specify the number of items that can be displayed on 1 page.

Filtering conditions:

Checks whether the comparison target is equal to the value

Request body

Not applicable.

Response body

The structure of the response body and the object attributes is as follows:

Collections

{
        "data":["...", ...],
        "pagination":{
            "page":"...",
            "pageSize":"...",
            "numPages":"...",
            "totalCount":"..."
        },
        "count":"..."
}

Collections (Type: Collections)

Attribute

Type

Description

data

anyType[]

A list of VirtualMachine objects. For details, see the table below.

pagination

Pagination

Page information. This parameter is displayed only when the relevant resource exists.

count

int

Number of data items that meet the conditions related to this query(API).

pagination (Type: Pagination)

Attribute

Type

Description

page

integer

Page.

pageSize

integer

Size of page.

numPages

integer

Number of pages.

totalCount

integer

Number of objects.

VirtualMachine

{
        "instanceID":"...",
        "name":"...",
        "ipAddress":"...",
        "status":"...",
        "monitorStatus":"...",
        "description":"...",
        "clusterName":"...",
        "hypervisorType":"...",
        "hypervisorID":"...",
        "hypervisorName":"...",
        "hostName":"...",
        "thresholdProfileID":"...",
        "thresholdProfileName":"...",
        "groupIDs":["...", ...],
        "groupNames":["...", ...],
        "gradeNames":["...", ...],
        "gradeOrders":["...", ...],
        "managementToolNames":["...", ...],
        "managementToolIDs":["...", ...],
        "profileResourceType":"...",
        "assignmentSchedule":"..."
}

VirtualMachine (Type: VirtualMachine)

Attribute

Type

Description

instanceID

string

ID of the virtual machine.

name

string

Name of the virtual machine.

ipAddress

string

IP Address set for the virtual machine.

status

enum

Status of the virtual machine.

(For details about the valid values, see the table NodeStatusType in List of enumerators.)

  • Normal
  • Warning
  • Critical
  • Unknown

monitorStatus

enum

Monitoring status of the virtual machine.

(For details about the valid values, see the table ComponentMonitorType in List of enumerators.)

  • InUse
  • NotMonitored

description

string

Description ot the virtual machine.

clusterName

string

Name of the Cluster that the virtual machine belongs to.

hypervisorType

enum

Type of hypervisor that the virtual machine belongs to.

(For details about the valid values, see the table ArgusNodeType in List of enumerators.)

  • SERVER_ESX
  • SERVER_HYPERV

hypervisorID

string

ID of the hypervisor that the virtual machine belongs to.

hypervisorName

string

Name of the hypervisor that the virtual machine belongs to.

hostName

string

The name of host whitch is installed on virtual machine.

thresholdProfileID

string

ID of the threshold profile assigned to the virtual machine.

thresholdProfileName

string

Name of the threshold profile assigned to the virtual machine.

groupIDs

string[]

ID of the consumer assigned to the virtual machine.

groupNames

string[]

Name of the consumer assigned to the virtual machine.

gradeNames

string[]

ID of the grade of the consumer assigned to the virtual machine.

gradeOrders

integer[]

Priority of the grade of the consumer assigned to the virtual machine.

managementToolNames

string[]

Name of the data center that the virtual machine belongs to.

managementToolIDs

string[]

ID of the data center that the virtual machine belongs to.

profileResourceType

enum

Resource type of the threshold profile.

(For details about the valid values, see the table PerformanceResourceType in List of enumerators.)

assignmentSchedule

dateTime

Scheduled Assignment Time

Status codes

Status code

Reason phrase

Description

200

OK

Success.

401

Unauthorized

No login privilege.

403

Forbidden

No reference privilege.

412

Precondition Failed

The server is not available.

500

Internal Server Error

Server processing error.

503

Service Unavailable

Analyzer detail view server communication error.

Example code

[Request Header]
GET /Analytics/v1/objects/VirtualMachines
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
Host: localhost:22015
Accept: application/json
Content-Type: application/json

[Response Header]
HTTP/1.1 200 OK
Date: Wed, 20 Jul 2016 02:18:11 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO 33659a74fcee4358dc272b34eca6ded1bf1131ec_YXZvNFIMehp3UB4jbmVyPGUgT3Q=_V0810
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Transfer-Encoding: chunked
Content-Type: application/json


[Response Body]
    {
      "data" : [ {
        "instanceID" : "vm#ABC_172.17.17.115_vm-413",
        "name" : "%2fvmfs%2fvolumes%2f85e4a185-ce22303c%2fvm0301_vMhot_vmonly%2fvm0301_vMhot_vmonl",
        "status" : "Unknown",
        "monitorStatus" : "InUse",
        "description" : "",
        "hypervisorType" : "SERVER_ESX",
        "hypervisorID" : "h#ABC_172.17.17.115_host-276",
        "hypervisorName" : "172.17.17.118",
        "hostName" : "vm0301vMhotvmonly",
        "thresholdProfileID" : "thProfile#ESX_VM",
        "thresholdProfileName" : "Default Profile for VM (VMware)",
        "groupIDs" : [ "group#0" ],
        "groupNames" : [ "#Unassigned Resources" ],
        "gradeNames" : [ "-" ],
        "gradeOrders" : [ 2147483647 ],
        "managementToolNames" : [ "DataCenter" ],
        "managementToolIDs" : [ "dc#ABC_172.17.17.115_datacenter-21" ],
        "profileResourceType" : "ESX_VM"
      }, {
       ......
      } ],
      "count" : 68
    }