Class OSPolicy (2.13.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.v1.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
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
TypeDescription
int

MODE_FIELD_NUMBER

public static final int MODE_FIELD_NUMBER
Field Value
TypeDescription
int

RESOURCE_GROUPS_FIELD_NUMBER

public static final int RESOURCE_GROUPS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static OSPolicy getDefaultInstance()
Returns
TypeDescription
OSPolicy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static OSPolicy.Builder newBuilder()
Returns
TypeDescription
OSPolicy.Builder

newBuilder(OSPolicy prototype)

public static OSPolicy.Builder newBuilder(OSPolicy prototype)
Parameter
NameDescription
prototypeOSPolicy
Returns
TypeDescription
OSPolicy.Builder

parseDelimitedFrom(InputStream input)

public static OSPolicy parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OSPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static OSPolicy parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static OSPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static OSPolicy parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static OSPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static OSPolicy parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static OSPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static OSPolicy parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static OSPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static OSPolicy parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static OSPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OSPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<OSPolicy> parser()
Returns
TypeDescription
Parser<OSPolicy>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
boolean

The allowNoResourceGroupMatch.

getDefaultInstanceForType()

public OSPolicy getDefaultInstanceForType()
Returns
TypeDescription
OSPolicy

getDescription()

public String getDescription()

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

string description = 2;

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

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

string description = 2;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for id.

getMode()

public OSPolicy.Mode getMode()

Required. Policy mode

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

Returns
TypeDescription
OSPolicy.Mode

The mode.

getModeValue()

public int getModeValue()

Required. Policy mode

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

Returns
TypeDescription
int

The enum numeric value on the wire for mode.

getParserForType()

public Parser<OSPolicy> getParserForType()
Returns
TypeDescription
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.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
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.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
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.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v1.OSPolicy.ResourceGroup resource_groups = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<? extends com.google.cloud.osconfig.v1.OSPolicy.ResourceGroupOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public OSPolicy.Builder newBuilderForType()
Returns
TypeDescription
OSPolicy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected OSPolicy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
OSPolicy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public OSPolicy.Builder toBuilder()
Returns
TypeDescription
OSPolicy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException