# Google Cloud Memorystore for Redis API . projects . locations . aclPolicies

## Instance Methods

Returns the revisions Resource.

Close httplib2 connections.

Creates an ACL policy. The creation is executed synchronously and the policy is available for use immediately after the RPC returns.

Deletes a specific ACL policy. This action will delete the ACL policy and all the rules associated with it. An ACL policy cannot be deleted if it is attached to a cluster.

Gets the details of a specific Redis Cluster ACL policy.

Lists all ACL policies owned by a project in either the specified location (region) or all locations. The location should have the following format: * `projects/{project_id}/locations/{location_id}` If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.

Retrieves the next page of results.

Updates the ACL policy. The operation applies the updated ACL policy to all of the linked clusters. If Memorystore can apply the policy to all clusters, then the operation returns a SUCCESS status. If Memorystore can't apply the policy to all clusters, then to ensure eventual consistency, Memorystore uses reconciliation to apply the policy to the failed clusters. Completed longrunning.Operation will contain the new ACL policy object in the response field.

### Method Details

`close()`

    Close httplib2 connections.

`create(parent, aclPolicyId=None, body=None, requestId=None, x__xgafv=None)`

    Creates an ACL policy. The creation is executed synchronously and the policy is available for use immediately after the RPC returns.

    Args:
      parent: string, Required. The resource name of the cluster location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a Google Cloud region. (required)
      body: object, The request body.
        The object takes the form of:

    { # The ACL policy resource.
      "clusterAclPolicyAttachments": [ # Output only. The ACL policy attachment status for each attached cluster.
        { # ClusterAclPolicyAttachment stores the ACL policy status for an attached cluster for the revisions successfully applied, under application or failed.
          "aclPolicyRevisionStatuses": [ # Output only. A list of status for various revisions of this ACL policy on the cluster.
            { # AclPolicyRevisionStatus stores the per-revision status for an attached cluster.
              "aclPolicyRevision": "A String", # Output only. The resource name of the ACL policy revision this status refers to. Format: "projects/{project}/locations/{location}/aclPolicies/{acl_policy}/revisions/{revision}"
              "aclPolicyRevisionNumber": "A String", # Output only. The revision number of the ACL policy revision this status refers to.
              "errorMessage": "A String", # Output only. Human-readable error message providing more details for FAILED states.
              "state": "A String", # Output only. AclPolicyRevision state.
            },
          ],
          "cluster": "A String", # Output only. The resource name of the attached Cluster. Format: "projects/{project}/locations/{location}/clusters/{cluster}"
        },
      ],
      "createTime": "A String", # Output only. The timestamp that the ACL policy was created.
      "etag": "A String", # Output only. Etag for the ACL policy.
      "name": "A String", # Identifier. Full resource path of the ACL policy.
      "rules": [ # Required. The ACL rules within the ACL policy.
        { # A single ACL rule which defines the policy for a user.
          "rule": "A String", # Required. The rule to be applied to the username. Ex: "on >password123 ~* +@all" The format of the rule is defined by Redis OSS: https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/
          "username": "A String", # Required. Specifies the IAM user or service account to be added to the ACL policy. This username will be directly set on the Redis OSS.
        },
      ],
      "state": "A String", # Output only. The state of the ACL policy.
      "updateTime": "A String", # Output only. The timestamp that the ACL policy was last updated.
      "version": "A String", # Output only. Deprecated: Used in drift resolution.
    }

      aclPolicyId: string, Required. The logical name of the ACL policy in the customer project with the following restrictions: * Must contain only lowercase letters, numbers, and hyphens. * Must start with a letter. * Must be between 1-63 characters. * Must end with a number or a letter. * Must be unique within the customer project / location
      requestId: string, Optional. Idempotent request UUID. .
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The ACL policy resource.
      "clusterAclPolicyAttachments": [ # Output only. The ACL policy attachment status for each attached cluster.
        { # ClusterAclPolicyAttachment stores the ACL policy status for an attached cluster for the revisions successfully applied, under application or failed.
          "aclPolicyRevisionStatuses": [ # Output only. A list of status for various revisions of this ACL policy on the cluster.
            { # AclPolicyRevisionStatus stores the per-revision status for an attached cluster.
              "aclPolicyRevision": "A String", # Output only. The resource name of the ACL policy revision this status refers to. Format: "projects/{project}/locations/{location}/aclPolicies/{acl_policy}/revisions/{revision}"
              "aclPolicyRevisionNumber": "A String", # Output only. The revision number of the ACL policy revision this status refers to.
              "errorMessage": "A String", # Output only. Human-readable error message providing more details for FAILED states.
              "state": "A String", # Output only. AclPolicyRevision state.
            },
          ],
          "cluster": "A String", # Output only. The resource name of the attached Cluster. Format: "projects/{project}/locations/{location}/clusters/{cluster}"
        },
      ],
      "createTime": "A String", # Output only. The timestamp that the ACL policy was created.
      "etag": "A String", # Output only. Etag for the ACL policy.
      "name": "A String", # Identifier. Full resource path of the ACL policy.
      "rules": [ # Required. The ACL rules within the ACL policy.
        { # A single ACL rule which defines the policy for a user.
          "rule": "A String", # Required. The rule to be applied to the username. Ex: "on >password123 ~* +@all" The format of the rule is defined by Redis OSS: https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/
          "username": "A String", # Required. Specifies the IAM user or service account to be added to the ACL policy. This username will be directly set on the Redis OSS.
        },
      ],
      "state": "A String", # Output only. The state of the ACL policy.
      "updateTime": "A String", # Output only. The timestamp that the ACL policy was last updated.
      "version": "A String", # Output only. Deprecated: Used in drift resolution.
    }

`delete(name, etag=None, requestId=None, x__xgafv=None)`

    Deletes a specific ACL policy. This action will delete the ACL policy and all the rules associated with it. An ACL policy cannot be deleted if it is attached to a cluster.

    Args:
      name: string, Required. Redis ACL policy resource name using the form: `projects/{project_id}/locations/{location_id}/aclPolicies/{acl_policy_id}` where `location_id` refers to a Google Cloud region. (required)
      etag: string, Optional. Etag of the ACL policy. If this is different from the server's etag, the request will fail with an ABORTED error.
      requestId: string, Optional. Idempotent request UUID.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # This resource represents a long-running operation that is the result of a network API call.
      "done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
      "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
        "code": 42, # The status code, which should be an enum value of google.rpc.Code.
        "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
          {
            "a_key": "", # Properties of the object. Contains field @type with type URL.
          },
        ],
        "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
      },
      "metadata": { # { `createTime`: The time the operation was created. `endTime`: The time the operation finished running. `target`: Server-defined resource path for the target of the operation. `verb`: Name of the verb executed by the operation. `statusDetail`: Human-readable status of the operation, if any. `cancelRequested`: Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. `apiVersion`: API version used to start the operation. }
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
      "name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
      "response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    }

`get(name, x__xgafv=None)`

    Gets the details of a specific Redis Cluster ACL policy.

    Args:
      name: string, Required. Redis ACL policy resource name using the form: `projects/{project_id}/locations/{location_id}/aclPolicies/{acl_policy_id}` where `location_id` refers to a Google Cloud region. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The ACL policy resource.
      "clusterAclPolicyAttachments": [ # Output only. The ACL policy attachment status for each attached cluster.
        { # ClusterAclPolicyAttachment stores the ACL policy status for an attached cluster for the revisions successfully applied, under application or failed.
          "aclPolicyRevisionStatuses": [ # Output only. A list of status for various revisions of this ACL policy on the cluster.
            { # AclPolicyRevisionStatus stores the per-revision status for an attached cluster.
              "aclPolicyRevision": "A String", # Output only. The resource name of the ACL policy revision this status refers to. Format: "projects/{project}/locations/{location}/aclPolicies/{acl_policy}/revisions/{revision}"
              "aclPolicyRevisionNumber": "A String", # Output only. The revision number of the ACL policy revision this status refers to.
              "errorMessage": "A String", # Output only. Human-readable error message providing more details for FAILED states.
              "state": "A String", # Output only. AclPolicyRevision state.
            },
          ],
          "cluster": "A String", # Output only. The resource name of the attached Cluster. Format: "projects/{project}/locations/{location}/clusters/{cluster}"
        },
      ],
      "createTime": "A String", # Output only. The timestamp that the ACL policy was created.
      "etag": "A String", # Output only. Etag for the ACL policy.
      "name": "A String", # Identifier. Full resource path of the ACL policy.
      "rules": [ # Required. The ACL rules within the ACL policy.
        { # A single ACL rule which defines the policy for a user.
          "rule": "A String", # Required. The rule to be applied to the username. Ex: "on >password123 ~* +@all" The format of the rule is defined by Redis OSS: https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/
          "username": "A String", # Required. Specifies the IAM user or service account to be added to the ACL policy. This username will be directly set on the Redis OSS.
        },
      ],
      "state": "A String", # Output only. The state of the ACL policy.
      "updateTime": "A String", # Output only. The timestamp that the ACL policy was last updated.
      "version": "A String", # Output only. Deprecated: Used in drift resolution.
    }

`list(parent, pageSize=None, pageToken=None, x__xgafv=None)`

    Lists all ACL policies owned by a project in either the specified location (region) or all locations. The location should have the following format: * `projects/{project_id}/locations/{location_id}` If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.

    Args:
      parent: string, Required. The resource name of the ACL policy location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a Google Cloud region. (required)
      pageSize: integer, Optional. The maximum number of items to return. If not specified, a default value of 1000 will be used by the service. Regardless of the page_size value, the response may include a partial list and a caller should only rely on response's `next_page_token` to determine if there are more ACL policies left to be queried. The maximum value is 1000; values above 1000 will be coerced to 1000.
      pageToken: string, Optional. The `next_page_token` value returned from a previous `ListAclPolicies` request, if any.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response for `ListAclPolicies`.
      "aclPolicies": [ # A list of ACL policies in the project in the specified location, or across all locations. If the `location_id` in the parent field of the request is "-", all regions available to the project are queried, and the results aggregated.
        { # The ACL policy resource.
          "clusterAclPolicyAttachments": [ # Output only. The ACL policy attachment status for each attached cluster.
            { # ClusterAclPolicyAttachment stores the ACL policy status for an attached cluster for the revisions successfully applied, under application or failed.
              "aclPolicyRevisionStatuses": [ # Output only. A list of status for various revisions of this ACL policy on the cluster.
                { # AclPolicyRevisionStatus stores the per-revision status for an attached cluster.
                  "aclPolicyRevision": "A String", # Output only. The resource name of the ACL policy revision this status refers to. Format: "projects/{project}/locations/{location}/aclPolicies/{acl_policy}/revisions/{revision}"
                  "aclPolicyRevisionNumber": "A String", # Output only. The revision number of the ACL policy revision this status refers to.
                  "errorMessage": "A String", # Output only. Human-readable error message providing more details for FAILED states.
                  "state": "A String", # Output only. AclPolicyRevision state.
                },
              ],
              "cluster": "A String", # Output only. The resource name of the attached Cluster. Format: "projects/{project}/locations/{location}/clusters/{cluster}"
            },
          ],
          "createTime": "A String", # Output only. The timestamp that the ACL policy was created.
          "etag": "A String", # Output only. Etag for the ACL policy.
          "name": "A String", # Identifier. Full resource path of the ACL policy.
          "rules": [ # Required. The ACL rules within the ACL policy.
            { # A single ACL rule which defines the policy for a user.
              "rule": "A String", # Required. The rule to be applied to the username. Ex: "on >password123 ~* +@all" The format of the rule is defined by Redis OSS: https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/
              "username": "A String", # Required. Specifies the IAM user or service account to be added to the ACL policy. This username will be directly set on the Redis OSS.
            },
          ],
          "state": "A String", # Output only. The state of the ACL policy.
          "updateTime": "A String", # Output only. The timestamp that the ACL policy was last updated.
          "version": "A String", # Output only. Deprecated: Used in drift resolution.
        },
      ],
      "nextPageToken": "A String", # Token to retrieve the next page of results, or empty if there are no more results in the list.
      "unreachable": [ # Unordered list. Locations that could not be reached.
        "A String",
      ],
    }

`list_next()`

    Retrieves the next page of results.

            Args:
              previous_request: The request for the previous page. (required)
              previous_response: The response from the request for the previous page. (required)

            Returns:
              A request object that you can call 'execute()' on to request the next
              page. Returns None if there are no more items in the collection.

`patch(name, body=None, requestId=None, updateMask=None, x__xgafv=None)`

    Updates the ACL policy. The operation applies the updated ACL policy to all of the linked clusters. If Memorystore can apply the policy to all clusters, then the operation returns a SUCCESS status. If Memorystore can't apply the policy to all clusters, then to ensure eventual consistency, Memorystore uses reconciliation to apply the policy to the failed clusters. Completed longrunning.Operation will contain the new ACL policy object in the response field.

    Args:
      name: string, Identifier. Full resource path of the ACL policy. (required)
      body: object, The request body.
        The object takes the form of:

    { # The ACL policy resource.
      "clusterAclPolicyAttachments": [ # Output only. The ACL policy attachment status for each attached cluster.
        { # ClusterAclPolicyAttachment stores the ACL policy status for an attached cluster for the revisions successfully applied, under application or failed.
          "aclPolicyRevisionStatuses": [ # Output only. A list of status for various revisions of this ACL policy on the cluster.
            { # AclPolicyRevisionStatus stores the per-revision status for an attached cluster.
              "aclPolicyRevision": "A String", # Output only. The resource name of the ACL policy revision this status refers to. Format: "projects/{project}/locations/{location}/aclPolicies/{acl_policy}/revisions/{revision}"
              "aclPolicyRevisionNumber": "A String", # Output only. The revision number of the ACL policy revision this status refers to.
              "errorMessage": "A String", # Output only. Human-readable error message providing more details for FAILED states.
              "state": "A String", # Output only. AclPolicyRevision state.
            },
          ],
          "cluster": "A String", # Output only. The resource name of the attached Cluster. Format: "projects/{project}/locations/{location}/clusters/{cluster}"
        },
      ],
      "createTime": "A String", # Output only. The timestamp that the ACL policy was created.
      "etag": "A String", # Output only. Etag for the ACL policy.
      "name": "A String", # Identifier. Full resource path of the ACL policy.
      "rules": [ # Required. The ACL rules within the ACL policy.
        { # A single ACL rule which defines the policy for a user.
          "rule": "A String", # Required. The rule to be applied to the username. Ex: "on >password123 ~* +@all" The format of the rule is defined by Redis OSS: https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/
          "username": "A String", # Required. Specifies the IAM user or service account to be added to the ACL policy. This username will be directly set on the Redis OSS.
        },
      ],
      "state": "A String", # Output only. The state of the ACL policy.
      "updateTime": "A String", # Output only. The timestamp that the ACL policy was last updated.
      "version": "A String", # Output only. Deprecated: Used in drift resolution.
    }

      requestId: string, Optional. Idempotent request UUID.
      updateMask: string, Optional. Mask of fields to be updated. At least one path must be supplied in this field. The elements of the repeated paths field may only include these fields from `AclPolicy`: * `rules`
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # This resource represents a long-running operation that is the result of a network API call.
      "done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
      "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
        "code": 42, # The status code, which should be an enum value of google.rpc.Code.
        "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
          {
            "a_key": "", # Properties of the object. Contains field @type with type URL.
          },
        ],
        "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
      },
      "metadata": { # { `createTime`: The time the operation was created. `endTime`: The time the operation finished running. `target`: Server-defined resource path for the target of the operation. `verb`: Name of the verb executed by the operation. `statusDetail`: Human-readable status of the operation, if any. `cancelRequested`: Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. `apiVersion`: API version used to start the operation. }
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
      "name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
      "response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    }