gcloud compute instances ops-agents policies update POLICY_ID --file=FILE --zone=ZONE [GCLOUD_WIDE_FLAG …]
gcloud compute instances ops-agents policies update modifies a
policy that facilitates agent management across Compute Engine instances based
on user specified instance filters. This policy installs, specifies versioning,
and removes Ops Agents.
The command returns the content of the modified policy or an error indicating
why the modification fails. The modified policy takes effect asynchronously. It
can take 10-15 minutes for the VMs to enforce the newly modified policy.
gcloud compute instances ops-agents policies update agent-policy --project=PROJECT --zone=ZONE --file=config.yamlPOLICY_ID--file=FILE--zone=ZONE--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 help for details.
gcloud alpha compute instances ops-agents policies updategcloud beta compute instances ops-agents policies updategcloud preview compute instances ops-agents policies update
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.