com.vmware.vcenter.storage.policies package

Submodules

com.vmware.vcenter.storage.policies.compliance_client module

class com.vmware.vcenter.storage.policies.compliance_client.StubFactory(stub_config)

Bases: vmware.vapi.bindings.stub.StubFactoryBase

Initialize StubFactoryBase

Parameters

stub_config (vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance

class com.vmware.vcenter.storage.policies.compliance_client.VM(config)

Bases: vmware.vapi.bindings.stub.VapiInterface

The VM class provides methods related to query virtual machines of given compliance statuses. 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 FilterSpec(status=None, vms=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The VM.FilterSpec class contains Status used to filter the results when listing virtual machines (see VM.list()). This class was added in vSphere API 6.7.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters
  • status (set of VM.Status) – Compliance Status that a virtual machine must have to match the filter. Atleast one status must be specified. This attribute was added in vSphere API 6.7.

  • vms (set of str or None) – Identifiers of virtual machines that can match the filter. 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: 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 matches the filter

class Info(vm_home=None, disks=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

Provides the compliance details of a virtual machine and its associated entities which match the given compliance statuses. 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 (VM.Status or None) – Compliance status of the virtual machine home. This attribute was added in vSphere API 6.7. If None or empty, virtual machine home is not associated with a storage policy.

  • disks (dict of str and VM.Status) – A Map of virtual disks and their compliance status If empty, the virtual machine does not have any disks or its disks are not 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 attribute dict must 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 attribute dict will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk.

class Status(string)

Bases: vmware.vapi.bindings.enum.Enum

The {\@Status} class defines he valid compliance status values for a virtual machine or virtual disk. 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 the Status instance.

COMPLIANT = Status(string='COMPLIANT')

The virtual machine or virtual disk is in compliance. This class attribute was added in vSphere API 6.7.

NON_COMPLIANT = Status(string='NON_COMPLIANT')

The virtual machine or virtual disk is in not in compliance. This class attribute was added in vSphere API 6.7.

NOT_APPLICABLE = Status(string='NOT_APPLICABLE')

Compliance computation is not applicable for this virtual machine or disk because it does not have any storage requirement that apply to the object-based datastore on which the entity is placed. This class attribute was added in vSphere API 6.7.

OUT_OF_DATE = Status(string='OUT_OF_DATE')

Compliance status becomes out of date when the profile associated with the virtual machine or disk is edited and not applied. The compliance status will remain out of date until the latest policy is applied. This class attribute was added in vSphere API 6.7.

UNKNOWN_COMPLIANCE = Status(string='UNKNOWN_COMPLIANCE')

Compliance status of the virtual machine or virtual disk is not known. This class attribute was added in vSphere API 6.7.

list(filter)

Returns compliance information about at most 1000 virtual machines matching the filter VM.FilterSpec. If there are no virtual machines matching the VM.FilterSpec an empty List is returned. Virtual machines without storage policy association are not returned. This method was added in vSphere API 6.7.

Parameters

filter (VM.FilterSpec) – compliance status of matching virtual machines for which information should be returned.

Return type

dict of str and VM.Info

Returns

compliance information about virtual machines matching the filter VM.FilterSpec. The key in the return value dict will be an identifier for the resource type: VirtualMachine.

Raise

com.vmware.vapi.std.errors_client.Error if the system reports an error while responding to the request.

Raise

com.vmware.vapi.std.errors_client.InvalidArgument if the VM.FilterSpec.status attribute contains a value that is not supported by the server.

Raise

com.vmware.vapi.std.errors_client.ServiceUnavailable if the system is unable to communicate with a service to complete the request.

Raise

com.vmware.vapi.std.errors_client.Unauthenticated if the user can not be authenticated.

Raise

com.vmware.vapi.std.errors_client.Unauthorized if the user does not have the required privileges.

Raise

com.vmware.vapi.std.errors_client.Unsupported if the API is invoked against vCenter Server version is less than 6.5

Raise

com.vmware.vapi.std.errors_client.UnableToAllocateResource If more than 1000 results match the VM.FilterSpec