Method: projects.locations.instances.keyRings.create

Creates a new KeyRing in an instance. The server assigns the KeyRing ID.

The KeyPolicy is provided in keyRing.key_policy and is created together with the KeyRing.

Returns the following error codes:

  • INVALID_ARGUMENT: keyRing.key_policy is missing or malformed. For example, a threshold is out of range, a PolicyNode is nested below the second level, or a policyNodeId is repeated.
  • FAILED_PRECONDITION: A Team or User referenced by the KeyPolicy does not exist in the instance, or a User in a UserNode does not have the SIGNER role.

HTTP request

POST https://mpc.googleapis.com/v1beta/{parent=projects/*/locations/*/instances/*}/keyRings

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The parent instance where the KeyRing will be created. Format: projects/{project}/locations/{location}/instances/{instance} It takes the form projects/{project}/locations/{location}/instances/{instance}.

Query parameters

Parameters
requestId

string

Optional. An idempotency key. Because KeyRing IDs are server-generated, a client must set this to retry a create safely. If a request with the same requestId was already completed, the server returns the KeyRing it created.

Must be a UUID4 and not the zero UUID.

Request body

The request body contains an instance of KeyRing.

Response body

If successful, the response body contains a newly created instance of KeyRing.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.