com.vmware.snapservice.clusters package
Subpackages
Submodules
com.vmware.snapservice.clusters.protection_groups_client module
The com.vmware.snapservice.clusters.protection_groups_client module
provides classes for managing protection groups in a vSAN cluster.
- class com.vmware.snapservice.clusters.protection_groups_client.Snapshots(config)
Bases:
VapiInterfaceThe
Snapshotsclass provides methods to manage snapshots for a protection group.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
- class CreateResult(snapshot_type=None, total_vms=None, successful_vms=None, failed_vms=None, policy=None, snapshot=None)
Bases:
VapiStructThe
Snapshots.CreateResultclass contains information regarding the operation to create protection group snapshot.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot_type (
Snapshots.Type) – Type of the snapshot.total_vms (
long) – Total number of virtual machines considered for the snapshot operation.successful_vms (
long) – Number of virtual machines that were successfully snapshotted.failed_vms (
long) – Number of virtual machines the system failed to create snapshots for.policy (
strorNone) – Name of the snapshot policy this snapshot corresponds to. None if the snapshot was not a scheduled snapshot.snapshot (
str) – Identifier of the protection group snapshot. 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.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.protection_group.snapshot.
- class CreateSpec(name=None, retention=None)
Bases:
VapiStructThe
Snapshots.CreateSpecclass contains attributes that describe specification for creating a manual protection group snapshot.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
name (
str) – Name of the protection group snapshot.retention (
com.vmware.snapservice_client.RetentionPeriodorNone) – Retention period for the snapshot. Indicates the duration for which this snapshot must be retained in the system. if None the snapshot will be retained till the life of the cluster that the protection group belongs to or the life of the protection group itself.
- class FilterSpec(expires_after=None, expires_before=None, created_after=None, created_before=None, snapshots=None, names=None)
Bases:
VapiStructThe
Snapshots.FilterSpecclass contains attributes used to filter the results when listing snapshots for a protection group. SeeSnapshots.list(). When multiple filters are specified, it operates as an AND operation. The snapshots returned will match all the specified filters.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
expires_after (
datetime.datetimeorNone) – Minimum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.expires_before (
datetime.datetimeorNone) – Maximum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.created_after (
datetime.datetimeorNone) – Minimum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.created_before (
datetime.datetimeorNone) – Maximum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.snapshots (
setofstrorNone) – Identifiers of the snapshots that must 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.snapshot. 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.snapshot. If None snapshots with any identifier match the filter.names (
setofstrorNone) – Names of the snapshots that must match the filter. If None snapshots with any name match the filter.
- class Info(name=None, snapshot_type=None, start_time=None, end_time=None, expires_at=None, pg=None, vm_snapshots=None)
Bases:
VapiStructInformation regarding a protection group snapshot.
Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
name (
str) – Snapshot name. For a snapshot triggered by a periodic scchedule, name will be system generated.snapshot_type (
Snapshots.Type) – Snapshot type.start_time (
datetime.datetime) – Time at which the protection group snapshot operation started.end_time (
datetime.datetime) – Time at which the protection group snapshot operation completed.expires_at (
datetime.datetimeorNone) – Expiry time. None if there is no expiry for the snapshot.pg (
str) – Identifier of the protection group for which the snapshot was taken. 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.vm_snapshots (
listofSnapshots.VmSnapshotSummary) – List of virtual machine snapshots that were taken for this snapshot instance.
- class ListItem(snapshot=None, info=None)
Bases:
VapiStructThe
Snapshots.ListItemclass contains information about a protection group snapshot returned bySnapshots.list()methodTip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot (
str) – Identifier of the protection group snapshot. 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.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.protection_group.snapshot.info (
Snapshots.Info) – Information about the protection group snapshot.
- class ListResult(snapshots=None)
Bases:
VapiStructThe
Snapshots.ListResultclass represents the result ofSnapshots.list()method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshots (
listofSnapshots.ListItem) – List of items.
- class Type(string)
Bases:
EnumThe
Snapshots.Typeenumeration contains valid snapshot types.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 theTypeinstance.
- ONE_TIME = Type(string='ONE_TIME')
Indicates that the snapshot was taken as a one time operation triggered by the user.
- SCHEDULED = Type(string='SCHEDULED')
Indicates that a snapshot was taken as part of a periodic schedule.
- SYSTEM_CREATED = Type(string='SYSTEM_CREATED')
Indicates that the snapshot was taken by the system
- class VmSnapshotSummary(snapshot=None, name=None, created_at=None, expires_at=None, vm=None)
Bases:
VapiStructThe
Snapshots.VmSnapshotSummaryclass contains commonly used information about a virtual machine snapshot.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot (
str) – Identifier of the virtual machine snapshot. 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) – Snapshot name. For a snapshot triggered by a periodic scchedule, name will be system generated.created_at (
datetime.datetime) – Creation time.expires_at (
datetime.datetimeorNone) – Expiry time. None if there is no expiry for the snapshot.vm (
str) – Identifier of the virtual machine for which the snapshot was taken. 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.
- create_task(cluster, pg, spec)
Create a snapshot for the given 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.spec (
Snapshots.CreateSpec) – specification for the protection group snapshot.
- 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 withclusteror no 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.
- delete(cluster, pg, snapshot)
Delete the specified protection group snapshot.
- 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.snapshot (
str) – Identifier of the protection group snapshot. The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group.snapshot.
- 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 no protection group associated withpgor no snapshot associated withsnapshotis found in 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.
- get(cluster, pg, snapshot)
Get the detailed information regarding the specified protection group snapshot.
- 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.snapshot (
str) – Identifier of the protection group snapshot. The parameter must be an identifier for the resource type:com.vmware.snapservice.protection_group.snapshot.
- Return type:
- Returns:
Information about the specified protection group snapshot.
- 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 no protection group associated withpgor no snapshot associated withsnapshotis found in 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.
- list(cluster, pg, filter=None)
List the snapshots for the given 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.filter (
Snapshots.FilterSpecorNone) – Specification of matching snapshots for which information should be returned. If None, the behavior is equivalent to aSnapshots.FilterSpecwith all attributes None which means all protection group snapshots match the filter.Snapshots.FilterSpecfor the specified protection group.
- Return type:
- Returns:
Information about the snapshots matching the
- 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 or no protection group associated with ``pg``in 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.
- class com.vmware.snapservice.clusters.protection_groups_client.StubFactory(stub_config)
Bases:
StubFactoryBaseInitialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance
com.vmware.snapservice.clusters.virtual_machines_client module
The com.vmware.snapservice.clusters.virtual_machines_client module provides
classes for managing virtual machines in a vSAN cluster.
- class com.vmware.snapservice.clusters.virtual_machines_client.Snapshots(config)
Bases:
VapiInterfaceThe
Snapshotsclass provides methods to manage snapshots for a protection group.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
- class FilterSpec(expires_after=None, expires_before=None, created_after=None, created_before=None, snapshots=None, names=None, snapshot_type=None)
Bases:
VapiStructThe
Snapshots.FilterSpecclass contains attributes used to filter the results when listing snapshots for a protection group. SeeSnapshots.list(). When multiple filters are specified, it operates as an AND operation. The snapshots returned will match all the specified filters.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
expires_after (
datetime.datetimeorNone) – Minimum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.expires_before (
datetime.datetimeorNone) – Maximum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.created_after (
datetime.datetimeorNone) – Minimum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.created_before (
datetime.datetimeorNone) – Maximum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.snapshots (
setofstrorNone) – Identifiers of the snapshots that must 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.vm.snapshot. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.snapservice.vm.snapshot. If None snapshots with any identifier match the filter.names (
setofstrorNone) – Names of the snapshots that must match the filter. If None snapshots with any name match the filter.snapshot_type (
Snapshots.TypeorNone) – Snapshot type that must match the filter. If None snapshots with any type match the filter.
- class Info(name=None, snapshot_type=None, created_at=None, expires_at=None, vm=None, pg=None, disk_snapshots=None)
Bases:
VapiStructInformation regarding a virtual machine snapshot.
Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
name (
str) – Snapshot name. For a snapshot triggered by a periodic schedule, name will be system generated.snapshot_type (
Snapshots.Type) – Snapshot type.created_at (
datetime.datetime) – Creation time.expires_at (
datetime.datetimeorNone) – Expiry time. None if there is no expiry for the snapshot.vm (
str) –Identifier of the virtual machine for which the snapshot was taken.
TODO: Remove this once the VM snapshot List/Get is implemented, We do not need this since the query is already being performed on a specific VM. 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.pg (
strorNone) – Identifier of the protection group for which this snapshot was taken. 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. None if the snapshot was not taken as part of a protection group.disk_snapshots (
listofcom.vmware.snapservice.clusters.virtual_machines.disks_client.Snapshots.Info) – List of virtual machine disk snapshots that were taken for this snapshot instance.
- class ListItem(snapshot=None, info=None)
Bases:
VapiStructThe
Snapshots.ListItemclass contains information about a protection group returned bySnapshots.list()methodTip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshot (
str) – Identifier of the virtual machine snapshot. 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.info (
Snapshots.Info) – Information about the virtual machine snapshot.
- class ListResult(items=None)
Bases:
VapiStructThe
Snapshots.ListResultclass represents the result ofSnapshots.list()method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
items (
listofSnapshots.ListItem) – List of items
- class Type(string)
Bases:
EnumThe
Snapshots.Typeenumeration contains valid snapshot types.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 theTypeinstance.
- ONE_TIME = Type(string='ONE_TIME')
Indicates that the snapshot was taken as a one time operation triggered by the user.
- SCHEDULED = Type(string='SCHEDULED')
Indicates that a snapshot was taken as part of a periodic schedule.
- SYSTEM_CREATED = Type(string='SYSTEM_CREATED')
Indicates that the snapshot was taken by the system
- get(cluster, vm, snapshot)
Get the detailed information regarding the specified virtual machine snapshot.
- 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.snapshot (
str) – Identifier of the virtual machine snapshot. The parameter must be an identifier for the resource type:com.vmware.snapservice.vm.snapshot.
- Return type:
- Returns:
Information about the virtual mahcine snapshot.
- 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 no virtual machine associated withvmor no snapshot associated withsnapshotis found in 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.
- list(cluster, vm, filter=None)
List the snapshots for the given virtual machine.
- 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.filter (
Snapshots.FilterSpecorNone) – Specification of matching snapshots for which information should be returned. If None, the behavior is equivalent to aSnapshots.FilterSpecwith all attributes None which means all virtual machine snapshots match the filter.
- Return type:
- Returns:
Information about the snapshots matching the
Snapshots.FilterSpecfor 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 or no virtual machine associated with ``vm``in 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.
- class com.vmware.snapservice.clusters.virtual_machines_client.StubFactory(stub_config)
Bases:
StubFactoryBaseInitialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance