Method: subnetworks.getIamPolicy

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

HTTP request

GET https://www.googleapis.com/compute/beta/projects/{project}/regions/{region}/subnetworks/{resourceId}/getIamPolicy

The URL uses Google API HTTP annotation syntax.

Path parameters

Parameters
project

string

Project ID for this request.

region

string

The name of the region for this request.

resourceId

string

Name of the resource for this request.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

API response containing IAM policies associated with a resource.

JSON representation
{
  "policy": {
    "version": number,
    "bindings": {
      "role": string,
      "members": [
        string
      ]
    },
    "auditConfigs": {
      "service": string,
      "auditLogConfigs": [
        {
          "logType": enum,
          "exemptedMembers": string
        }
      ]
    },
    "rules": ,
    "etag": string,
    "iamOwned": boolean
  }
}
Fields
policy

object

policy.version
(deprecated)

number

Deprecated.

policy.bindings[]

object

Associates a list of members to a role. bindings with no members will result in an error.

policy.bindings[].role

string

Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner. Required

policy.bindings[].members[]

string

Specifies the identities requesting access for a Cloud Platform resource. members can have the following values:

  • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.

  • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.

  • user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com .

  • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.

  • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.

  • domain:{domain}: A Google Apps domain name that represents all the users of that domain. For example, google.com or example.com.

policy.auditConfigs[]

object

Specifies cloud audit logging configuration for this policy.

policy.auditConfigs[].service

string

Specifies a service that will be enabled for audit logging. For example, storage.googleapis.com, cloudsql.googleapis.com. allServices is a special value that covers all services.

policy.auditConfigs[].auditLogConfigs[]

object

The configuration for logging of each type of permission.

policy.auditConfigs[].auditLogConfigs[].logType

enum

The log type that this config enables.

policy.auditConfigs[].auditLogConfigs[].exemptedMembers[]

string

Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.

policy.etag

string (bytes format)

etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy.

If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten blindly.

A base64-encoded string.

Authorization Scopes

Requires one of the following OAuth scopes:

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

For more information, see the Auth Guide.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.subnetworks.getIamPolicy
¿Te ha resultado útil esta página? Danos tu opinión:

Enviar comentarios sobre...