Create Registries Harbor Projects
Released in v7.0.0Creates 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 operation should not be called.
Request
URLURL
https://{api_host}/rest/vcenter/content/registries/harbor/{registry}/projects
Parameters
Parameters
string
registry
Required
Identifier of the Registry.
The parameter must be an identifier for the resource type: com.vmware.vcenter.content.Registry.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id Example
b00db39f948d13ea1e59b4d6fce56389
Request Body
Request Body
ContentRegistriesHarborProjectsCreateRequestBody of type application/json (required){
"spec": {
"name": "string",
"scope": "enum"
}
}
spec
Required
Information used to create the Harbor project.
Response
Response
Response BodyResponse Body
200 OK returns
ContentRegistriesHarborProjectsCreateResponseBody
of type application/json
Identifier of the newly created Harbor project. The result will be an identifier for the resource type: com.vmware.vcenter.content.Registry.Harbor.Project.
{
"value": "string"
}
string
value
Optional
Identifier of the newly created Harbor project. The result will be an identifier for the resource type: com.vmware.vcenter.content.Registry.Harbor.Project.
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{"spec":{"name":"string","scope":"enum"}}' https://{api_host}/rest/vcenter/content/registries/harbor/{registry}/projects
Errors
401
com.vmware.vapi.std.errors.unauthenticated : if the user can not be authenticated. | com.vmware.vapi.std.errors.unauthorized : if the user does not have ContentLibrary.ManageRegistryProject privilege.
404
com.vmware.vapi.std.errors.not_found : if a registry specified by registry could not be found. | com.vmware.vapi.std.errors.error : if the system reports an error while responding to the request.
409
com.vmware.vapi.std.errors.not_allowed_in_current_state : if Harbor registry is being deleted. | com.vmware.vapi.std.errors.already_exists : if 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.
default
'Default' means this response is used for all HTTP codes that are not covered individually for this operation.