com.vmware.vcenter.vm.storage package¶
Submodules¶
com.vmware.vcenter.vm.storage.policy_client module¶
-
class
com.vmware.vcenter.vm.storage.policy_client.Compliance(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe Compliance class provides methods that return the compliance status of virtual machine entities(virtual machine home directory and virtual disks) that specify storage policy requirements. This class was added in vSphere API 6.7.
- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
-
class
CheckSpec(vm_home=None, disks=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Compliance.CheckSpecclass contains attributes used to specify the entities on which the storage policy compliance check is to be invoked. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
vm_home (
bool) – Invoke compliance check on the virtual machine home directory if set to true. This attribute was added in vSphere API 6.7.disks (
setofstrorNone) – Identifiers of the virtual machine’s virtual disks for which compliance should be checked. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.vcenter.vm.hardware.Disk. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.vcenter.vm.hardware.Disk. If None or empty, compliance check is invoked on all the associated disks.
-
class
Info(overall_compliance=None, vm_home=None, disks=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Compliance.Infoclass contains information about the storage policy compliance of a virtual machine, including information about it’s home directory and/or it’s virtual disks. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
overall_compliance (
Compliance.Status) – The overall compliance status of the virtual machine and all it’s entities. This attribute was added in vSphere API 6.7.vm_home (
Compliance.VmComplianceInfoorNone) – The storage policy compliance informationCompliance.VmComplianceInfofor the virtual machine’s home directory. This attribute was added in vSphere API 6.7. If None the virtual machine home directory has no storage policy association.disks (
dictofstrandCompliance.VmComplianceInfo) – The compliance informationCompliance.VmComplianceInfofor the virtual machine’s virtual disks that are currently associated with a storage policy. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the key in the attributedictmust be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Disk. When methods return a value of this class as a return value, the key in the attributedictwill be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Disk.
-
class
Status(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
Compliance.Statusclass defines the storage compliance status of a virtual machine and its applicable entities. This enumeration was added in vSphere API 6.7.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.
-
COMPLIANT= Status(string='COMPLIANT')¶ Entity is in compliance. This class attribute was added in vSphere API 6.7.
-
NON_COMPLIANT= Status(string='NON_COMPLIANT')¶ Entity is out of compliance. This class attribute was added in vSphere API 6.7.
-
NOT_APPLICABLE= Status(string='NOT_APPLICABLE')¶ Compliance computation is not applicable for this entity because it does not have any storage requirements that apply to the datastore on which it is placed. This class attribute was added in vSphere API 6.7.
-
OUT_OF_DATE= Status(string='OUT_OF_DATE')¶ The Compliance status becomes out-of-date when the profile associated with the entity is edited but not applied. The compliance status remains out-of-date until the edited policy is applied to the entity. This class attribute was added in vSphere API 6.7.
-
UNKNOWN_COMPLIANCE= Status(string='UNKNOWN_COMPLIANCE')¶ Compliance status of the entity is not known. This class attribute was added in vSphere API 6.7.
-
class
VmComplianceInfo(status=None, check_time=None, policy=None, failure_cause=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Compliance.VmComplianceInfoclass contains information about storage policy compliance associated with a virtual machine. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
status (
Compliance.Status) – Status of the compliance operation. This attribute was added in vSphere API 6.7.check_time (
datetime.datetime) – Date and time of the most recent compliance check. This attribute was added in vSphere API 6.7.policy (
strorNone) – Identifier of the storage policy associated with the virtual machine. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vcenter.StoragePolicy. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vcenter.StoragePolicy. If None SPBM is unable to retrieve or determine the associated policy,Compliance.VmComplianceInfo.failure_causeis set in such casses.failure_cause (
listofcom.vmware.vapi.std_client.LocalizableMessage) – The exception that caused the compliance check to fail. There can be more than one cause, since a policy can contain capabilities from multiple providers. If empty, it implies no failures while retrieving compliance. This attribute was added in vSphere API 6.7.
-
check(vm, check_spec=None)¶ Returns the storage policy Compliance
Compliance.Infoof a virtual machine after explicitly re-computing compliance check. This method was added in vSphere API 6.7.- Parameters
vm (
str) – Virtual machine identifier. The parameter must be an identifier for the resource type:VirtualMachine.check_spec (
Compliance.CheckSpecorNone) – Parameter specifies the entities on which storage policy compliance check is to be invoked. The storage compliance InfoCompliance.Infois returned. If None, the behavior is equivalent to aCompliance.CheckSpecwith CheckSpec#vmHome set to true and CheckSpec#disks populated with all disks attached to the virtual machine.
- Return type
Compliance.InfoorNone- Returns
Virtual machine storage policy compliance
Compliance.Infoclass . If None, neither the virtual machine home directory nor any of it’s virtual disks are associated with a storage policy.- Raise
com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailableif the system is unable to communicate with a service necessary to complete the request.- Raise
com.vmware.vapi.std.errors_client.Unauthenticatedif the user cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif the user does not have the required privileges.
-
get(vm)¶ Returns the cached storage policy compliance information of a virtual machine. This method was added in vSphere API 6.7.
- Parameters
vm (
str) – Virtual machine identifier. The parameter must be an identifier for the resource type:VirtualMachine.- Return type
Compliance.InfoorNone- Returns
Virtual machine storage policy compliance Info
Compliance.Info. If None, neither the virtual machine home directory nor any of it’s virtual disks are associated with a storage policy.- Raise
com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.ServiceUnavailableif the system is unable to communicate with a service to complete the request.- Raise
com.vmware.vapi.std.errors_client.Unauthenticatedif the user cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif the user does not have the required privileges.
-
class
com.vmware.vcenter.vm.storage.policy_client.StubFactory(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBaseInitialize StubFactoryBase
- Parameters
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance