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:
VapiInterfaceThe
Projectsclass provides methods for managing the lifecycle of Harbor project that stores and distributes container repositories and images.Deprecated since version vSphere: API 8.0.1.00200 Since the parent resource
com.vmware.vcenter.content.registries.harbor_clientis deprecated.- Parameters:
config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
- class ConfigStatus(string)
Bases:
EnumThe
Projects.ConfigStatusclass describes the status of reaching the desired configuration state for the Harbor project.Deprecated since version vSphere: API 8.0.1.00200
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.
Deprecated since version vSphere: API 8.0.1.00200
- PENDING = ConfigStatus(string='PENDING')
Harbor project is being created or the configuration is being applied to the project.
Deprecated since version vSphere: API 8.0.1.00200
- READY = ConfigStatus(string='READY')
Harbor project is created or configured correctly.
Deprecated since version vSphere: API 8.0.1.00200
- REMOVING = ConfigStatus(string='REMOVING')
The configuration is being removed and Harbor project is being deleted.
Deprecated since version vSphere: API 8.0.1.00200
- class CreateSpec(name=None, scope=None)
Bases:
VapiStructThe
Projects.CreateSpecclass defines the information required to create a Harbor project.Deprecated since version vSphere: API 8.0.1.00200
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:
VapiStructThe
Projects.Infoclass contains detailed information about a Harbor project.Deprecated since version vSphere: API 8.0.1.00200
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:
EnumThe
Projects.Scopeclass in a project defines access levels of the project.Deprecated since version vSphere: API 8.0.1.00200
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.
Deprecated since version vSphere: API 8.0.1.00200
- PUBLIC = Scope(string='PUBLIC')
A Harbor project can be accessed by everyone.
Deprecated since version vSphere: API 8.0.1.00200
- class Summary(project=None, name=None, scope=None)
Bases:
VapiStructThe
Projects.Summaryclass contains basic information about a Harbor project.Deprecated since version vSphere: API 8.0.1.00200
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.
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.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.- Raise:
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:Method execution requires
System.Read.The resource
com.vmware.vcenter.content.Registryreferenced by the parameterregistryrequiresSystem.Read.
- 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.
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.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.- Raise:
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:Method execution requires
System.Read.The resource
com.vmware.vcenter.content.Registryreferenced by the parameterregistryrequiresSystem.Read.The resource
com.vmware.vcenter.content.Registry.Harbor.Projectreferenced by the parameterprojectrequiresSystem.Read.
- get(registry, project)
Returns detailed information about the specified Harbor project.
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.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.- Raise:
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:Method execution requires
System.Read.The resource
com.vmware.vcenter.content.Registryreferenced by the parameterregistryrequiresSystem.Read.The resource
com.vmware.vcenter.content.Registry.Harbor.Projectreferenced by the parameterprojectrequiresSystem.Read.
- list(registry)
Returns basic information of all projects in a 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:
- 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.- Raise:
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:Method execution requires
System.Read.The resource
com.vmware.vcenter.content.Registryreferenced by the parameterregistryrequiresSystem.Read.
- 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.
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.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.- Raise:
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:Method execution requires
System.Read.The resource
com.vmware.vcenter.content.Registryreferenced by the parameterregistryrequiresSystem.Read.The resource
com.vmware.vcenter.content.Registry.Harbor.Projectreferenced by the parameterprojectrequiresSystem.Read.
- class com.vmware.vcenter.content.registries.harbor_client.StubFactory(stub_config)
Bases:
StubFactoryBaseInitialize StubFactoryBase
- Parameters:
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance