// removed jquery ui css and js

List VMs

Details

API Details
Name

List VMs

Description

Displays configured information for all VMs or for the specified VM. You can view a list by specifying any attribute used to Create Tenant.

MethodGET
URI
  • v1/tenants/tenantId/vms?regionName=regionName&depEnvId=depEnvId&ccmOnly=true
  • v1/tenants/tenantId/vms?regionName=regionName&depEnvId=depEnvId&nonCcmOnly=true

CloudCenter Release
  • Introduced in CloudCenter 4.0.
  • Updated in CloudCenter 4.6.1 to include vmOperationData.
Notes
  • For additional context on <PORT> usage in the following example(s), see Base URI Format.
  • The CloudCenter GET APIs display up to 20 entities in the listing by default. If you have more than 20 entities in your resource listing, use the pagination query parameters to view them beyond the first 20 entities returned by default. See the CloudCenter API Overview  > Pagination  section for additional context.
  • The response includes information for the specified tenantId only.
  • Use the View Deployment Environments to retrieve the depEnvId.
  • You can display information for VMs in a specific tenant by including the regionName, depEnvId, and type of deployment environment (ccmOnly or nonCcmOnly) query parameters with this API.
ESB Header
  • action: get.tenants.tenantId.vms
    actionparam: regionName=regionName&depEnvId=depEnvId&ccmOnly=true
  • action: get.tenants.tenantId.vms
    actionparam: regionName=regionName&depEnvId=depEnvId&nonCcmOnly=true

Example: Managed VMs

curl -k -X GET -H "Accept: application/json" -u cloudcenteradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v1/tenants/1/vms?depEnvId=1&regionName=Amazon-us-west-2&ccmOnly=true&page=0&size=30&sort=id"

Response

{
    "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms?depEnvId=1&regionName=
Amazon-us-west-2&ccmOnly=true&page=0&size=30&sort=id-",
    "size": 4,
    "pageNumber": 0,
    "totalElements": 4,
    "totalPages": 1,
    "vms": [
      {
        "id": "i-6f8abdab",
        "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-6f8abdab?depEnvId=1&
regionName=Amazon-us-west-2&ccmOnly=true&page=0&size=30&sort=id-",
        "perms": [],
        "hostName": "",
        "publicIpAddr": "5.3.10.13",
        "privateIpAddr": "12.3.4.6",
        "status": "Running",
        "startTime": 1450403495000,
        "stopTime": null,
        "isCliqrLaunched": true,
        "userId": "8",
        "jobId": "4",
        "jobName": "Jenkins_T0U02_20151215_001_run_1",
        "userEmail": "user.02@company.com",
        "vmOperationData": null
        "vmActionsData": [
            "STOP",
            "REBOOT",
            "DELETE"
        ]
 },
      {
        "id": "i-3488bff0",
        "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-3488bff0?depEnvId=1&
regionName=Amazon-us-west-2&ccmOnly=true&page=0&size=30&sort=id-",
        "perms": [],
        "hostName": "",
        "publicIpAddr": "5.3.11.17",
        "privateIpAddr": "12.3.4.1",
        "status": "Running",
        "startTime": 1450170900000,
        "stopTime": null,
        "isCliqrLaunched": true,
        "userId": "2",
        "jobId": "10",
        "jobName": "Jenkins_T0UA_20151215_001_run_1",
        "userEmail": "admin@company.com",
        "vmOperationData": null
        "vmActionsData": [
            "STOP",
            "REBOOT",
            "DELETE"
        ]
 }, 
      {
        "id": "i-116f59d5",
        "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-116f59d5?depEnvId=1&
regionName=Amazon-us-west-2&ccmOnly=true&page=0&size=30&sort=id-",
        "perms": [],
        "hostName": "",
        "publicIpAddr": "5.3.7.15",
        "privateIpAddr": "12.3.8.8",
        "status": "Running",
        "startTime": 1450174322000,
        "stopTime": null,
        "isCliqrLaunched": true,
        "userId": "4",
        "jobId": "18",
        "jobName": "Jenkins_T2UA_20151215_001_run_1",
        "userEmail": "admin@company.com",
        "vmOperationData": null
        "vmActionsData": [
            "STOP",
            "REBOOT",
            "DELETE"
        ]    
  }, 
      {
        "id": "i-f38dbc37",
        "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-f38dbc37?depEnvId=1&
regionName=Amazon-us-west-2&ccmOnly=true&page=0&size=30&sort=id-",
        "perms": [],
        "hostName": "",
        "publicIpAddr": "5.3.10.2",
        "privateIpAddr": "12.3.4.3",
        "status": "Running",
        "startTime": 1450234065000,
        "stopTime": null,
        "isCliqrLaunched": true,
        "userId": "2",
        "jobId": "36",
        "jobName": "Jenkins_T0UA_20151215_003_run_1",
        "userEmail": "admin@company.com",
        "vmOperationData": null
        "vmActionsData": [
            "STOP",
            "REBOOT",
            "DELETE"
        ]
     }
  ]
}

 

Example: Non-Managed VMs

curl -k -X GET -H "Accept: application/json" -u cloudcenteradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v1/tenants/1/vms?depEnvId=1®ionName=Amazon-us-west-2&nonCcmOnly=true&page=0&size=30&sort=id"

Response

{
    "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms?depEnvId=1&regionName=Amazon-
us-west-2&nonCcmOnly=true&page=0&size=30&sort=id-",
    "size": 5,
    "pageNumber": 0,
    "totalElements": 10,
    "totalPages": 1,
    "vms": [
      {
            "id": "i-6793096e",
            "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-6793096e?depEnvId=1&
regionName=Amazon-us-west-2&nonCcmOnly=true&page=0&size=30&sort=id-",
            "perms": [],
            "hostName": "ccm-aws",
            "publicIpAddr": "5.18.1.7",
            "privateIpAddr": "12.3.4.7",
            "status": "Running",
            "startTime": 1394049806000,
            "stopTime": null,
            "isCliqrLaunched": false,
            "userId": null,
            "jobId": null,
            "jobName": null,
            "userEmail": null,
            "vmOperationData": null
            "vmActionsData": [
               "STOP",
               "REBOOT",
               "DELETE"
        ]
   }, 
      {
            "id": "i-000e71d9",
            "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-000e71d9?depEnvId=1&
regionName=Amazon-us-west-2&nonCcmOnly=true&page=0&size=30&sort=id-",
            "perms": [],
            "hostName": "rabbit-centos7-4.3.2-20151215.01",
            "publicIpAddr": "5.2.15.2",
            "privateIpAddr": "12.3.1.4",
            "status": "Running",
            "startTime": 1450146278000,
            "stopTime": null,
            "isCliqrLaunched": false,
            "userId": null,
            "jobId": null,
            "jobName": null,
            "userEmail": null,
            "vmOperationData": null
            "vmActionsData": [
               "STOP",
               "REBOOT",
               "DELETE"
        ]
      }, 
      {
            "id": "i-34106fed",
            "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-34106fed?depEnvId=1&
regionName=Amazon-us-west-2&nonCcmOnly=true&page=0&size=30&sort=id-",
            "perms": [],
            "hostName": "ccm-centos7-4.3.2-20151215.01",
            "publicIpAddr": "5.2.12.8",
            "privateIpAddr": "12.3.2.19",
            "status": "Running",
            "startTime": 1450146130000,
            "stopTime": null,
            "isCliqrLaunched": false,
            "userId": null,
            "jobId": null,
            "jobName": null,
            "userEmail": null,
            "vmOperationData": null
            "vmActionsData": [
               "STOP",
               "REBOOT",
               "DELETE"
        ]
    }, 
      {
            "id": "i-04b52f0d",
            "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-04b52f0d?depEnvId=1&
regionName=Amazon-us-west-2&nonCcmOnly=true&page=0&size=30&sort=id-",
            "perms": [],
            "hostName": "cco-aws",
            "publicIpAddr": "5.18.2.1",
            "privateIpAddr": "12.3.3.1",
            "status": "Running",
            "startTime": 1394058621000,
            "stopTime": null,
            "isCliqrLaunched": false,
            "userId": null,
            "jobId": null,
            "jobName": null,
            "userEmail": null,
            "vmOperationData": null
            "vmActionsData": [
               "STOP",
               "REBOOT",
               "DELETE"
        ]
    }, 
      {
            "id": "i-da0f7003",
            "resource": "https://<HOST>:<PORT>/v1/tenants/1/vms/i-da0f7003?depEnvId=1&
regionName=Amazon-us-west-2&nonCcmOnly=true&page=0&size=30&sort=id-",
            "perms": [],
            "hostName": "cco-centos7-4.3.2-20151215.01",
            "publicIpAddr": "5.30.1.1",
            "privateIpAddr": "12.3.2.15",
            "status": "Running",
            "startTime": 1450146189000,
            "stopTime": null,
            "isCliqrLaunched": false,
            "userId": null,
            "jobId": null,
            "jobName": null,
            "userEmail": null,
            "vmOperationData": null
            "vmActionsData": [
               "STOP",
               "REBOOT",
               "DELETE"
        ]
       }
    ]
}

 

Request Attributes

tenantId
  • DescriptionUnique, system-generated identifier for the tenant organization. A tenant admin must belong to this tenant to invoke any APIs for this tenant. See Add Sub-Tenants > Tenant ID and Tenant Name Dependency.

  • Type: String

Required

regionName
  • DescriptionThe name of this cloud region as listed in Public Clouds.
  • Type: String

Required

depEnvId
  • DescriptionUnique, system-generated identifier for the deployment environment. See Deployment Environments for additional details. This attribute is the same as the environmentId attribute.
  • Type: String

Required

ccmOnly 
  • Description: Query parameter to identify if a VM is launched by the CloudCenter platform. See VM Operations for additional details.

    • false = Default. This VM is not launched by the CloudCenter platform 
    • true = This VM is launched by the CloudCenter platform
  • Type: String

Required

nonCcmOnly 
  • Description: Query parameter to identify if a VM is launched using another method (not by the CloudCenter platform). See VM Operations for additional details.

    • false = Default. This VM is not launched by the CloudCenter platform 
    • true = This VM is launched by the CloudCenter platform
  • Type: String

Required

Response Attributes

resource
  • Description: Unique URL to access this resource.
  • Type: String

See pageResource or Pagination for additional context

vms
  • Description: Identifies information about each VM
  • Type: Array of VMs

    id
    • DescriptionUnique, system-generated identifier for this CloudCenter Resource.

    • Type: String
    resource
    • Description: Unique URL to access this resource.
    • Type: String
    perms (click for additional details)
    hostName
    • Description: The DNS host name for this VM.

    • Type: String
    publicIpAddr
    • Description: Public IP address of the application VM or CCO. This attribute is the same as the publicIp or publicIpAddress attributes.
    • Type: String
    privateIpAddr
    • Description: Private IP address of the application VM or CCO. This attribute is the same as the privateIp attribute and the privateIpAddress attribute.
    • Type: String
    status
    • Description: Status of the operation. See Deployment and VM States for a list of all job operations.
    • Type: Enumeration

      EnumerationDescription
      SUBMITTEDThe operation has been submitted
      RUNNINGThe operation is currently in progress
      SUCCESSThe operation succeeded
      FAILThe operation failed
    startTime
    stopTime
    • Description: Stop time for this VM.
    • Type: Long
    isCliqrLaunched
    • Description: Identifies if the server was launched using CCM.
    • Type: Boolean
    userId
    • Description: Unique, system-generated identifier for a user
    • Type: String
    jobId
    • DescriptionUnique, system-generated identifier for the job
    • Type: String
    jobName
    • Description: The name of this job
    • Type: String
    userEmail
    • Description: Email address of the resource
    • Type: String
    vmOperationData
    • Description: Identifies information about VM operations
    • Type: Array of mapped attributes

      action
      • Description: Identifies the valid operations that can be performed on the VM. See Perform VM Operations for additional context.
      • Type: Array of Enumeration vmAction

        Enumeration Description
        STARTStart this VM
        STOPStop this VM
        REBOOTReboot this VM
        DELETEDelete this VM
      depEnvId
      • DescriptionUnique, system-generated identifier for the deployment environment. See Deployment Environments for additional details. This attribute is the same as the environmentId attribute.
      • Type: String
      depEnvName

      cloudRegion (click for additional context)

     

    vmActionsData

    action
    • Description: Identifies the valid operations that can be performed on the VM. See Perform VM Operations for additional context.
    • Type: Array of Enumeration vmAction

      Enumeration Description
      STARTStart this VM
      STOPStop this VM
      REBOOTReboot this VM
      DELETEDelete this VM

     

     

     

© 2017 Cisco Systems