v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1352032.6 KB
policies

Creates a policy.

post/v2/{+parent}

Path parameters

parentstring required

Required. The resource that the policy is attached to, along with the kind of policy to create. Format: policies/{attachment_point}/denypolicies The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies. For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.

Query parameters

policyIdstring

The ID to use for this policy, which will become the final component of the policy's resource name. The ID must contain 3 to 63 characters. It can contain lowercase letters and numbers, as well as dashes (-) and periods (.). The first character must be a lowercase letter.

Request body

createTimestring google-datetime

Output only. The time when the Policy was created.

uidstring

Immutable. The globally unique ID of the Policy. Assigned automatically when the Policy is created.

displayNamestring

A user-specified description of the Policy. This value can be up to 63 characters.

updateTimestring google-datetime

Output only. The time when the Policy was last updated.

etagstring

An opaque tag that identifies the current version of the Policy. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another. If this field is present in a CreatePolicyRequest, the value is ignored.

annotationsobject

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

kindstring

Output only. The kind of the Policy. Always contains the value DenyPolicy.

deleteTimestring google-datetime

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

namestring

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id} The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy. For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

Response

Successful response