com.vmware.vcenter.namespace_management package¶
Submodules¶
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
ofstr
) – Set of available versions can be upgraded to.last_upgraded_date (
datetime.datetime
orNone
) – Date of last successful upgrade. If None, the cluster has not yet been upgraded.messages (
list
ofClusters.Message
) – Current set of messages associated with the cluster version.state (
Clusters.State
) – Current state of the upgrade.upgrade_status (
Clusters.UpgradeStatus
orNone
) – 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
severity (
Clusters.Message.Severity
) – Type of the message.details (
com.vmware.vapi.std_client.LocalizableMessage
) – Details about the message.
-
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 theSeverity
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 ofres
isClusters.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 theRes
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 theState
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
ofstr
) – Set of versions available for upgrade.last_upgraded_date (
datetime.datetime
orNone
) – Date of last successful upgrade. If None, the cluster has not yet been upgraded.desired_version (
str
orNone
) – 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
orNone
) – 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
orNone
) – Desired version the cluster will be upgraded to. If None, the cluster upgrade is not in progress.messages (
list
ofClusters.Message
) – Current set of messages associated with the upgrade state.progress (
Clusters.UpgradeProgress
orNone
) – 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
- 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.
-
list
()¶ Returns upgrade related information about all WCP enabled clusters.
- Return type
- 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
ofstr
andClusters.UpgradeSpec
) – Specifications for upgrading selected clusters. The key in the parameterdict
must be an identifier for the resource type:ClusterComputeResource
.- Return type
dict
ofstr
andClusters.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 ofobjType
isTimeSeries.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 ofobjType
isTimeSeries.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 ofobjType
isTimeSeries.Spec.ObjType.CLUSTER
.start (
long
) – UNIX timestamp value indicating when the requested series of statistical samples should begin. https://en.wikipedia.org/wiki/Unix_timeend (
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 theObjType
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
andTimeSeries.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
oflong
) – Sequence of UNIX timestamp values at which statistical values were sampled. https://en.wikipedia.org/wiki/Unix_timevalues (
list
oflong
) – 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
ofTimeSeries.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 inTimeSeries.Spec.start
is invalid, or the end time inTimeSeries.Spec.end
is invalid.- Raise
com.vmware.vapi.std.errors_client.NotFound
if the specified cluster inTimeSeries.Spec.cluster
or the namespace inTimeSeries.Spec.namespace
orTimeSeries.Spec.pod
does not exist.- Raise
com.vmware.vapi.std.errors_client.Unsupported
if the specified cluster inTimeSeries.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.