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:
VapiInterfaceThe
ProtectionGroupsclass 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:
VapiStructThe
ProtectionGroups.DeleteSpecclass 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 (
boolorNone) – 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:
VapiStructThe
ProtectionGroups.FilterSpecclass 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 (
setofstrorNone) – 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 (
setofstrorNone) – Names of protection groups that can match the filter. If None or empty, protection groups with any name match the filter.states (
setofcom.vmware.snapservice_client.ProtectionGroupStatusorNone) – States of protection groups that can match the filter. If None or empty, protection groups with any state match the filter.vms (
setofstrorNone) – 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:
VapiStructThe
ProtectionGroups.ListItemclass 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:
VapiStructThe
ProtectionGroups.ListResultclass represents the result ofProtectionGroups.list()method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
items (
listofProtectionGroups.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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusterin the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thespecfails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.DeleteSpecorNone) – 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf no cluster associated withclusteror protection group associated withpgis found in the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thespecfails.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.UnsupportedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf no cluster associated withclusteror protection group associated withpgis found in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf any input is invalid.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.FilterSpecorNone) – Specification of matching protection groups for which information should be returned. If None, the behavior is equivalent to aProtectionGroups.FilterSpecwith all attributes None which means all protection groups match the filter.
- Return type:
- Returns:
Information about the protection groups matching the
ProtectionGroups.FilterSpecfor the given cluster.- Raise:
com.vmware.vapi.std.errors_client.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusterin the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thefilterfails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.AlreadyInDesiredStateIf the protection group is already paused.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror protection group associated withpgin the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.UnsupportedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.AlreadyInDesiredStateIf the protection group is already active.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror protection group associated withpgin the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.UnsupportedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there is another operation in progress.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror protection group associated withpgin the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thespecfails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf the caller is not authorized to perform the operation.- Raise:
com.vmware.vapi.std.errors_client.UnsupportedIf the specified protection group is locked.
- class com.vmware.snapservice.clusters_client.StubFactory(stub_config)
Bases:
StubFactoryBaseInitialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance
- class com.vmware.snapservice.clusters_client.VirtualMachines(config)
Bases:
VapiInterfaceThe
VirtualMachinesclass 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:
VapiStructThe
VirtualMachines.FilterSpecclass 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 (
setofstrorNone) – 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 (
listofstrorNone) – 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 (
boolorNone) – 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:
VapiStructThe
VirtualMachines.Infoclass 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 (
setofstr) – 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.datetimeorNone) – Time of the last snapshot for the virtual machine. None if there are no snapshots taken for the virtual machine.oldest_snapshot_time (
datetime.datetimeorNone) – 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:
VapiStructThe
VirtualMachines.LinkedClonePlacementSpecclass 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 (
strorNone) – 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 (
strorNone) – 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 (
strorNone) –Host onto which the cloned virtual machine should be placed.
If
hostandresourcePoolare both specified,resourcePoolmust belong tohost.If
hostis specified,hostmust 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, ifresourcePoolis set, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePoolis unset, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePoolis set, and the target is a cluster without DRS, InvalidArgument will be thrown.
- class LinkedCloneSpec(snapshot=None, name=None, placement=None)
Bases:
VapiStructThe
VirtualMachines.LinkedCloneSpecclass 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.snapshotmust 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.LinkedClonePlacementSpecorNone) –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:
VapiStructThe
VirtualMachines.ListItemclass 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:
VapiStructThe
VirtualMachines.ListResultclass represents the result ofVirtualMachines.list()method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
items (
listofVirtualMachines.ListItem) – List of items
- class RestorePlacementSpec(folder=None, resource_pool=None, host=None)
Bases:
VapiStructThe
VirtualMachines.RestorePlacementSpecclass 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 (
strorNone) – 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 (
strorNone) – 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 (
strorNone) –Host onto which the restored virtual machine should be placed.
If
hostandresourcePoolare both specified,resourcePoolmust belong tohost.If
hostis specified,hostmust 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, ifresourcePoolis set, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePoolis unset, and the target is a DRS cluster, a host will be picked by DRS. ifresourcePoolis set, and the target is a cluster without DRS, InvalidArgument will be thrown.
- class RestoreSpec(snapshot=None, name=None, placement=None)
Bases:
VapiStructThe
VirtualMachines.RestoreSpecclass 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.snapshotmust 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 (
strorNone) – 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.RestorePlacementSpecorNone) –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:
VapiStructThe
VirtualMachines.RevertSpecclass 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror no virtual machine associated withvmin the system.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror no virtual machine associated withvmis found in the system.- Raise:
com.vmware.vapi.std.errors_client.AlreadyExistsIf a virtual machine with the specified name already exists.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thespecfails.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there are more than max allowed clone operations in-progress.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.FilterSpecorNone) – Specification of matching virtual machines for which information should be returned. If None, the behavior is equivalent to aVirtualMachines.FilterSpecwith all attributes None which means all virtual machines match the filter.
- Return type:
- Returns:
Information about the virtual machines matching the
VirtualMachines.FilterSpecfor the given cluster.- Raise:
com.vmware.vapi.std.errors_client.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusterin the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thefilterfails.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror no virtual machine associated withvmis found in the system.- Raise:
com.vmware.vapi.std.errors_client.AlreadyExistsIf a virtual machine with the specified name already exists.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thespecfails.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf there are more than max allowed restore operations in-progress.- Raise:
com.vmware.vapi.std.errors_client.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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.ErrorIf there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFoundIf there is no cluster associated withclusteror no virtual machine associated withvmis found in the system.- Raise:
com.vmware.vapi.std.errors_client.InvalidArgumentIf validation of thespecfails.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf 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.ServiceUnavailableIf the service is not available.- Raise:
com.vmware.vapi.std.errors_client.UnauthenticatedIf the caller is not authenticated.- Raise:
com.vmware.vapi.std.errors_client.UnauthorizedIf 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:
VapiInterfaceThe
Aboutclass 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:
VapiStructThe
About.Infoclass 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:
StubFactoryBaseInitialize 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:
VapiStructThe
CommonInfoclass 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 (
strorNone) – 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.DynamicIDorNone) – 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 (
ExceptionorNone) – 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 ofstatusis 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 ofstatusis one ofStatus.SUCCEEDEDorStatus.FAILED.user (
strorNone) – 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:
VapiStructThe
Infoclass 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 ofstatusis one ofStatus.RUNNING,Status.BLOCKED,Status.SUCCEEDED, orStatus.FAILED.result (
DataValueorNone) – 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 (
strorNone) – 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 (
strorNone) – 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.DynamicIDorNone) – 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 (
ExceptionorNone) – 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 ofstatusis 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 ofstatusis one ofStatus.SUCCEEDEDorStatus.FAILED.user (
strorNone) – 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:
VapiStructThe
Progressclass 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:
EnumThe
Statusclass 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 theStatusinstance.
- 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:
StubFactoryBaseInitialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance