Snapservice. Clusters. Virtual Machines Restore$ Task

Snapservice. Clusters. Virtual Machines Restore$ Task

Restore deleted virtual machine to a given snapshot point. The virtual machine will be left in a powered off state after the restore operation.

This operation was added in vSphere API 8.0.3.0.

Returns an authorization error if you do not have all of the privileges described as follows:

  • The resource ClusterComputeResource referenced by the parameter cluster requires Host.Config.Storage.
  • The resource Folder referenced by the property Snapservice.Clusters.VirtualMachines.RestorePlacementSpec.folder requires VirtualMachine.Inventory.Create.
  • The resource ResourcePool referenced by the property Snapservice.Clusters.VirtualMachines.RestorePlacementSpec.resource_pool requires Resource.AssignVMToPool.
Request
URI
POST
https://{host}/api/snapservice/clusters/{cluster}/virtual-machines/{vm}?action=restore&vmw-task=true
COPY
Path Parameters
string
cluster
Required

Identifier of the Cluster.

The parameter must be an identifier for the resource type: ClusterComputeResource.

string
vm
Required

Identifier of the virtual machine.

The parameter must be an identifier for the resource type: VirtualMachine.


Request Body

specification for the restore operation.

Snapservice.Clusters.VirtualMachines.RestoreSpec of type(s) application/json
Required
"Snapservice.Clusters.VirtualMachines.RestoreSpec Object"
Authentication
This operation uses the following authentication methods.
Responses
202

The task identifier for the operation.

The response will be an identifier for the resource type: VirtualMachine.

Returns string of type(s) application/json
Operation doesn't return any data structure

400

Vapi.Std.Errors.AlreadyExists If a virtual machine with the specified name already exists.

Vapi.Std.Errors.InvalidArgument If validation of the spec fails.

Vapi.Std.Errors.NotAllowedInCurrentState If there are more than max allowed restore operations in-progress.

Returns Vapi.Std.Errors.Error of type(s) application/json
"Vapi.Std.Errors.Error Object"

401

If the caller is not authenticated.

Returns Vapi.Std.Errors.Unauthenticated of type(s) application/json
"Vapi.Std.Errors.Unauthenticated Object"

403

If the caller is not authorized to perform the operation.

Returns Vapi.Std.Errors.Unauthorized of type(s) application/json
"Vapi.Std.Errors.Unauthorized Object"

404

If there is no cluster associated with cluster or no virtual machine associated with vm is found in the system.

Returns Vapi.Std.Errors.NotFound of type(s) application/json
"Vapi.Std.Errors.NotFound Object"

500

If there is unknown internal error.

Returns Vapi.Std.Errors.Error of type(s) application/json
"Vapi.Std.Errors.Error Object"

503

If the service is not available.

Returns Vapi.Std.Errors.ServiceUnavailable of type(s) application/json
"Vapi.Std.Errors.ServiceUnavailable Object"

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/api/snapservice/clusters/{cluster}/virtual-machines/{vm}?action=restore&vmw-task=true