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: 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 the DayOfWeek 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: VapiInterface

The Harbor class provides methods to manage the lifecycle of an integrated Harbor container registry in vCenter.

Deprecated since version vSphere: API 8.0.1.00200 Use com.vmware.vcenter.namespace_management.SupervisorServices and com.vmware.vcenter.namespace_management.supervisor_services.ClusterSupervisorServices instead to register and install a Harbor service. See the Harbor supervisor service document for more details.

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: VapiStruct

The Harbor.CreateSpec class contains the specification required to create a Harbor registry.

Deprecated since version vSphere: API 8.0.1.00200

Tip

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

Parameters:
  • cluster (str or None) – 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 or None) – 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 of Harbor.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: VapiStruct

The Harbor.GarbageCollection class contains garbage collection configuration for the Harbor registry.

Deprecated since version vSphere: API 8.0.1.00200

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 of type is Recurrence.WEEKLY.

  • hour (long) – Hour at which garbage collection should run. This attribute is optional and it is only relevant when the value of type is one of Recurrence.DAILY or Recurrence.WEEKLY.

  • minute (long) – Minute at which garbage collection should run. This attribute is optional and it is only relevant when the value of type is one of Recurrence.DAILY or Recurrence.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: VapiStruct

The Harbor.Info class contains detailed information about a running Harbor registry.

Deprecated since version vSphere: API 8.0.1.00200

Tip

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

Parameters:
  • cluster (str or None) – 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 by Harbor.CreateSpec.cluster.

  • namespace (str or None) – 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 of str) – Harbor certificate chain in base64 format.

  • garbage_collection (Harbor.GarbageCollection) – Garbage collection information for the registry.

  • storage (list of Harbor.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: VapiStruct

The Harbor.StorageInfo class contains the detailed information about storage used by the Harbor registry.

Deprecated since version vSphere: API 8.0.1.00200

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: 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.

Deprecated since version vSphere: API 8.0.1.00200

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 or None) – 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: VapiStruct

The Harbor.Summary class contains basic information about a running Harbor registry.

Deprecated since version vSphere: API 8.0.1.00200

Tip

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

Parameters:
  • cluster (str or None) – 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 by Harbor.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.

Deprecated since version vSphere: API 8.0.1.00200

Parameters:
  • client_token (str or None) – 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 if Harbor.CreateSpec.cluster does not have vSphere namespace enabled.

Raise:

com.vmware.vapi.std.errors_client.InvalidArgument if spec 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 on Harbor.CreateSpec.cluster.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.

  • The resource ClusterComputeResource referenced by the attribute Harbor.CreateSpec.cluster requires System.Read.

  • The resource SpsStorageProfile referenced by the attribute Harbor.StorageSpec.policy requires System.Read.

delete(registry)

Delete the Harbor registry in the cluster. All Harbor projects, repositories and images will be deleted upon Harbor registry deletion.

Deprecated since version vSphere: API 8.0.1.00200

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 by registry 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.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.

  • The resource com.vmware.vcenter.content.Registry referenced by the parameter registry requires System.Read.

get(registry)

Get detailed information of the Harbor registry.

Deprecated since version vSphere: API 8.0.1.00200

Parameters:

registry (str) – Identifier of the registry. The parameter must be an identifier for the resource type: com.vmware.vcenter.content.Registry.

Return type:

Harbor.Info

Returns:

Information about the registry.

Raise:

com.vmware.vapi.std.errors_client.NotFound if a Harbor registry specified by registry 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.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.

  • The resource com.vmware.vcenter.content.Registry referenced by the parameter registry requires System.Read.

list()

Returns basic information of all Harbor registries.

Deprecated since version vSphere: API 8.0.1.00200

Return type:

list of Harbor.Summary

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.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.

class com.vmware.vcenter.content.registries_client.Health(config)

Bases: 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: 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:
class Status(string)

Bases: 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 the Status 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:

Health.Info

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

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.

  • The resource com.vmware.vcenter.content.Registry referenced by the parameter registry requires System.Read.

class com.vmware.vcenter.content.registries_client.Recurrence(string)

Bases: 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 the Recurrence 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: StubFactoryBase

Initialize StubFactoryBase

Parameters:

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