Class OSPolicyAssignment (2.48.0)

public final class OSPolicyAssignment extends GeneratedMessageV3 implements OSPolicyAssignmentOrBuilder

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.

Protobuf type google.cloud.osconfig.v1.OSPolicyAssignment

Static Fields

BASELINE_FIELD_NUMBER

public static final int BASELINE_FIELD_NUMBER
Field Value
Type Description
int

DELETED_FIELD_NUMBER

public static final int DELETED_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

INSTANCE_FILTER_FIELD_NUMBER

public static final int INSTANCE_FILTER_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

OS_POLICIES_FIELD_NUMBER

public static final int OS_POLICIES_FIELD_NUMBER
Field Value
Type Description
int

RECONCILING_FIELD_NUMBER

public static final int RECONCILING_FIELD_NUMBER
Field Value
Type Description
int

REVISION_CREATE_TIME_FIELD_NUMBER

public static final int REVISION_CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

REVISION_ID_FIELD_NUMBER

public static final int REVISION_ID_FIELD_NUMBER
Field Value
Type Description
int

ROLLOUT_FIELD_NUMBER

public static final int ROLLOUT_FIELD_NUMBER
Field Value
Type Description
int

ROLLOUT_STATE_FIELD_NUMBER

public static final int ROLLOUT_STATE_FIELD_NUMBER
Field Value
Type Description
int

UID_FIELD_NUMBER

public static final int UID_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static OSPolicyAssignment getDefaultInstance()
Returns
Type Description
OSPolicyAssignment

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static OSPolicyAssignment.Builder newBuilder()
Returns
Type Description
OSPolicyAssignment.Builder

newBuilder(OSPolicyAssignment prototype)

public static OSPolicyAssignment.Builder newBuilder(OSPolicyAssignment prototype)
Parameter
Name Description
prototype OSPolicyAssignment
Returns
Type Description
OSPolicyAssignment.Builder

parseDelimitedFrom(InputStream input)

public static OSPolicyAssignment parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OSPolicyAssignment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static OSPolicyAssignment parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static OSPolicyAssignment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static OSPolicyAssignment parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static OSPolicyAssignment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static OSPolicyAssignment parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static OSPolicyAssignment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static OSPolicyAssignment parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OSPolicyAssignment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static OSPolicyAssignment parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static OSPolicyAssignment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OSPolicyAssignment
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<OSPolicyAssignment> parser()
Returns
Type Description
Parser<OSPolicyAssignment>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getBaseline()

public boolean 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.

bool baseline = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The baseline.

getDefaultInstanceForType()

public OSPolicyAssignment getDefaultInstanceForType()
Returns
Type Description
OSPolicyAssignment

getDeleted()

public boolean getDeleted()

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

bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The deleted.

getDescription()

public String getDescription()

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

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

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

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getEtag()

public String getEtag()

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

string etag = 8;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

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

string etag = 8;

Returns
Type Description
ByteString

The bytes for etag.

getInstanceFilter()

public OSPolicyAssignment.InstanceFilter getInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.InstanceFilter

The instanceFilter.

getInstanceFilterOrBuilder()

public OSPolicyAssignment.InstanceFilterOrBuilder getInstanceFilterOrBuilder()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.InstanceFilterOrBuilder

getName()

public String 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.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Resource name.

Format: projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}

This field is ignored when you create an OS policy assignment.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getOsPolicies(int index)

public OSPolicy getOsPolicies(int index)

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

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicy

getOsPoliciesCount()

public int getOsPoliciesCount()

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

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getOsPoliciesList()

public List<OSPolicy> getOsPoliciesList()

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

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<OSPolicy>

getOsPoliciesOrBuilder(int index)

public OSPolicyOrBuilder getOsPoliciesOrBuilder(int index)

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

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicyOrBuilder

getOsPoliciesOrBuilderList()

public List<? extends OSPolicyOrBuilder> getOsPoliciesOrBuilderList()

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

repeated .google.cloud.osconfig.v1.OSPolicy os_policies = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.cloud.osconfig.v1.OSPolicyOrBuilder>

getParserForType()

public Parser<OSPolicyAssignment> getParserForType()
Returns
Type Description
Parser<OSPolicyAssignment>
Overrides

getReconciling()

public boolean 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

bool reconciling = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The reconciling.

getRevisionCreateTime()

public Timestamp getRevisionCreateTime()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The revisionCreateTime.

getRevisionCreateTimeOrBuilder()

public TimestampOrBuilder getRevisionCreateTimeOrBuilder()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getRevisionId()

public String getRevisionId()

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

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The revisionId.

getRevisionIdBytes()

public ByteString getRevisionIdBytes()

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

string revision_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for revisionId.

getRollout()

public OSPolicyAssignment.Rollout 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.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.Rollout

The rollout.

getRolloutOrBuilder()

public OSPolicyAssignment.RolloutOrBuilder getRolloutOrBuilder()

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.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicyAssignment.RolloutOrBuilder

getRolloutState()

public OSPolicyAssignment.RolloutState getRolloutState()

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
OSPolicyAssignment.RolloutState

The rolloutState.

getRolloutStateValue()

public int getRolloutStateValue()

Output only. OS policy assignment rollout state

.google.cloud.osconfig.v1.OSPolicyAssignment.RolloutState rollout_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for rolloutState.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUid()

public String getUid()

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

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The uid.

getUidBytes()

public ByteString getUidBytes()

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

string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for uid.

hasInstanceFilter()

public boolean hasInstanceFilter()

Required. Filter to select VMs.

.google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the instanceFilter field is set.

hasRevisionCreateTime()

public boolean hasRevisionCreateTime()

Output only. The timestamp that the revision was created.

.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the revisionCreateTime field is set.

hasRollout()

public boolean hasRollout()

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.

.google.cloud.osconfig.v1.OSPolicyAssignment.Rollout rollout = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the rollout field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public OSPolicyAssignment.Builder newBuilderForType()
Returns
Type Description
OSPolicyAssignment.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected OSPolicyAssignment.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
OSPolicyAssignment.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public OSPolicyAssignment.Builder toBuilder()
Returns
Type Description
OSPolicyAssignment.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException