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:
VapiInterface
The
Snapshots
class 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:
VapiStruct
The
Snapshots.CreateResult
class 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 (
str
orNone
) – 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:
VapiStruct
The
Snapshots.CreateSpec
class 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.RetentionPeriod
orNone
) – 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:
VapiStruct
The
Snapshots.FilterSpec
class 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.datetime
orNone
) – Minimum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.expires_before (
datetime.datetime
orNone
) – Maximum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.created_after (
datetime.datetime
orNone
) – Minimum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.created_before (
datetime.datetime
orNone
) – Maximum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.snapshots (
set
ofstr
orNone
) – 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 (
set
ofstr
orNone
) – 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:
VapiStruct
Information 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.datetime
orNone
) – 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 (
list
ofSnapshots.VmSnapshotSummary
) – List of virtual machine snapshots that were taken for this snapshot instance.
- class ListItem(snapshot=None, info=None)
Bases:
VapiStruct
The
Snapshots.ListItem
class 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:
VapiStruct
The
Snapshots.ListResult
class represents the result ofSnapshots.list()
method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
snapshots (
list
ofSnapshots.ListItem
) – List of items.
- class Type(string)
Bases:
Enum
The
Snapshots.Type
enumeration 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 theType
instance.
- 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:
VapiStruct
The
Snapshots.VmSnapshotSummary
class 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.datetime
orNone
) – 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.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 no 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.
- 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.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If no cluster associated withcluster
or no protection group associated withpg
or no snapshot associated withsnapshot
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.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.
- 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.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If no cluster associated withcluster
or no protection group associated withpg
or no snapshot associated withsnapshot
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.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, 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.FilterSpec
orNone
) – Specification of matching snapshots for which information should be returned. If None, the behavior is equivalent to aSnapshots.FilterSpec
with all attributes None which means all protection group snapshots match the filter.Snapshots.FilterSpec
for the specified protection group.
- Return type:
- Returns:
Information about the snapshots matching the
- 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 or no protection group associated with ``pg``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.
- class com.vmware.snapservice.clusters.protection_groups_client.StubFactory(stub_config)
Bases:
StubFactoryBase
Initialize 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:
VapiInterface
The
Snapshots
class 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:
VapiStruct
The
Snapshots.FilterSpec
class 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.datetime
orNone
) – Minimum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.expires_before (
datetime.datetime
orNone
) – Maximum expiration time for the snapshots that must match the filter. If None snapshots with any expiration time match the filter.created_after (
datetime.datetime
orNone
) – Minimum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.created_before (
datetime.datetime
orNone
) – Maximum creation date for the snapshots that must match the filter. If None snapshots with any creation time match the filter.snapshots (
set
ofstr
orNone
) – 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 (
set
ofstr
orNone
) – Names of the snapshots that must match the filter. If None snapshots with any name match the filter.snapshot_type (
Snapshots.Type
orNone
) – 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:
VapiStruct
Information 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.datetime
orNone
) – 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 (
str
orNone
) – 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 (
list
ofcom.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:
VapiStruct
The
Snapshots.ListItem
class 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:
VapiStruct
The
Snapshots.ListResult
class represents the result ofSnapshots.list()
method.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
items (
list
ofSnapshots.ListItem
) – List of items
- class Type(string)
Bases:
Enum
The
Snapshots.Type
enumeration 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 theType
instance.
- 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.Error
If there is unknown internal error.- Raise:
com.vmware.vapi.std.errors_client.NotFound
If no cluster associated withcluster
or no virtual machine associated withvm
or no snapshot associated withsnapshot
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.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, 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.FilterSpec
orNone
) – Specification of matching snapshots for which information should be returned. If None, the behavior is equivalent to aSnapshots.FilterSpec
with all attributes None which means all virtual machine snapshots match the filter.
- Return type:
- Returns:
Information about the snapshots matching the
Snapshots.FilterSpec
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 or no virtual machine associated with ``vm``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.
- class com.vmware.snapservice.clusters.virtual_machines_client.StubFactory(stub_config)
Bases:
StubFactoryBase
Initialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance