com.vmware.snapservice package
Subpackages
- com.vmware.snapservice.clusters package
- Subpackages
- Submodules
- com.vmware.snapservice.clusters.protection_groups_client module
- com.vmware.snapservice.clusters.virtual_machines_client module
Submodules
com.vmware.snapservice.clusters_client module
The com.vmware.snapservice.clusters_client
module provides classes for
managing protection groups and snapshots in a vSAN cluster.
- class com.vmware.snapservice.clusters_client.ProtectionGroups(config)
Bases:
VapiInterface
The
ProtectionGroups
class provides methods for managing protection groups created for a cluster.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
- class DeleteSpec(force=None)
Bases:
VapiStruct
The
ProtectionGroups.DeleteSpec
class contains attributes used to specify the parameters for deleting a protection group SeeProtectionGroups.delete()
.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
force (
bool
orNone
) – Indicates if force delete to be performed. If set to True protection group and all associated snapshots will be deleted immediately If None, All the snapshots associated with the protection group will be retained till expiry.
- class FilterSpec(pgs=None, names=None, states=None, vms=None)
Bases:
VapiStruct
The
ProtectionGroups.FilterSpec
class contains attributes used to filter the results when listing protection groups for a cluster If multiple attributes are specified, only protection groups matching all of the attributes match the filter. SeeProtectionGroups.list()
.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
pgs (
set
ofstr
orNone
) – Identifiers of protection groups that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.snapservice.protection_group
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.snapservice.protection_group
. If None or empty, protection groups with any identifier match the filter.names (
set
ofstr
orNone
) – Names of protection groups that can match the filter. If None or empty, protection groups with any name match the filter.states (
set
ofcom.vmware.snapservice_client.ProtectionGroupStatus
orNone
) – States of protection groups that can match the filter. If None or empty, protection groups with any state match the filter.vms (
set
ofstr
orNone
) – Identifiers of the virtual machines which belong to the protection groups that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.snapservice.protection_group
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.snapservice.protection_group
. If None or empty, protection groups with any virtual machines match the filter.
- class ListItem(pg=None, info=None)
Bases:
VapiStruct
The
ProtectionGroups.ListItem
class contains information about a protection group returned byProtectionGroups.list()
methodTip
The arguments are used to initialize data attributes with the same names.
- Parameters:
pg (
str
) – Identifier of the protection group. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.protection_group
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.protection_group
.info (
com.vmware.snapservice_client.ProtectionGroupInfo
) – Information regarding the protection group.
- class ListResult(items=None)
Bases:
VapiStruct
The
ProtectionGroups.ListResult
class represents the result ofProtectionGroups.list()
method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
items (
list
ofProtectionGroups.ListItem
) – List of items
- create_task(cluster, spec)
Create a protection group for the given cluster.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.spec (
com.vmware.snapservice_client.ProtectionGroupSpec
) – specification for the protection group.
- Return type:
- class:
vmware.vapi.stdlib.client.task.Task
- Returns:
Task instance
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thespec
fails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- delete_task(cluster, pg, spec=None)
Delete the specified protection group. Default bahaviour:
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.pg (
str
) – Identifier of the protection group. The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group
.spec (
ProtectionGroups.DeleteSpec
orNone
) – Specifies the additional parameters for the delete operation. If None, protection group status is set to marked as deleted and will be be deleted permanently once all its associated snapshots are deleted.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If no cluster associated withcluster
or protection group associated withpg
is found in the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thespec
fails.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.Unsupported
If the specified protection group is locked.
- get(cluster, pg)
Get the detailed information regarding the specified protection group.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.pg (
str
) – Identifier of the protection group. The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group
.
- Return type:
- Returns:
Information about the specified protection group.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If no cluster associated withcluster
or protection group associated withpg
is found in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If any input is invalid.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- list(cluster, filter=None)
List the protection groups for the given cluster.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.filter (
ProtectionGroups.FilterSpec
orNone
) – Specification of matching protection groups for which information should be returned. If None, the behavior is equivalent to aProtectionGroups.FilterSpec
with all attributes None which means all protection groups match the filter.
- Return type:
- Returns:
Information about the protection groups matching the
ProtectionGroups.FilterSpec
for the given cluster.- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thefilter
fails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- pause_task(cluster, pg)
Pause the specified proteciton group. This action pauses all periodic snapshot operations and deletion of expired snapshots. Any ongoing snapshot creation or deletion operations will not be paused.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.pg (
str
) – Identifier of the protection group The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group
.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.AlreadyInDesiredState
If the protection group is already paused.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or protection group associated withpg
in the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.Unsupported
If the specified protection group is locked.
- resume_task(cluster, pg)
Resume the specified proteciton group. This action resumes all periodic snapshot operations and deletion of expired snapshots.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.pg (
str
) – Identifier of the protection group The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group
.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.AlreadyInDesiredState
If the protection group is already active.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or protection group associated withpg
in the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.Unsupported
If the specified protection group is locked.
- update_task(cluster, pg, spec)
Update a protection group for the given cluster.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.pg (
str
) – Identifier of the protection group The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group
.spec (
com.vmware.snapservice_client.ProtectionGroupUpdateSpec
) – specification for updting the protection group.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or protection group associated withpg
in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thespec
fails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.Unsupported
If the specified protection group is locked.
- class com.vmware.snapservice.clusters_client.StubFactory(stub_config)
Bases:
StubFactoryBase
Initialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
- class com.vmware.snapservice.clusters_client.VirtualMachines(config)
Bases:
VapiInterface
The
VirtualMachines
class provides methods to manage virtual machines.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
- class FilterSpec(vms=None, name_patterns=None, local_protection_enabled=None)
Bases:
VapiStruct
The
VirtualMachines.FilterSpec
class contains attributes used to filter the results when listing virtual machines for a cluster If multiple attributes are specified, only virtual machines matching all of the attributes match the filter. SeeVirtualMachines.list()
.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
vms (
set
ofstr
orNone
) – Identifiers of virtual machines that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:VirtualMachine
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:VirtualMachine
. If None or empty, virtual machines with any identifier match the filter.name_patterns (
list
ofstr
orNone
) – One or more match patterns for virtual machine name that can match the filter. Uses standard POSIX Shell globbing pattern. If None or empty virtual machines with any name match the filter.local_protection_enabled (
bool
orNone
) – Status of the local protection that must match the filter. If None or empty, virtual machines with any local protection status can match the filter.
- class Info(name=None, local_protection_enabled=None, protection_groups=None, last_snapshot_time=None, oldest_snapshot_time=None, snapshot_count=None, in_cluster=None)
Bases:
VapiStruct
The
VirtualMachines.Info
class contains attributes that provide information regarding a virtual machine.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
name (
str
) – Name of the virtual machine.local_protection_enabled (
bool
) – Whether or not local protection is enabled. Local protection is considered to be enabled when the virtual machine belongs to at least one active protection group.protection_groups (
set
ofstr
) – List of protection groups that this virtual machine belongs to. Empty list when the virtual machine is not part of any protection group. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.snapservice.protection_group
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.snapservice.protection_group
.last_snapshot_time (
datetime.datetime
orNone
) – Time of the last snapshot for the virtual machine. None if there are no snapshots taken for the virtual machine.oldest_snapshot_time (
datetime.datetime
orNone
) – Time of the oldest snapshot for the virtual machine. None if there are no snapshots taken for the virtual machine.snapshot_count (
long
) – Number of snapshots available for the virtual machine.in_cluster (
bool
) – Indicates whether or not the virtual mahcine is currently part of the cluster. This can be set to false when there is atleast one snapshot for the virtual machine on the target cluster, but the virtual machine is not part of the cluster.
- class LinkedClonePlacementSpec(folder=None, resource_pool=None, host=None)
Bases:
VapiStruct
The
VirtualMachines.LinkedClonePlacementSpec
class contains attributes used to place cloned virtual machine on to resources within the vcenter inventory.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
folder (
str
orNone
) – Virtual machine folder into which the cloned virtual machine should be placed. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. If attribute is None, the system will use the default virtual machine folder of the datacenter. If this results in a conflict due to other placement parameters, the virtual machine clone operation will fail.resource_pool (
str
orNone
) – Resource pool into which the cloned virtual machine should be placed. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool
. If attribute is None, the system will use the other placement parameters to create virtual machine. If this results in a conflict due to other placement parameters, the virtual machine clone operation will fail.host (
str
orNone
) –Host onto which the cloned virtual machine should be placed.
If
host
andresourcePool
are both specified,resourcePool
must belong tohost
.If
host
is specified,host
must be a member of cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem
. If this attribute is unset, ifresourcePool
is set, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePool
is unset, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePool
is set, and the target is a cluster without DRS, InvalidArgument will be thrown.
- class LinkedCloneSpec(snapshot=None, name=None, placement=None)
Bases:
VapiStruct
The
VirtualMachines.LinkedCloneSpec
class contains attributes to create linked clone virtual machine from the given snapshot.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot (
str
) – Identifier of the virtual machine snapshot using which the virtual machine shall be cloned.snapshot
must be a snapshot of a virtual machine on the same cluster where virtual machine being cloned. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.vm.snapshot
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.vm.snapshot
.name (
str
) – Name of the cloned virtual machine.placement (
VirtualMachines.LinkedClonePlacementSpec
orNone
) –Virtual machine placement information.
Each field in the spec will be used for placement. If the fields result in disjoint placement the operation will fail. If None, and the cluster is DRS enabled the system will create the virtual machine under the default vitual machine folder. If the DRS is not enabled on the cluster the operation will fail.
- class ListItem(vm=None, info=None)
Bases:
VapiStruct
The
VirtualMachines.ListItem
class contains information about a virtual machine returned byVirtualMachines.list()
methodTip
The arguments are used to initialize data attributes with the same names.
- Parameters:
vm (
str
) – Identifier of the virtual machine. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:VirtualMachine
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:VirtualMachine
.info (
VirtualMachines.Info
) – Information regarding the virtual machine.
- class ListResult(items=None)
Bases:
VapiStruct
The
VirtualMachines.ListResult
class represents the result ofVirtualMachines.list()
method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
items (
list
ofVirtualMachines.ListItem
) – List of items
- class RestorePlacementSpec(folder=None, resource_pool=None, host=None)
Bases:
VapiStruct
The
VirtualMachines.RestorePlacementSpec
class contains attributes used to place restored virtual machine on to resources within the vcenter inventory.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
folder (
str
orNone
) – Virtual machine folder into which the restored virtual machine should be placed. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. If attribute is None, the system will use the default virtual machine folder of the datacenter. If this results in a conflict due to other placement parameters, the virtual machine restore operation will fail.resource_pool (
str
orNone
) – Resource pool into which the restored virtual machine should be placed. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool
. If attribute is None, the system will use the other placement parameters to create virtual machine. If this results in a conflict due to other placement parameters, the virtual machine restore operation will fail.host (
str
orNone
) –Host onto which the restored virtual machine should be placed.
If
host
andresourcePool
are both specified,resourcePool
must belong tohost
.If
host
is specified,host
must be a member of cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem
. If this attribute is unset, ifresourcePool
is set, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePool
is unset, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePool
is set, and the target is a cluster without DRS, InvalidArgument will be thrown.
- class RestoreSpec(snapshot=None, name=None, placement=None)
Bases:
VapiStruct
The
VirtualMachines.RestoreSpec
class contains attributes to restore deleted virtual machine to a given snapshot point.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot (
str
) – Identifier of the virtual machine snapshot using which the virtual machine shall be restored.snapshot
must be a snapshot of a virtual machine on the same cluster where virtual machine being restored. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.vm.snapshot
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.vm.snapshot
.name (
str
orNone
) – New name for the virtual machine being restored. If None, will use the name of the virtual machine when the snapshot was taken.placement (
VirtualMachines.RestorePlacementSpec
orNone
) –Virtual machine placement information.
Each field in the spec will be used for placement. If the fields result in disjoint placement the operation will fail. If None, and the cluster is DRS enabled the system will create the virtual machine under the default vitual machine folder. If the DRS is not enabled on the cluster the operation will fail.
- class RevertSpec(snapshot=None)
Bases:
VapiStruct
The
VirtualMachines.RevertSpec
class contains attributes to revert the virtual machine to a given snapshot point.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot (
str
) – Identifier of the virtual machine snapshot to which the virtual machine shall be reverted. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.vm.snapshot
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.vm.snapshot
.
- get(cluster, vm)
Get the detailed information regarding the specified virtual machine and it’s snapshots in the given cluster.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.vm (
str
) – Identifier of the virtual machine. The parameter must be an identifier for the resource type:VirtualMachine
.
- Return type:
- Returns:
Info detailed information for the specified virtual machine.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or no virtual machine associated withvm
in the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- linked_clone_task(cluster, vm, spec)
Creates a linked clone virtual machine from the given snapshot. The virtual machine will be left in a powered off state after the clone operation.
- Parameters:
cluster (
str
) – Identifier of the Cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.vm (
str
) – Identifier of the virtual machine. The parameter must be an identifier for the resource type:VirtualMachine
.spec (
VirtualMachines.LinkedCloneSpec
) – specification for the clone operation.
- Return type:
- class:
vmware.vapi.stdlib.client.task.Task
- Returns:
Task instance
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or no virtual machine associated withvm
is found in the system.- Raise:
com.vmware.vapi.std.errors_client.AlreadyExists
If a virtual machine with the specified name already exists.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thespec
fails.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there are more than max allowed clone operations in-progress.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- list(cluster, filter=None)
List the virtual machines for the given cluster.
- Parameters:
cluster (
str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.filter (
VirtualMachines.FilterSpec
orNone
) – Specification of matching virtual machines for which information should be returned. If None, the behavior is equivalent to aVirtualMachines.FilterSpec
with all attributes None which means all virtual machines match the filter.
- Return type:
- Returns:
Information about the virtual machines matching the
VirtualMachines.FilterSpec
for the given cluster.- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thefilter
fails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- restore_task(cluster, vm, spec)
Restore deleted virtual machine to a given snapshot point. The virtual machine will be left in a powered off state after the restore operation.
- Parameters:
cluster (
str
) – Identifier of the Cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.vm (
str
) – Identifier of the virtual machine. The parameter must be an identifier for the resource type:VirtualMachine
.spec (
VirtualMachines.RestoreSpec
) – specification for the restore operation.
- Return type:
- class:
vmware.vapi.stdlib.client.task.Task
- Returns:
Task instance
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or no virtual machine associated withvm
is found in the system.- Raise:
com.vmware.vapi.std.errors_client.AlreadyExists
If a virtual machine with the specified name already exists.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thespec
fails.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If there are more than max allowed restore operations in-progress.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
- revert_task(cluster, vm, spec)
Revert the virtual machine to a given snapshot point. The system takes an additional snapshot to preserve the state prior to performing a revert. The system snapshot does not preserve the in-memory state of the virtual machine. The virtual machine will be left in a powered off state after the revert operation.
- Parameters:
cluster (
str
) – Identifier of the Cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.vm (
str
) – Identifier of the virtual machine. The parameter must be an identifier for the resource type:VirtualMachine
.spec (
VirtualMachines.RevertSpec
) – specification for the revert operation.
- Raise:
com.vmware.vapi.std.errors_client.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If there is no cluster associated withcluster
or no virtual machine associated withvm
is found in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
If validation of thespec
fails.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
If the virtual machine has moved to another cluster or if there are more than max allowed revert operations in-progress.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailable
If the service is not available.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
If the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
If the caller is not authorized to perform the operation.
com.vmware.snapservice.info_client module
The com.vmware.snapservice.info_client
module provides classes to fetch
general information regarding Snapshot Service.
- class com.vmware.snapservice.info_client.About(config)
Bases:
VapiInterface
The
About
class provides methods that fetch details about Snapshot service.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
- class Info(version=None)
Bases:
VapiStruct
The
About.Info
class contains information about the snapshot service.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
version (
str
) – Snapshot service version
- get()
Get information about Snapshot service.
- Return type:
- Returns:
Information about the snapshot service.
- class com.vmware.snapservice.info_client.StubFactory(stub_config)
Bases:
StubFactoryBase
Initialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
com.vmware.snapservice.tasks_client module
The com.vmware.snapservice.tasks_client
module provides classes to fetch
general information regarding vSAN snapshot service tasks.
- class com.vmware.snapservice.tasks_client.CommonInfo(description=None, service=None, operation=None, parent=None, target=None, status=None, cancelable=None, error=None, start_time=None, end_time=None, user=None)
Bases:
VapiStruct
The
CommonInfo
class contains information common to all tasks.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
description (
com.vmware.vapi.std_client.LocalizableMessage
) – Description of the operation associated with the task.service (
str
) – Identifier of the service containing the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.service
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.service
.operation (
str
) – Identifier of the operation associated with the task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.operation
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.operation
.parent (
str
orNone
) – Parent of the current task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.task
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.task
. This attribute will be None if the task has no parent.target (
com.vmware.vapi.std_client.DynamicID
orNone
) – Identifier of the target created by the operation or an existing one the operation performed on. This attribute will be None if the operation has no target or multiple targets.status (
Status
) – Status of the operation associated with the task.cancelable (
bool
) – Flag to indicate whether or not the operation can be cancelled. The value may change as the operation progresses.error (
Exception
orNone
) – Description of the error if the operation status is “FAILED”. If None the description of why the operation failed will be included in the result of the operation (seeInfo.result
).start_time (
datetime.datetime
) – Time when the operation is started. This attribute is optional and it is only relevant when the value ofstatus
is one ofStatus.RUNNING
,Status.BLOCKED
,Status.SUCCEEDED
, orStatus.FAILED
.end_time (
datetime.datetime
) – Time when the operation is completed. This attribute is optional and it is only relevant when the value ofstatus
is one ofStatus.SUCCEEDED
orStatus.FAILED
.user (
str
orNone
) – Name of the user who performed the operation. This attribute will be None if the operation is performed by the system.
- class com.vmware.snapservice.tasks_client.Info(progress=None, result=None, vc_task=None, description=None, service=None, operation=None, parent=None, target=None, status=None, cancelable=None, error=None, start_time=None, end_time=None, user=None)
Bases:
VapiStruct
The
Info
class contains information about a task.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
progress (
Progress
) – Progress of the operation. This attribute is optional and it is only relevant when the value ofstatus
is one ofStatus.RUNNING
,Status.BLOCKED
,Status.SUCCEEDED
, orStatus.FAILED
.result (
DataValue
orNone
) – Result of the operation. This attribute will be None if the operation does not return a result or if the result is not available at the current step of the operation.vc_task (
str
orNone
) – Associated vCenter task for the given task. This attribute will be None if there is no corresponding VC task created.description (
com.vmware.vapi.std_client.LocalizableMessage
) – Description of the operation associated with the task.service (
str
) – Identifier of the service containing the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.service
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.service
.operation (
str
) – Identifier of the operation associated with the task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.operation
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.operation
.parent (
str
orNone
) – Parent of the current task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.snapservice.task
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.snapservice.task
. This attribute will be None if the task has no parent.target (
com.vmware.vapi.std_client.DynamicID
orNone
) – Identifier of the target created by the operation or an existing one the operation performed on. This attribute will be None if the operation has no target or multiple targets.status (
Status
) – Status of the operation associated with the task.cancelable (
bool
) – Flag to indicate whether or not the operation can be cancelled. The value may change as the operation progresses.error (
Exception
orNone
) – Description of the error if the operation status is “FAILED”. If None the description of why the operation failed will be included in the result of the operation (seeInfo.result
).start_time (
datetime.datetime
) – Time when the operation is started. This attribute is optional and it is only relevant when the value ofstatus
is one ofStatus.RUNNING
,Status.BLOCKED
,Status.SUCCEEDED
, orStatus.FAILED
.end_time (
datetime.datetime
) – Time when the operation is completed. This attribute is optional and it is only relevant when the value ofstatus
is one ofStatus.SUCCEEDED
orStatus.FAILED
.user (
str
orNone
) – Name of the user who performed the operation. This attribute will be None if the operation is performed by the system.
- class com.vmware.snapservice.tasks_client.Progress(total=None, completed=None, message=None)
Bases:
VapiStruct
The
Progress
class contains information describe the progress of an operation.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
total (
long
) – Total amount of the work for the operation.completed (
long
) – The amount of work completed for the operation. The value can only be incremented.message (
com.vmware.vapi.std_client.LocalizableMessage
) – Message about the work progress.
- class com.vmware.snapservice.tasks_client.Status(string)
Bases:
Enum
The
Status
class defines the status values that can be reported for an operation.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
- Parameters:
string (
str
) – String value for theStatus
instance.
- BLOCKED = Status(string='BLOCKED')
The operation is blocked.
The operation could be blocked if the system is waiting for resources to be available to perform the operation.
- FAILED = Status(string='FAILED')
The operation failed.
- PENDING = Status(string='PENDING')
The operation is in pending state.
- RUNNING = Status(string='RUNNING')
The operation is in progress.
- SUCCEEDED = Status(string='SUCCEEDED')
The operation completed successfully.
- class com.vmware.snapservice.tasks_client.StubFactory(stub_config)
Bases:
StubFactoryBase
Initialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance