Google Cloud OsConfig V1 Client - Class OSPolicyAssignment (1.3.0)

Reference documentation and code samples for the Google Cloud OsConfig V1 Client class 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, see OS policy and OS policy assignment.

Generated from protobuf message google.cloud.osconfig.v1.OSPolicyAssignment

Namespace

Google \ Cloud \ OsConfig \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

Resource name. Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id} This field is ignored when you create an OS policy assignment.

↳ description string

OS policy assignment description. Length of the description is limited to 1024 characters.

↳ os_policies array<Google\Cloud\OsConfig\V1\OSPolicy>

Required. List of OS policies to be applied to the VMs.

↳ instance_filter Google\Cloud\OsConfig\V1\OSPolicyAssignment\InstanceFilter

Required. Filter to select VMs.

↳ rollout Google\Cloud\OsConfig\V1\OSPolicyAssignment\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: - instance_filter - os_policies 3) OSPolicyAssignment is deleted.

↳ revision_id string

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

↳ revision_create_time Google\Protobuf\Timestamp

Output only. The timestamp that the revision was created.

↳ etag string

The etag for this OS policy assignment. If this is provided on update, it must match the server's etag.

↳ rollout_state int

Output only. OS policy assignment rollout state

↳ baseline bool

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 true for this field.

↳ deleted bool

Output only. Indicates that this revision deletes the OS policy assignment.

↳ reconciling bool

Output only. Indicates that reconciliation is in progress for the revision. This value is true when the rollout_state is one of: * IN_PROGRESS * CANCELLING

↳ uid string

Output only. Server generated unique id for the OS policy assignment resource.

getName

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id} This field is ignored when you create an OS policy assignment.

Returns
TypeDescription
string

setName

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id} This field is ignored when you create an OS policy assignment.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

OS policy assignment description.

Length of the description is limited to 1024 characters.

Returns
TypeDescription
string

setDescription

OS policy assignment description.

Length of the description is limited to 1024 characters.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getOsPolicies

Required. List of OS policies to be applied to the VMs.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setOsPolicies

Required. List of OS policies to be applied to the VMs.

Parameter
NameDescription
var array<Google\Cloud\OsConfig\V1\OSPolicy>
Returns
TypeDescription
$this

getInstanceFilter

Required. Filter to select VMs.

Returns
TypeDescription
Google\Cloud\OsConfig\V1\OSPolicyAssignment\InstanceFilter|null

hasInstanceFilter

clearInstanceFilter

setInstanceFilter

Required. Filter to select VMs.

Parameter
NameDescription
var Google\Cloud\OsConfig\V1\OSPolicyAssignment\InstanceFilter
Returns
TypeDescription
$this

getRollout

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:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.
Returns
TypeDescription
Google\Cloud\OsConfig\V1\OSPolicyAssignment\Rollout|null

hasRollout

clearRollout

setRollout

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:

  • instance_filter
  • os_policies 3) OSPolicyAssignment is deleted.
Parameter
NameDescription
var Google\Cloud\OsConfig\V1\OSPolicyAssignment\Rollout
Returns
TypeDescription
$this

getRevisionId

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

Returns
TypeDescription
string

setRevisionId

Output only. The assignment revision ID A new revision is committed whenever a rollout is triggered for a OS policy assignment

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRevisionCreateTime

Output only. The timestamp that the revision was created.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasRevisionCreateTime

clearRevisionCreateTime

setRevisionCreateTime

Output only. The timestamp that the revision was created.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getEtag

The etag for this OS policy assignment.

If this is provided on update, it must match the server's etag.

Returns
TypeDescription
string

setEtag

The etag for this OS policy assignment.

If this is provided on update, it must match the server's etag.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRolloutState

Output only. OS policy assignment rollout state

Returns
TypeDescription
int

setRolloutState

Output only. OS policy assignment rollout state

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getBaseline

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 true for this field.

Returns
TypeDescription
bool

setBaseline

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 true for this field.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getDeleted

Output only. Indicates that this revision deletes the OS policy assignment.

Returns
TypeDescription
bool

setDeleted

Output only. Indicates that this revision deletes the OS policy assignment.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getReconciling

Output only. Indicates that reconciliation is in progress for the revision.

This value is true when the rollout_state is one of:

  • IN_PROGRESS
  • CANCELLING
Returns
TypeDescription
bool

setReconciling

Output only. Indicates that reconciliation is in progress for the revision.

This value is true when the rollout_state is one of:

  • IN_PROGRESS
  • CANCELLING
Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getUid

Output only. Server generated unique id for the OS policy assignment resource.

Returns
TypeDescription
string

setUid

Output only. Server generated unique id for the OS policy assignment resource.

Parameter
NameDescription
var string
Returns
TypeDescription
$this