# Virtual Machines Controller Resource

The API allows you to list, view, edit and create virtual machines.

### GET /virtual-machines

Returns list of virtual machines filtered by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
authentication-domain | query |  |  | no
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
data-center | query |  |  | no
detailed | query |  | required boolean | no
direction | query |  |  | no
filter | query |  |  | no
guids | query |  |  | yes
hypervisor | query |  |  | no
hypervisor-cluster | query |  |  | no
hypervisor-manager | query |  |  | no
hypervisor-manager-type | query |  | "AWS" or "AZURE" or "FAKE_HVM" or "FUSIONCOMPUTE" or "GCP" or "HC3" or "HYPERV" or "KUBERNETES" or "NUTANIX" or "NUTANIX_V4" or "OPENNEBULA" or "OPENSHIFT" or "OPENSTACK" or "ORACLE" or "PLATFORM9" or "RHEV" or "RHV" or "VCENTER" or "VERGE" or "VIRTUOZZO" or "ZADARA" | yes
hypervisor-type | query |  | "CITRIX" or "ESXI" or "FAKE_HV" or "HYPERV" or "KUBERNETES" or "KVM" or "NUTANIX" or "OPENSHIFT" or "OVM" or "PROXMOX" or "VERGE" or "XEN" | yes
nameLike | query |  |  | no
nodeConfig | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
present | query |  | boolean | no
project-uuid | query |  |  | yes
provider-type | query |  |  | yes
size | query |  |  | no
snapshotPolicy | query |  |  | no
snapshotable | query |  | boolean | no
uuid | query |  |  | no
uuids | query |  |  | yes
virtual-provider | query |  |  | no
vmPolicy | query |  |  | yes
without-project | query |  | boolean | no

Response Body
media type | data type | description
--- | --- | ---
application/json | array of VirtualMachineListRecord (JSON) | list of virtual machines filtered by specified query parameters

#### Example

##### Request

    GET /virtual-machines
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    } ]

### DELETE /virtual-machines/all-non-present

Remove all virtual machines that are not present and without any backup.

Request Parameters
name | type | description
--- | --- | ---
project-uuid | query | specify project UUID to delete not present vms in project

#### Example

##### Request

    DELETE /virtual-machines/all-non-present
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### POST /virtual-machines/assign-backup-policy

Assign virtual machines to specified policy (or unassign if policy is null)

Request Body
media type | data type | description
--- | --- | ---
application/json | ProtectedEntityBackupPolicyAssignmentRequest (JSON) | containing policy and vms info

#### Example

##### Request

    POST /virtual-machines/assign-backup-policy
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 201 Created

### GET /virtual-machines/backup-cleanup

Returns list of protected entities for backup cleanup.

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
backup-destination | query |  |
page | query |  | int
size | query |  | int

Response Body
media type | data type | description
--- | --- | ---
application/json | array of VirtualMachineListRecord (JSON) | list of protected entities for backup cleanup

#### Example

##### Request

    GET /virtual-machines/backup-cleanup
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    } ]

### GET /virtual-machines/detailed

Returns detailed list of virtual machines filtered by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
authentication-domain | query |  |  | no
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
data-center | query |  |  | no
detailed | query |  | required boolean | no
direction | query |  |  | no
filter | query |  |  | no
guids | query |  |  | yes
hypervisor | query |  |  | no
hypervisor-cluster | query |  |  | no
hypervisor-manager | query |  |  | no
hypervisor-manager-type | query |  | "AWS" or "AZURE" or "FAKE_HVM" or "FUSIONCOMPUTE" or "GCP" or "HC3" or "HYPERV" or "KUBERNETES" or "NUTANIX" or "NUTANIX_V4" or "OPENNEBULA" or "OPENSHIFT" or "OPENSTACK" or "ORACLE" or "PLATFORM9" or "RHEV" or "RHV" or "VCENTER" or "VERGE" or "VIRTUOZZO" or "ZADARA" | yes
hypervisor-type | query |  | "CITRIX" or "ESXI" or "FAKE_HV" or "HYPERV" or "KUBERNETES" or "KVM" or "NUTANIX" or "OPENSHIFT" or "OVM" or "PROXMOX" or "VERGE" or "XEN" | yes
nameLike | query |  |  | no
nodeConfig | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
present | query |  | boolean | no
project-uuid | query |  |  | yes
provider-type | query |  |  | yes
size | query |  |  | no
snapshotPolicy | query |  |  | no
snapshotable | query |  | boolean | no
uuid | query |  |  | no
uuids | query |  |  | yes
virtual-provider | query |  |  | no
vmPolicy | query |  |  | yes
without-project | query |  | boolean | no

Response Body
media type | data type | description
--- | --- | ---
application/json | array of VirtualMachineDetails (JSON) | detailed list of virtual machines filtered by specified query parameters

#### Example

##### Request

    GET /virtual-machines/detailed
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    } ]

### POST /virtual-machines/details

Request Body
media type | data type
--- | ---
application/json | VirtualMachinePostQueryParameters (JSON)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of VirtualMachineListRecord (JSON) |

#### Example

##### Request

    POST /virtual-machines/details
    Content-Type: application/json
    Accept: application/json

    {
      "page" : "...",
      "hypervisor" : "...",
      "filterOrNameLike" : "...",
      "vmPolicy" : [ "...", "..." ],
      "hypervisor-type" : [ "KUBERNETES", "KUBERNETES" ],
      "uuid" : "...",
      "backupStatus" : [ "NO_SCHEDULE", "NO_SCHEDULE" ],
      "nodeConfig" : "...",
      "authentication-domain" : "...",
      "filter" : "...",
      "direction" : "...",
      "virtual-provider" : "...",
      "present" : true,
      "nameLike" : "...",
      "orderBy" : "...",
      "hypervisor-manager" : "...",
      "hypervisor-cluster" : "...",
      "data-center" : "...",
      "snapshotPolicy" : "...",
      "snapshotable" : true,
      "hypervisor-manager-type" : [ "FUSIONCOMPUTE", "OPENSHIFT" ],
      "uuids" : [ "...", "..." ],
      "virtualProviderTypes" : [ "...", "..." ],
      "size" : "...",
      "orderRequestCorrect" : true,
      "project-uuid" : [ "...", "..." ],
      "without-project" : true,
      "guids" : [ "...", "..." ],
      "detailed" : true
    }

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    } ]

### GET /virtual-machines/identifiers

Returns detailed list of virtual machines filtered by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
authentication-domain | query |  |  | no
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
data-center | query |  |  | no
detailed | query |  | required boolean | no
direction | query |  |  | no
filter | query |  |  | no
guids | query |  |  | yes
hypervisor | query |  |  | no
hypervisor-cluster | query |  |  | no
hypervisor-manager | query |  |  | no
hypervisor-manager-type | query |  | "AWS" or "AZURE" or "FAKE_HVM" or "FUSIONCOMPUTE" or "GCP" or "HC3" or "HYPERV" or "KUBERNETES" or "NUTANIX" or "NUTANIX_V4" or "OPENNEBULA" or "OPENSHIFT" or "OPENSTACK" or "ORACLE" or "PLATFORM9" or "RHEV" or "RHV" or "VCENTER" or "VERGE" or "VIRTUOZZO" or "ZADARA" | yes
hypervisor-type | query |  | "CITRIX" or "ESXI" or "FAKE_HV" or "HYPERV" or "KUBERNETES" or "KVM" or "NUTANIX" or "OPENSHIFT" or "OVM" or "PROXMOX" or "VERGE" or "XEN" | yes
nameLike | query |  |  | no
nodeConfig | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
present | query |  | boolean | no
project-uuid | query |  |  | yes
provider-type | query |  |  | yes
size | query |  |  | no
snapshotPolicy | query |  |  | no
snapshotable | query |  | boolean | no
uuid | query |  |  | no
uuids | query |  |  | yes
virtual-provider | query |  |  | no
vmPolicy | query |  |  | yes
without-project | query |  | boolean | no

Response Body
media type | data type | description
--- | --- | ---
application/json | array of VirtualMachineIdentifierListRecord (JSON) | detailed list of virtual machines filtered by specified query parameters

#### Example

##### Request

    GET /virtual-machines/identifiers
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ { } ]

### POST /virtual-machines/incremental-not-possible

Get all virtual machines that are not able to proceed incremental backup.

Request Body
media type | data type
--- | ---
application/json | VirtualMachineList (JSON)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of VirtualMachineAndIssuesDetails (JSON) |

#### Example

##### Request

    POST /virtual-machines/incremental-not-possible
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    [ { } ]

### GET /virtual-machines/policy-assignment-statuses

Request Parameters
name | type | description
--- | --- | ---
direction | query |
filter | query |
name | query |
nameLike | query |
orderBy | query |
page | query |
size | query |

Response Body
media type | data type | description
--- | --- | ---
application/json | array of ProtectedEntityPolicyAssignmentStatusRecord (JSON) |

#### Example

##### Request

    GET /virtual-machines/policy-assignment-statuses
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ { } ]

### GET /virtual-machines/rbac-contexts

Returns list of virtual machines filtered by specified query parameters.

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
app-cmd-exec-config | query |  |
cloud-service-provider | query |  |
cluster | query |  |
data-center | query |  |
direction | query |  |
filter | query |  |
hypervisor | query |  |
hypervisor-manager | query |  |
nameLike | query |  |
orderBy | query |  |
page | query |  |
project | query |  |
size | query |  |
storage-pool | query |  |
storage-provider | query |  |
teams-group | query |  | boolean

Response Body
media type | data type | description
--- | --- | ---
application/json | array of RbacContextListRecord (JSON) | list of virtual machines filtered by specified query parameters

#### Example

##### Request

    GET /virtual-machines/rbac-contexts
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ { } ]

### GET /virtual-machines/{guid}

Get a single virtual machine details.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for virtual machine (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | VirtualMachineDetails (JSON) | a single virtual machine details

#### Example

##### Request

    GET /virtual-machines/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    }

### PUT /virtual-machines/{guid}/settings

Change virtual machine settings.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for virtual machine (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | VirtualMachineSettingsUpdateRequest (JSON) | specify virtual machine details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | VirtualMachineDetails (JSON) | updated details of virtual machine

#### Example

##### Request

    PUT /virtual-machines/{guid}/settings
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    }

### GET /virtual-machines/{guid}/disks/any

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
guid | path |  |
uuid | query |  | required, not empty

Response Body
media type | data type | description
--- | --- | ---
application/json | NameAndGuid (JSON) |

#### Example

##### Request

    GET /virtual-machines/{guid}/disks/any
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "name" : "Entity name"
    }