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.EnumThe
DayOfWeekclass 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 theDayOfWeekinstance.
- 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.VapiInterfaceThe
Harborclass 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.VapiStructThe
Harbor.CreateSpecclass contains the specification required to create a Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
 cluster (
strorNone) – 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.GarbageCollectionorNone) – 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 (
listofHarbor.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.VapiStructThe
Harbor.GarbageCollectionclass 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 oftypeisRecurrence.WEEKLY.hour (
long) – Hour at which garbage collection should run. This attribute is optional and it is only relevant when the value oftypeis one ofRecurrence.DAILYorRecurrence.WEEKLY.minute (
long) – Minute at which garbage collection should run. This attribute is optional and it is only relevant when the value oftypeis one ofRecurrence.DAILYorRecurrence.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.VapiStructThe
Harbor.Infoclass contains detailed information about a running Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
 cluster (
strorNone) – 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 (
strorNone) – 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 (
listofstr) – Harbor certificate chain in base64 format.garbage_collection (
Harbor.GarbageCollection) – Garbage collection information for the registry.storage (
listofHarbor.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.VapiStructThe
Harbor.StorageInfoclass 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.VapiStructThe
Harbor.StorageSpecclass 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 (
longorNone) – 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.VapiStructThe
Harbor.Summaryclass contains basic information about a running Harbor registry.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
 cluster (
strorNone) – 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 (
strorNone) – 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.AlreadyExistsif a Harbor already exists in the associated cluster.- Raise
 com.vmware.vapi.std.errors_client.NotFoundif resources/objects could not be located.- Raise
 com.vmware.vapi.std.errors_client.UnsupportedifHarbor.CreateSpec.clusterdoes not have vSphere namespace enabled.- Raise
 com.vmware.vapi.std.errors_client.InvalidArgumentifspeccontains any errors.- Raise
 com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.- Raise
 com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.- Raise
 com.vmware.vapi.std.errors_client.Unauthorizedif 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.NotFoundif a registry specified byregistrycould not be found.- Raise
 com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.- Raise
 com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.- Raise
 com.vmware.vapi.std.errors_client.Unauthorizedif 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.NotFoundif a Harbor registry specified byregistrycould not be found.- Raise
 com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.- Raise
 com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.- Raise
 com.vmware.vapi.std.errors_client.Unauthorizedif 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.Errorif the system reports an error while responding to the request.- Raise
 com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.- Raise
 com.vmware.vapi.std.errors_client.Unauthorizedif the user does not have System.Read privilege.
- class com.vmware.vcenter.content.registries_client.Health(config)
 Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
Healthclass 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.VapiStructThe
Health.Infoclass 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.EnumThe
Health.Statusclass 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 theStatusinstance.
- 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.Errorif the system reports an error while responding to the request.- Raise
 com.vmware.vapi.std.errors_client.NotFoundif the registry does not exist.- Raise
 com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.- Raise
 com.vmware.vapi.std.errors_client.Unauthorizedif the user is not a member of the Administrators
- class com.vmware.vcenter.content.registries_client.Recurrence(string)
 Bases:
vmware.vapi.bindings.enum.EnumThe
Recurrenceclass 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 theRecurrenceinstance.
- 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.StubFactoryBaseInitialize StubFactoryBase
- Parameters
 stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance