gcloud beta access-context-manager levels replace-all Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta access-context-manager levels replace-all - replace all existing access levels
- SYNOPSIS
gcloud beta access-context-manager levels replace-all[POLICY]--source-file=SOURCE_FILE[--etag=ETAG][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)Replace all existing access level in specified access policywith access levels specified in a file.- EXAMPLES
- To replace all levels within a policy, using etag:
gcloudbetaaccess-context-managerlevelsreplace-allmy-policy-number--source-file=path-to-file-containing-all-replacement-access-levels.yaml--etag=optional-latest-etag-of-policyTo replace all levels within a policy, without using etag:
gcloudbetaaccess-context-managerlevelsreplace-allmy-policy-number--source-file=path-to-file-containing-all-replacement-access-levels.yaml - POSITIONAL ARGUMENTS
- Policy resource - The access policy that contains the levels you want toreplace. This represents a Cloud resource.
- [
POLICY] - ID of the policy or fully qualified identifier for the policy.
To set the
policyattribute:- provide the argument
policyon the command line; - set the property
access_context_manager/policy; - automatically, if the current account belongs to an organization with exactlyone access policy..
- provide the argument
- [
- Policy resource - The access policy that contains the levels you want toreplace. This represents a Cloud resource.
- REQUIRED FLAGS
--source-file=SOURCE_FILE- Path to a file containing a list of access levels.
An access level file is a YAML-formatted list of access levels, which are YAMLobjects representing a Basic or Custom level as described in the API reference.For example:
-name:accessPolicies/my_policy/accessLevels/my_leveltitle:MyBasicLeveldescription:Basiclevelforfoo.basic:combiningFunction:ANDconditions:-ipSubnetworks:-192.168.100.14/24-2001:db8::/48-members-user1:user1@example.com-name:accessPolicies/my_policy/accessLevels/my_other_leveltitle:MyOtherCustomLeveldescription:Customlevelforbar.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.accessLevelsFor other versions, see:https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels
- OPTIONAL FLAGS
--etag=ETAG- An etag which specifies the version of the Access Policy. Only etags thatrepresent the latest version of the Access Policy will be accepted.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - API REFERENCE
- This command uses the
accesscontextmanager/v1API. The fulldocumentation for this API can be found at:https://cloud.google.com/access-context-manager/docs/reference/rest/ - NOTES
- This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudaccess-context-managerlevelsreplace-allgcloudalphaaccess-context-managerlevelsreplace-all
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.