com.vmware.vcenter.consumption_domains.zones package
Submodules
com.vmware.vcenter.consumption_domains.zones.cluster_client module
- class com.vmware.vcenter.consumption_domains.zones.cluster_client.Associations(config)
Bases:
VapiInterface
The
Associations
class provides methods to manage associations of a single consumption-domain zone to multiple vSphere clusters. This class was added in vSphere API 8.0.0.1.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
- class Status(success=None, failed_clusters=None)
Bases:
VapiStruct
The
Associations.Status
class contains information about the outcome of the method to add a set of vSphere clusters to a zone or the method to remove a set of vSphere clusters from a zone. It also contains information about the partial failures, in case the addition/removal failed for a subset of clusters. This class was added in vSphere API 8.0.0.1.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters:
success (
bool
) – This is true if the complete method succeeded without any errors. Otherwise, it is false if all or some methods have failed. This attribute was added in vSphere API 8.0.0.1.failed_clusters (
dict
ofstr
andException
) – Associations between the identifiers of the clusters for which the operation failed and the reason of the failure. This attribute was added in vSphere API 8.0.0.1. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:ClusterComputeResource
.
- add(zone, clusters)
Maps a consumption-domain zone to the specified vSphere clusters. If a cluster or a subset of specified clusters are already members of the specified zone, the result is success for those clusters. This method supports partial success, i.e., it is possible that a subset of the specified clusters get successfully associated with the specified zone but the association fails for a subset of clusters. The returned result will contain the details about only those clusters for which the association failed. This method was added in vSphere API 8.0.0.1.
- Parameters:
zone (
str
) – Identifier of the zone to be mapped to the specified vSphere clusters. The parameter must be an identifier for the resource type:com.vmware.vcenter.consumption_domains.Zone
.clusters (
set
ofstr
) – Set of identifiers of vSphere clusters to which the the specified zone should be mapped. The parameter must contain identifiers for the resource type:ClusterComputeResource
.
- Return type:
- Returns:
Status see . If the method failed, returns the reason of failures. There will be an error message indicating the identifier of the cluster for which the association failed and the reason of failure. The cluster identifiers that are not present in will have been successfully associated.
- Raise:
com.vmware.vapi.std.errors_client.InvalidArgument
if more than one cluster or an empty set of clusters is specified.- Raise:
com.vmware.vapi.std.errors_client.NotFound
if the specified zone is not known to this vCenter server.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have all of the privileges described as follows: - The resource com.vmware.vcenter.consumption_domains.Zone referenced by the parameter zone requires Zones.Manage privilege. - Each resource of ClusterComputeResource referenced by the parameter clusters requires Zone.ObjectAttachable privilege.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.- Raise:
com.vmware.vapi.std.errors_client.Error
when unexpected error is encountered.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:The resource
com.vmware.vcenter.consumption_domains.Zone
referenced by the parameterzone
requiresZone.Manage
.
- get(zone)
Returns identifiers of the clusters that are mapped to the specified consumption-domain zone. This method was added in vSphere API 8.0.0.1.
- Parameters:
zone (
str
) – Identifier of the zone to be queried for its associated vSphere clusters. The parameter must be an identifier for the resource type:com.vmware.vcenter.consumption_domains.Zone
.- Return type:
set
ofstr
- Returns:
The set of vSphere clusters mapped to the specified zone. The return value will contain identifiers for the resource type:
ClusterComputeResource
.- Raise:
com.vmware.vapi.std.errors_client.NotFound
if the specified zone is not known to this vCenter server.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have all of the privileges described as follows: - The resource com.vmware.vcenter.consumption_domains.Zone referenced by the parameter zone requires System.Read privilege.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.- Raise:
com.vmware.vapi.std.errors_client.Error
when unexpected error is encountered.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:The resource
com.vmware.vcenter.consumption_domains.Zone
referenced by the parameterzone
requiresSystem.Read
.
- remove(zone, clusters)
Removes the mapping between the specified consumption-domain zone and vSphere clusters. If a cluster or a subset of specified clusters are not members of the specified zone, then the result is a success for those clusters. In order to remove the mapping between a zone and a cluster, there must not be any workload running in that zone because removing the mapping between a zone and a cluster could result in undefined behavior for the entities depending on this mapping to be present. This method supports partial success, i.e., it is possible that the mapping gets successfully removed for a subset of the clusters but fails for another subset of the clusters. The returned result will contain the details about only those clusters for which the method failed. This method was added in vSphere API 8.0.0.1.
- Parameters:
zone (
str
) – Identifier of the zone for which the mapping needs to be removed. The parameter must be an identifier for the resource type:com.vmware.vcenter.consumption_domains.Zone
.clusters (
set
ofstr
) – Set of identifiers of vSphere clusters which need to be removed from the mapping. The parameter must contain identifiers for the resource type:ClusterComputeResource
.
- Return type:
- Returns:
Status see . If the method failed, returns the reason of failures. There will be an error message indicating the identifier of the cluster for which the association removal failed and the reason of failure.
- Raise:
com.vmware.vapi.std.errors_client.NotFound
if the specified zone is not known to this vCenter server.- Raise:
com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if there is a workload running in the specified zone and depends on this zone’s cluster associations to be present.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have all of the privileges described as follows: - The resource com.vmware.vcenter.consumption_domains.Zone referenced by the parameter zone requires Zones.Manage privilege. - Each resource of ClusterComputeResource referenced by the parameter clusters requires Zone.ObjectAttachable privilege.- Raise:
com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.- Raise:
com.vmware.vapi.std.errors_client.Error
when unexpected error is encountered.- Raise:
com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:The resource
com.vmware.vcenter.consumption_domains.Zone
referenced by the parameterzone
requiresZone.Manage
.
- class com.vmware.vcenter.consumption_domains.zones.cluster_client.StubFactory(stub_config)
Bases:
StubFactoryBase
Initialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance