com.vmware.vcenter.namespace_management package

Submodules

com.vmware.vcenter.namespace_management.cns_client module

The com.vmware.vcenter.namespace_management.cns_client module provides classes for configuration of PSP capabilities on VC clusters.

class com.vmware.vcenter.namespace_management.cns_client.MaintenanceActionType(string)

Bases: vmware.vapi.bindings.enum.Enum

The MaintenanceActionType class contains actions to be taken when an entity enters maintenance mode.

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 MaintenanceActionType instance.

EnsureAccessibility = MaintenanceActionType(string='EnsureAccessibility')

The entity is going down temporarily for maintenance. Still need to ensure application availability and storage accessibility at least in a degraded level.

NoAction = MaintenanceActionType(string='NoAction')

Admin override to not delay or stop the entity from entering maintenance mode.

PermanentRemoval = MaintenanceActionType(string='PermanentRemoval')

The entity is getting permanently removed. Move applications, rebuild storage on other entities before allowing to proceed.

class com.vmware.vcenter.namespace_management.cns_client.StubFactory(stub_config)

Bases: vmware.vapi.bindings.stub.StubFactoryBase

Initialize StubFactoryBase

Parameters

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

com.vmware.vcenter.namespace_management.software_client module

The com.vmware.vcenter.namespace_management.software_client module provides classes for managing namespaces software components.

class com.vmware.vcenter.namespace_management.software_client.Clusters(config)

Bases: vmware.vapi.bindings.stub.VapiInterface

The Clusters class provides methods to upgrade the vSphere clusters.

Parameters

config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.

class Info(current_version=None, available_versions=None, last_upgraded_date=None, messages=None, state=None, upgrade_status=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.Info class contains detailed information about the cluster upgrade status and related information.

Tip

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

Parameters
  • current_version (str) – Current version of the cluster.

  • available_versions (list of str) – Set of available versions can be upgraded to.

  • last_upgraded_date (datetime.datetime or None) – Date of last successful upgrade. If None, the cluster has not yet been upgraded.

  • messages (list of Clusters.Message) – Current set of messages associated with the cluster version.

  • state (Clusters.State) – Current state of the upgrade.

  • upgrade_status (Clusters.UpgradeStatus or None) – Information about upgrade in progress. If None, the cluster upgrade is not in progress.

class Message(severity=None, details=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.Message class contains the information about the object configuration.

Tip

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

Parameters
class Severity(string)

Bases: vmware.vapi.bindings.enum.Enum

The Clusters.Message.Severity class represents the severity of the message.

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 Severity instance.

ERROR = Severity(string='ERROR')

Error message. This is accompanied by vCenter event and/or alarm.

INFO = Severity(string='INFO')

Informational message. This may be accompanied by vCenter event.

WARNING = Severity(string='WARNING')

Warning message. This may be accompanied by vCenter event.

class Result(res=None, exception=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.Result class contains the result of batch upgrade method.

Tip

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

Parameters
  • res (Clusters.Result.Res) – The result of batch upgrade method.

  • exception (Exception) – Exception when cluster pre-check failed during upgrade invocation. This attribute is optional and it is only relevant when the value of res is Clusters.Result.Res.REJECTED.

class Res(string)

Bases: vmware.vapi.bindings.enum.Enum

The Clusters.Result.Res class represents the upgrade invocation result for each cluster.

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 Res instance.

REJECTED = Res(string='REJECTED')

Upgrade is rejected. This implies pre-check failed when invoking upgrade of the cluster.

STARTED = Res(string='STARTED')

Upgrade is started.

class State(string)

Bases: vmware.vapi.bindings.enum.Enum

The Clusters.State class describes the state of the upgrade.

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 State instance.

ERROR = State(string='ERROR')

Upgrade failed and need user intervention.

PENDING = State(string='PENDING')

Upgrade is in progress.

READY = State(string='READY')

Cluster is ready when there is no upgrade or upgrade is completed.

class Summary(cluster=None, cluster_name=None, current_version=None, available_versions=None, last_upgraded_date=None, desired_version=None, state=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.Summary class contains basic information about the cluster upgrade related information.

Tip

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

Parameters
  • cluster (str) – Identifier for the cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ClusterComputeResource. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ClusterComputeResource.

  • cluster_name (str) – Name of the cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ClusterComputeResource.name. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ClusterComputeResource.name.

  • current_version (str) – Current version of the cluster.

  • available_versions (list of str) – Set of versions available for upgrade.

  • last_upgraded_date (datetime.datetime or None) – Date of last successful upgrade. If None, the cluster has not yet been upgraded.

  • desired_version (str or None) – Desired version the cluster will be upgraded to. If None, the cluster upgrade is not in progress.

  • state (Clusters.State) – Current state of the upgrade.

class UpgradeProgress(total=None, completed=None, message=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.UpgradeProgress class contains detailed information about the cluster upgrade progess.

Tip

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

Parameters
  • total (long) – Total amount of the work for the operation. The work here represents the number of master nodes in the cluster need to be upgraded.

  • completed (long) – The amount of work completed for the operation. The value can only be incremented. The number or master nodes which upgrade completed.

  • message (com.vmware.vapi.std_client.LocalizableMessage) – Message about the work progress.

class UpgradeSpec(desired_version=None, ignore_precheck_warnings=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.UpgradeSpec class contains the specification required to upgrade a cluster.

Tip

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

Parameters
  • desired_version (str) – Version number the cluster is going to be upgraded to.

  • ignore_precheck_warnings (bool or None) – If true, the upgrade workflow will ignore any pre-check warnings and proceed with the upgrade. If None, the upgrade workflow will not ignore pre-check warnings and fail the upgrade. It is equivalent to setting the value to false. The workflow adopts a conservative approach of failing the upgrade if None to solely let the user decide whether to force the upgrade despite the warnings.

class UpgradeStatus(desired_version=None, messages=None, progress=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The Clusters.UpgradeStatus class contains detailed information about the cluster when upgraded is in progress.

Tip

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

Parameters
  • desired_version (str or None) – Desired version the cluster will be upgraded to. If None, the cluster upgrade is not in progress.

  • messages (list of Clusters.Message) – Current set of messages associated with the upgrade state.

  • progress (Clusters.UpgradeProgress or None) – Information about upgrade progess. If None, the cluster upgrade is not in progress.

get(cluster)

Returns upgrade related information of a specific cluster.

Parameters

cluster (str) – Identifier for the cluster which will be upgraded. The parameter must be an identifier for the resource type: ClusterComputeResource.

Return type

Clusters.Info

Returns

Information about the upgrade of the specified WCP enabled cluster.

Raise

com.vmware.vapi.std.errors_client.NotFound if cluster could not be located.

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.Unauthenticated if the user can not be authenticated.

Raise

com.vmware.vapi.std.errors_client.Unauthorized if the user does not have System.Read privilege.

Raise

com.vmware.vapi.std.errors_client.Unsupported if the cluster is not WCP enabled.

list()

Returns upgrade related information about all WCP enabled clusters.

Return type

list of Clusters.Summary

Returns

List of upgrade summary of all WCP enabled clusters.

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.Unauthenticated if the user can not be authenticated.

Raise

com.vmware.vapi.std.errors_client.Unauthorized if the user does not have System.Read privilege.

upgrade(cluster, spec)

Upgrade the cluster to a specific version. This operation upgrades the components on control plane VMs and worker plane hosts based on the selected version. Before upgrading, this operation performs pre-checks and sets the evaluation response in Info.UpgradeStatus.messages with various Message.Severity levels. Depending on the severity, the upgrade may or may not proceed beyond prechecks. Here is a list of severities and corresponding behavior: - ERROR: Upgrade does not proceed beyond precheck operation - WARNING: Upgrade proceeds beyond precheck operation only if UpgradeSpec.ignorePrecheckWarnings is set to true - INFO: Upgrade proceeds beyond precheck operation uninterrupted

Parameters
  • cluster (str) – Identifier for the cluster which will be upgraded. The parameter must be an identifier for the resource type: ClusterComputeResource.

  • spec (Clusters.UpgradeSpec) – Specification for upgrading the cluster.

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.Unsupported if pre-check failed of the cluster.

Raise

com.vmware.vapi.std.errors_client.NotFound if cluster could not be located.

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 Namespaces.Manage privilege.

upgrade_multiple(specs)

Upgrade a set of clusters to its corresponding specific version.

Parameters

specs (dict of str and Clusters.UpgradeSpec) – Specifications for upgrading selected clusters. The key in the parameter dict must be an identifier for the resource type: ClusterComputeResource.

Return type

dict of str and Clusters.Result

Returns

Pre-check result when invoking upgrade for each cluster. The key in the return value dict will be an identifier for the resource type: ClusterComputeResource.

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.Unauthenticated if the user can not be authenticated.

Raise

com.vmware.vapi.std.errors_client.Unauthorized if the user does not have Namespaces.Manage privilege on all specified clusters.

class com.vmware.vcenter.namespace_management.software_client.StubFactory(stub_config)

Bases: vmware.vapi.bindings.stub.StubFactoryBase

Initialize StubFactoryBase

Parameters

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

com.vmware.vcenter.namespace_management.stats_client module

The com.vmware.vcenter.namespace_management.stats_client module provides classes for gathering statistics related to various Namespaces related components.

class com.vmware.vcenter.namespace_management.stats_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.namespace_management.stats_client.TimeSeries(config)

Bases: vmware.vapi.bindings.stub.VapiInterface

The TimeSeries class provides methods to gather statistical values for clusters, namespaces and pods.

Parameters

config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.

class PodIdentifier(namespace=None, pod_name=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

Pod identifier. These are the fields required to uniquely identify a pod.

Tip

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

Parameters
  • namespace (str) – The namespace that the pod is running in. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vcenter.namespaces.Instance. 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.namespaces.Instance.

  • pod_name (str) – The name of the pod itself.

class Spec(obj_type=None, pod=None, namespace=None, cluster=None, start=None, end=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

This structure is sent in a request for TimeSeries data and is used to specify what object stats should be returned for.

Tip

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

Parameters
  • obj_type (TimeSeries.Spec.ObjType) – Type of statistics object that the request is operating on.

  • pod (TimeSeries.PodIdentifier) – Pod Identifier for queries on an individual pod. This attribute is optional and it is only relevant when the value of objType is TimeSeries.Spec.ObjType.POD.

  • namespace (str) – Namespace name for queries for a namespace. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vcenter.namespaces.Instance. 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.namespaces.Instance. This attribute is optional and it is only relevant when the value of objType is TimeSeries.Spec.ObjType.NAMESPACE.

  • cluster (str) – Cluster identifier for queries for a cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: ClusterComputeResource. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: ClusterComputeResource. This attribute is optional and it is only relevant when the value of objType is TimeSeries.Spec.ObjType.CLUSTER.

  • start (long) – UNIX timestamp value indicating when the requested series of statistical samples should begin. https://en.wikipedia.org/wiki/Unix_time

  • end (long) – UNIX timestamp value indicating when the requested series of statistical samples should end. https://en.wikipedia.org/wiki/Unix_time

class ObjType(string)

Bases: vmware.vapi.bindings.enum.Enum

Type of statistics object that this request is operating on.

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 ObjType instance.

CLUSTER = ObjType(string='CLUSTER')

The CLUSTER object type is used when specifying a vSphere cluster.

NAMESPACE = ObjType(string='NAMESPACE')

The NAMESPACE object type is used to specify a namespace.

POD = ObjType(string='POD')

The POD object type is used to specify an individual pod within a namespace.

class TimeSeries(counter=None, time_stamps=None, values=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

A set of timestamps and statistical values representing a time series. The lengths of TimeSeries.TimeSeries.time_stamps and TimeSeries.TimeSeries.values will always match each other.

Tip

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

Parameters
  • counter (str) – Counter identifier.

  • time_stamps (list of long) – Sequence of UNIX timestamp values at which statistical values were sampled. https://en.wikipedia.org/wiki/Unix_time

  • values (list of long) – Sequence of sampled values corresponding to the timestamps in tss.

get(spec)

Gather statistical values for a cluster, namespace, or pod.

Parameters

spec (TimeSeries.Spec) – Specification of the statistical values that should be returned.

Return type

list of TimeSeries.TimeSeries

Returns

A list of TimeSeries values for each counter specified in the request.

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 start time in TimeSeries.Spec.start is invalid, or the end time in TimeSeries.Spec.end is invalid.

Raise

com.vmware.vapi.std.errors_client.NotFound if the specified cluster in TimeSeries.Spec.cluster or the namespace in TimeSeries.Spec.namespace or TimeSeries.Spec.pod does not exist.

Raise

com.vmware.vapi.std.errors_client.Unsupported if the specified cluster in TimeSeries.Spec.cluster is not enabled for Namespaces.

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 System.Read privilege.