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
Static Fields
ALLOW_NO_RESOURCE_GROUP_MATCH_FIELD_NUMBER
public static final int ALLOW_NO_RESOURCE_GROUP_MATCH_FIELD_NUMBER
Field Value
DESCRIPTION_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
Field Value
ID_FIELD_NUMBER
public static final int ID_FIELD_NUMBER
Field Value
MODE_FIELD_NUMBER
public static final int MODE_FIELD_NUMBER
Field Value
RESOURCE_GROUPS_FIELD_NUMBER
public static final int RESOURCE_GROUPS_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static OSPolicy getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static OSPolicy.Builder newBuilder()
Returns
newBuilder(OSPolicy prototype)
public static OSPolicy.Builder newBuilder(OSPolicy prototype)
Parameter
Returns
public static OSPolicy parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static OSPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static OSPolicy parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static OSPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static OSPolicy parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static OSPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static OSPolicy parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static OSPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static OSPolicy parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static OSPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static OSPolicy parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static OSPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<OSPolicy> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
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
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()
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
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
getMode()
public OSPolicy.Mode getMode()
Required. Policy mode
.google.cloud.osconfig.v1.OSPolicy.Mode mode = 3 [(.google.api.field_behavior) = REQUIRED];
Returns
getModeValue()
public int getModeValue()
Required. Policy mode
.google.cloud.osconfig.v1.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
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
Returns
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
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
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
Returns
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
Type | Description |
List<? extends com.google.cloud.osconfig.v1.OSPolicy.ResourceGroupOrBuilder> | |
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public OSPolicy.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected OSPolicy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public OSPolicy.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions