com.vmware.vcenter.content package¶
Subpackages¶
Submodules¶
com.vmware.vcenter.content.registries_client module¶
The com.vmware.vcenter.content.registries_client
module provides classes
and classes for managing image registries in vCenter.
-
class
com.vmware.vcenter.content.registries_client.
DayOfWeek
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
DayOfWeek
class describes the supported days of the week to run a specific operation for a container registry.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 theDayOfWeek
instance.
-
FRIDAY
= DayOfWeek(string='FRIDAY')¶ Friday.
-
MONDAY
= DayOfWeek(string='MONDAY')¶ Monday.
-
SATURDAY
= DayOfWeek(string='SATURDAY')¶ Saturday.
-
SUNDAY
= DayOfWeek(string='SUNDAY')¶ Sunday.
-
THURSDAY
= DayOfWeek(string='THURSDAY')¶ Thursday.
-
TUESDAY
= DayOfWeek(string='TUESDAY')¶ Tuesday.
-
WEDNESDAY
= DayOfWeek(string='WEDNESDAY')¶ Wednesday.
-
class
com.vmware.vcenter.content.registries_client.
Harbor
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Harbor
class provides methods to manage the lifecycle of an integrated Harbor container registry in vCenter.- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
-
class
CreateSpec
(cluster=None, garbage_collection=None, storage=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Harbor.CreateSpec
class contains the specification required to create a Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
cluster (
str
orNone
) – Identifier of the cluster hosting the registry. 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
. If None, registry will not be created on a specified cluster. This is required in current version, since Harbor can only be created on a cluster with Kubernetes enabled.garbage_collection (
Harbor.GarbageCollection
orNone
) – Garbage collection configuration for the Harbor registry. If None, a default configuration is set, Recurrence#WEEKLY, DayOfWeek#SATURDAY, GarbageCollection#hour is 2, GarbageCollection#minute is 0.storage (
list
ofHarbor.StorageSpec
) – Storage associated with the Harbor registry. The list contains only one storage backing in this version.
-
class
GarbageCollection
(type=None, day_of_week=None, hour=None, minute=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Harbor.GarbageCollection
class contains garbage collection configuration for the Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
type (
Recurrence
) – Frequency of garbage collection.day_of_week (
DayOfWeek
) – Day of the week when garbage collection should run. This attribute is optional and it is only relevant when the value oftype
isRecurrence.WEEKLY
.hour (
long
) – Hour at which garbage collection should run. This attribute is optional and it is only relevant when the value oftype
is one ofRecurrence.DAILY
orRecurrence.WEEKLY
.minute (
long
) – Minute at which garbage collection should run. This attribute is optional and it is only relevant when the value oftype
is one ofRecurrence.DAILY
orRecurrence.WEEKLY
.
-
class
Info
(cluster=None, namespace=None, version=None, creation_time=None, ui_access_url=None, cert_chain=None, garbage_collection=None, storage=None, health=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Harbor.Info
class contains detailed information about a running Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
cluster (
str
orNone
) – Identifier 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
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource
. If None, container registry is not created on the cluster specified byHarbor.CreateSpec.cluster
.namespace (
str
orNone
) – Identifier of the Harbor namespace in case it is created in a Kubernetes environment. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:NamespaceInstance
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:NamespaceInstance
. If None, no Kubernetes namespace is created for the Harbor.version (
str
) – Version of the registry.creation_time (
datetime.datetime
) – The date and time when the harbor registry was created.ui_access_url (
str
) – URL to access the UI of the registry.cert_chain (
list
ofstr
) – Harbor certificate chain in base64 format.garbage_collection (
Harbor.GarbageCollection
) – Garbage collection information for the registry.storage (
list
ofHarbor.StorageInfo
) – Storage information associated with the registry.health (
Health.Info
) – Health status of the container registry.
-
class
StorageInfo
(policy=None, capacity=None, used=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Harbor.StorageInfo
class contains the detailed information about storage used by the Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
policy (
str
) – Identifier of the storage policy. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:SpsStorageProfile
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:SpsStorageProfile
.capacity (
long
) – Total capacity for the registry storage (in mebibytes). This is the storage limit set on the Harbor registry. If a storage limit was not set on the registry, the default registry capacity - 204800 mebibytes is used.used (
long
) – Overall storage used by the registry (in mebibytes). This is the sum of used storage associated with storage policies configured for the registry.
-
class
StorageSpec
(policy=None, limit=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Harbor.StorageSpec
class contains the specification required to configure storage associated with a Harbor registry. In this version, Harbor registry is created in Kubernetes environment, information in this class will result in storage quotas on a Kubernetes namespace.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
policy (
str
) – Identifier of the storage policy. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:SpsStorageProfile
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:SpsStorageProfile
.limit (
long
orNone
) – The maximum amount of storage (in mebibytes) which can be utilized by the registry for this specification. If None, a default limit of 204800 mebibytes will be set as the registry’s storage capacity.
-
class
Summary
(cluster=None, registry=None, version=None, ui_access_url=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Harbor.Summary
class contains basic information about a running Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
cluster (
str
orNone
) – Identifier 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
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource
. If None, container registry is not created on the cluster specified byHarbor.CreateSpec.cluster
.registry (
str
) – Identifier of the registry. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vcenter.content.Registry
. 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.content.Registry
.version (
str
) – Version of the registry.ui_access_url (
str
) – URL to access the UI of the registry.
-
create
(spec, client_token=None)¶ Creates a Harbor registry in the cluster.
- Parameters
client_token (
str
orNone
) – A unique token generated on the client for each creation request. The token should be a universally unique identifier (UUID), for example:b8a2a2e3-2314-43cd-a871-6ede0f429751
. This token can be used to guarantee idempotent creation. If not specified, creation is not idempotent.spec (
Harbor.CreateSpec
) – Specification for creating the Harbor registry.
- Return type
str
- Returns
Identifier of the deployed registry. The return value will be an identifier for the resource type:
com.vmware.vcenter.content.Registry
.- Raise
com.vmware.vapi.std.errors_client.AlreadyExists
if a Harbor already exists in the associated cluster.- Raise
com.vmware.vapi.std.errors_client.NotFound
if resources/objects could not be located.- Raise
com.vmware.vapi.std.errors_client.Unsupported
ifHarbor.CreateSpec.cluster
does not have vSphere namespace enabled.- Raise
com.vmware.vapi.std.errors_client.InvalidArgument
ifspec
contains any errors.- 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 ContentLibrary.ManageRegistry and/or CertificateAuthority.Manage privilege, or user does not have ContentLibrary.ManageClusterRegistryResource privilege onHarbor.CreateSpec.cluster
.
-
delete
(registry)¶ Delete the Harbor registry in the cluster. All Harbor projects, repositories and images will be deleted upon Harbor registry deletion.
- Parameters
registry (
str
) – Identifier of the registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry
.- Raise
com.vmware.vapi.std.errors_client.NotFound
if a registry specified byregistry
could not be found.- 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 ContentLibrary.ManageRegistry privilege.
-
get
(registry)¶ Get detailed information of the Harbor registry.
- Parameters
registry (
str
) – Identifier of the registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry
.- Return type
- Returns
Information about the registry.
- Raise
com.vmware.vapi.std.errors_client.NotFound
if a Harbor registry specified byregistry
could not be found.- 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 basic information of all Harbor registries.
- Return type
- Returns
The list of basic information of all Harbor registries.
- 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.
-
class
com.vmware.vcenter.content.registries_client.
Health
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Health
class provides methods to retrieve health status for a container registry.- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.
-
class
Info
(status=None, details=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Health.Info
class contains health information about a container registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
status (
Health.Status
) – Container registry status.details (
com.vmware.vapi.std_client.LocalizableMessage
) – Details about the status. If None, message details are not required for taking actions.
-
class
Status
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Health.Status
class describes the status of the container registry.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 theStatus
instance.
-
DELETING
= Status(string='DELETING')¶ Container registry is being deleted.
-
ERROR
= Status(string='ERROR')¶ Container registry failed to start or stopped with fatal error.
-
RUNNING
= Status(string='RUNNING')¶ Container registry is running.
-
STARTING
= Status(string='STARTING')¶ Container registry is starting.
-
WARNING
= Status(string='WARNING')¶ Container registry is running with some warning, for example, storage reaches the threshold configuration.
-
get
(registry)¶ Returns the health information of a container registry in the vCenter.
- Parameters
registry (
str
) – Identifier of the registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry
.- Return type
- Returns
Health information of the registry.
- 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.NotFound
if the registry does not exist.- 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 is not a member of the Administrators
-
class
com.vmware.vcenter.content.registries_client.
Recurrence
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Recurrence
class defines the supported values for how often to run a specific operation for a container registry.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 theRecurrence
instance.
-
DAILY
= Recurrence(string='DAILY')¶ An operation occurs on a daily basis.
-
NONE
= Recurrence(string='NONE')¶ No operation is scheduled.
-
WEEKLY
= Recurrence(string='WEEKLY')¶ An operation occurs on a weekly basis.
-
class
com.vmware.vcenter.content.registries_client.
StubFactory
(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
Initialize StubFactoryBase
- Parameters
stub_config (
vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance