REST API - create

vcenter namespaces access: create

Set up access control for the subject on given domain on the namespace.

Request:

HTTP request

POST https://{server}/api/vcenter/namespaces/instances/{namespace}/access/{domain}/{subject}

?type={value}
{
    "role""EDIT"
}

Path Parameters

Name Type Description
Required
namespace string Identifier for the namespace.
domain string The domain of the subject.
subject string The principal for this operation.

Body Parameters:

Name Type Description
bold = required
- create_spec Information about the access control to be created.
-.role string Role to be assigned.

Lists the default roles which can be associated with a subject on a domain on the namespace. Value is one of:
EDIT: This role allows modification of the namespace.
VIEW: This is a read-only role on the namespace.

Query Parameters:

Name Type Description
bold = required
type string Lists the types of subjects who can be associated with a role on the namespace. Value is one of:
USER: Single user.
GROUP: Group of users.The type of subject (user or group).

Response:

HTTP Status Code: 204

Headers:

None

Type:

None

Errors:

HTTP Status Code Type Description
400 already_exists if the specified principal on given domain is already associated with a role on the namespace.
500 error if the system reports an error while responding to the request.
400 not_allowed_in_current_state if the namespace is marked for deletion or the associated cluster is being disabled.
404 not_found if namespace cannot be located.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user does not have Namespaces.Configure privilege or the namespace identifier begins with "vmware-system" prefix.