Class OSPolicy (2.47.0)

public final class OSPolicy extends GeneratedMessageV3 implements OSPolicyOrBuilder

An OS policy defines the desired state configuration for a VM.

Protobuf type google.cloud.osconfig.v1alpha.OSPolicy

Implements

OSPolicyOrBuilder

Static Fields

ALLOW_NO_RESOURCE_GROUP_MATCH_FIELD_NUMBER

public static final int ALLOW_NO_RESOURCE_GROUP_MATCH_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

MODE_FIELD_NUMBER

public static final int MODE_FIELD_NUMBER
Field Value
Type Description
int

RESOURCE_GROUPS_FIELD_NUMBER

public static final int RESOURCE_GROUPS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static OSPolicy getDefaultInstance()
Returns
Type Description
OSPolicy

getDescriptor()

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

newBuilder()

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

newBuilder(OSPolicy prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

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

getAllowNoResourceGroupMatch()

public boolean getAllowNoResourceGroupMatch()

This flag determines the OS policy compliance status when none of the resource groups within the policy are applicable for a VM. Set this value to true if the policy needs to be reported as compliant even if the policy has nothing to validate or enforce.

bool allow_no_resource_group_match = 5;

Returns
Type Description
boolean

The allowNoResourceGroupMatch.

getDefaultInstanceForType()

public OSPolicy getDefaultInstanceForType()
Returns
Type Description
OSPolicy

getDescription()

public String getDescription()

Policy description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Policy description. Length of the description is limited to 1024 characters.

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getId()

public String getId()

Required. The id of the OS policy with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the assignment.

string id = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The id.

getIdBytes()

public ByteString getIdBytes()

Required. The id of the OS policy with the following restrictions:

  • Must contain only lowercase letters, numbers, and hyphens.
  • Must start with a letter.
  • Must be between 1-63 characters.
  • Must end with a number or a letter.
  • Must be unique within the assignment.

string id = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for id.

getMode()

public OSPolicy.Mode getMode()

Required. Policy mode

.google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OSPolicy.Mode

The mode.

getModeValue()

public int getModeValue()

Required. Policy mode

.google.cloud.osconfig.v1alpha.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for mode.

getParserForType()

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

getResourceGroups(int index)

public OSPolicy.ResourceGroup getResourceGroups(int index)

Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored.

If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicy.ResourceGroup

getResourceGroupsCount()

public int getResourceGroupsCount()

Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored.

If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getResourceGroupsList()

public List<OSPolicy.ResourceGroup> getResourceGroupsList()

Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored.

If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<ResourceGroup>

getResourceGroupsOrBuilder(int index)

public OSPolicy.ResourceGroupOrBuilder getResourceGroupsOrBuilder(int index)

Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored.

If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
OSPolicy.ResourceGroupOrBuilder

getResourceGroupsOrBuilderList()

public List<? extends OSPolicy.ResourceGroupOrBuilder> getResourceGroupsOrBuilderList()

Required. List of resource groups for the policy. For a particular VM, resource groups are evaluated in the order specified and the first resource group that is applicable is selected and the rest are ignored.

If none of the resource groups are applicable for a VM, the VM is considered to be non-compliant w.r.t this policy. This behavior can be toggled by the flag allow_no_resource_group_match

repeated .google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.cloud.osconfig.v1alpha.OSPolicy.ResourceGroupOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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 OSPolicy.Builder newBuilderForType()
Returns
Type Description
OSPolicy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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