REST Resource: projects.locations.osPolicyAssignments Stay organized with collections Save and categorize content based on your preferences.
Resource: OSPolicyAssignment
OS policy assignment is an API resource that is used to apply a set of OS policies to a dynamically targeted group of Compute Engine VM instances.
An OS policy is used to define the desired state configuration for a Compute Engine VM instance through a set of configuration resources that provide capabilities such as installing or removing software packages, or executing a script.
For more information about the OS policy resource definitions and examples, seeOS policy and OS policy assignment.
| JSON representation |
|---|
{"name":string,"description":string,"osPolicies":[{object ( |
| Fields | |
|---|---|
name |
Resource name. Format: This field is ignored when you create an OS policy assignment. |
description |
OS policy assignment description. Length of the description is limited to 1024 characters. |
osPolicies[] |
Required. List of OS policies to be applied to the VMs. |
instanceFilter |
Required. Filter to select VMs. |
rollout |
Required. Rollout to deploy the OS policy assignment. A rollout is triggered in the following situations: 1) OSPolicyAssignment is created. 2) OSPolicyAssignment is updated and the update contains changes to one of the following fields: - instanceFilter - osPolicies 3) OSPolicyAssignment is deleted. |
revisionId |
Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment |
revisionCreateTime |
Output only. The timestamp that the revision was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
etag |
The etag for this OS policy assignment. If this is provided on update, it must match the server's etag. |
rolloutState |
Output only. OS policy assignment rollout state |
baseline |
Output only. Indicates that this revision has been successfully rolled out in this zone and new VMs will be assigned OS policies from this revision. For a given OS policy assignment, there is only one revision with a value of |
deleted |
Output only. Indicates that this revision deletes the OS policy assignment. |
reconciling |
Output only. Indicates that reconciliation is in progress for the revision. This value is |
uid |
Output only. Server generated unique id for the OS policy assignment resource. |
Methods | |
|---|---|
| Create an OS policy assignment. |
| Delete the OS policy assignment. |
| Retrieve an existing OS policy assignment. |
| List the OS policy assignments under the parent resource. |
| List the OS policy assignment revisions for a given OS policy assignment. |
| Update an existing OS policy assignment. |
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-11-17 UTC.