com.vmware.vcenter.content.registries package
Submodules
com.vmware.vcenter.content.registries.harbor_client module
The com.vmware.vcenter.content.registries.harbor_client module provides
classes and classes for managing Harbor registry in vCenter.
- class com.vmware.vcenter.content.registries.harbor_client.Projects(config)
 Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
Projectsclass provides methods for managing the lifecycle of Harbor project that stores and distributes container repositories and images.- Parameters
 config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
- class ConfigStatus(string)
 Bases:
vmware.vapi.bindings.enum.EnumThe
Projects.ConfigStatusclass describes the status of reaching the desired configuration state for the Harbor project.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 theConfigStatusinstance.
- ERROR = ConfigStatus(string='ERROR')
 Failed to create Harbor project or apply the configuration to the project, user intervention needed.
- PENDING = ConfigStatus(string='PENDING')
 Harbor project is being created or the configuration is being applied to the project.
- READY = ConfigStatus(string='READY')
 Harbor project is created or configured correctly.
- REMOVING = ConfigStatus(string='REMOVING')
 The configuration is being removed and Harbor project is being deleted.
- class CreateSpec(name=None, scope=None)
 Bases:
vmware.vapi.bindings.struct.VapiStructThe
Projects.CreateSpecclass defines the information required to create a Harbor project.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
 name (
str) – Name of the Harbor project. Should be between 1-63 characters long alphanumeric string and may contain the following characters: a-z,0-9, and ‘-’. Must be starting with characters or numbers, with the ‘-’ character allowed anywhere except the first or last character.scope (
Projects.Scope) – Access type of a Harbor project.
- class Info(name=None, config_status=None, scope=None, creation_time=None, update_time=None, access_url=None, message=None)
 Bases:
vmware.vapi.bindings.struct.VapiStructThe
Projects.Infoclass contains detailed information about a Harbor project.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
 name (
str) – Name of the Harbor project. Should be between 1-63 characters long alphanumeric string and may contain the following characters: a-z,0-9, and ‘-’. Must be starting with characters or numbers, with the ‘-’ character allowed anywhere except the first or last character.config_status (
Projects.ConfigStatus) – The status of the Harbor project.scope (
Projects.Scope) – The access type of a Harbor project.creation_time (
datetime.datetime) – The date and time when the harbor project creation API was triggered and project identifier generated.update_time (
datetime.datetime) – The date and time when the harbor project purge API was triggered. In case no purge was triggered,updateTimeis same ascreationTime. This attribute is optional and it is only relevant when the value ofconfigStatusisProjects.ConfigStatus.READY.access_url (
str) – URL to access the harbor project through docker client. This attribute is optional and it is only relevant when the value ofconfigStatusisProjects.ConfigStatus.READY.message (
com.vmware.vapi.std_client.LocalizableMessage) – Details about the ERROR project status. This attribute is optional and it is only relevant when the value ofconfigStatusisProjects.ConfigStatus.ERROR.
- class Scope(string)
 Bases:
vmware.vapi.bindings.enum.EnumThe
Projects.Scopeclass in a project defines access levels of the project.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 theScopeinstance.
- PRIVATE = Scope(string='PRIVATE')
 A Harbor project can only be accessed by assigned users.
- PUBLIC = Scope(string='PUBLIC')
 A Harbor project can be accessed by everyone.
- class Summary(project=None, name=None, scope=None)
 Bases:
vmware.vapi.bindings.struct.VapiStructThe
Projects.Summaryclass contains basic information about a Harbor project.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
 project (
str) – Identifier of the harbor project. 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.Harbor.Project. 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.Harbor.Project.name (
str) – Name of the Harbor project. Should be between 1-63 characters long alphanumeric string and may contain the following characters: a-z,0-9, and ‘-’. Must be starting with characters or numbers, with the ‘-’ character allowed anywhere except the first or last character.scope (
Projects.Scope) – Access type of a Harbor project.
- create(registry, spec)
 Creates a project in a Harbor registry using the supplied specification. In vSphere 7.0, a Harbor registry is deployed in a vSphere cluster with vSphere namespaces enabled. When a namespace is created, a project with same name as the namespace is created in the Harbor registry, so this method should not be called.
- Parameters
 registry (
str) – Identifier of the Registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.spec (
Projects.CreateSpec) – Information used to create the Harbor project.
- Return type
 str- Returns
 Identifier of the newly created Harbor project. The return value will be an identifier for the resource type:
com.vmware.vcenter.content.Registry.Harbor.Project.- Raise
 com.vmware.vapi.std.errors_client.InvalidArgumentifspeccontains any error.- Raise
 com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif Harbor registry is being deleted.- Raise
 com.vmware.vapi.std.errors_client.NotFoundif a registry specified byregistrycould not be found.- Raise
 com.vmware.vapi.std.errors_client.AlreadyExistsif a project with the same name already exists in the registry. In vSphere 7.0, the existing project could have been created automatically when a namespace with the same name is created.- 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.ManageRegistryProject privilege.
- delete(registry, project)
 Deletes the specified project from Harbor registry. Repositories and images in the project will be removed upon project deletion. Storage space of deleted images in the project will be reclaimed through next scheduled Harbor registry garbage collection. In vSphere 7.0, a Harbor registry is deployed in a vSphere cluster with vSphere namespaces enabled. When a namespace is deleted, a project with same name as the namespace is deleted from the Harbor registry, so this method should not be called.
- Parameters
 registry (
str) – Identifier of the registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.project (
str) – Identifier of the Harbor project. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.Harbor.Project.
- Raise
 com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif Harbor registry is being deleted.- Raise
 com.vmware.vapi.std.errors_client.NotFoundifregistryorprojectcannot be found. In vSphere 7.0, the existing project could have been deleted automatically when a namespace with the same name is deleted.- 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.ManageRegistryProject privilege.
- get(registry, project)
 Returns detailed information about the specified Harbor project.
- Parameters
 registry (
str) – Identifier of the registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.project (
str) – Identifier of the Harbor project. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.Harbor.Project.
- Return type
 - Returns
 Detailed information about the specified Harbor project.
- Raise
 com.vmware.vapi.std.errors_client.NotFoundifregistryorprojectcannot 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(registry)
 Returns basic information of all projects in a 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
 The list of summary information of all Harbor projects.
- Raise
 com.vmware.vapi.std.errors_client.NotFoundifregistrycannot 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.
- purge(registry, project)
 Remove all repositories, images and members in the project. Storage space of deleted images in the project will be reclaimed through next scheduled Harbor registry garbage collection.
- Parameters
 registry (
str) – Identifier of the registry. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.project (
str) – Identifier of the Harbor project. The parameter must be an identifier for the resource type:com.vmware.vcenter.content.Registry.Harbor.Project.
- Raise
 com.vmware.vapi.std.errors_client.NotFoundifregistryorprojectcannot be found.- Raise
 com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif Harbor registry is being deleted or the project is not inProjects.ConfigStatus.READYstatus.- 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.ManageRegistryProject privilege.
- class com.vmware.vcenter.content.registries.harbor_client.StubFactory(stub_config)
 Bases:
vmware.vapi.bindings.stub.StubFactoryBaseInitialize StubFactoryBase
- Parameters
 stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance