Class OSPolicyAssignment

  • All Implemented Interfaces:
    OSPolicyAssignmentOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class OSPolicyAssignment
    extends com.google.protobuf.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](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies).
     
    Protobuf type google.cloud.osconfig.v1.OSPolicyAssignment
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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;
        Specified by:
        getName in interface OSPolicyAssignmentOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.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;
        Specified by:
        getNameBytes in interface OSPolicyAssignmentOrBuilder
        Returns:
        The bytes for name.
      • getDescription

        public String getDescription()
         OS policy assignment description.
         Length of the description is limited to 1024 characters.
         
        string description = 2;
        Specified by:
        getDescription in interface OSPolicyAssignmentOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public com.google.protobuf.ByteString getDescriptionBytes()
         OS policy assignment description.
         Length of the description is limited to 1024 characters.
         
        string description = 2;
        Specified by:
        getDescriptionBytes in interface OSPolicyAssignmentOrBuilder
        Returns:
        The bytes for description.
      • 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];
        Specified by:
        getOsPoliciesList in interface OSPolicyAssignmentOrBuilder
      • 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];
        Specified by:
        getOsPoliciesCount in interface OSPolicyAssignmentOrBuilder
      • getOsPolicies

        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];
        Specified by:
        getOsPolicies in interface OSPolicyAssignmentOrBuilder
      • hasInstanceFilter

        public boolean hasInstanceFilter()
         Required. Filter to select VMs.
         
        .google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter instance_filter = 4 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        hasInstanceFilter in interface OSPolicyAssignmentOrBuilder
        Returns:
        Whether the instanceFilter 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];
        Specified by:
        hasRollout in interface OSPolicyAssignmentOrBuilder
        Returns:
        Whether the rollout field is set.
      • 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];
        Specified by:
        getRollout in interface OSPolicyAssignmentOrBuilder
        Returns:
        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];
        Specified by:
        getRolloutOrBuilder in interface OSPolicyAssignmentOrBuilder
      • 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];
        Specified by:
        getRevisionId in interface OSPolicyAssignmentOrBuilder
        Returns:
        The revisionId.
      • getRevisionIdBytes

        public com.google.protobuf.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];
        Specified by:
        getRevisionIdBytes in interface OSPolicyAssignmentOrBuilder
        Returns:
        The bytes for revisionId.
      • 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];
        Specified by:
        hasRevisionCreateTime in interface OSPolicyAssignmentOrBuilder
        Returns:
        Whether the revisionCreateTime field is set.
      • getRevisionCreateTime

        public com.google.protobuf.Timestamp getRevisionCreateTime()
         Output only. The timestamp that the revision was created.
         
        .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getRevisionCreateTime in interface OSPolicyAssignmentOrBuilder
        Returns:
        The revisionCreateTime.
      • getRevisionCreateTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder()
         Output only. The timestamp that the revision was created.
         
        .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getRevisionCreateTimeOrBuilder in interface OSPolicyAssignmentOrBuilder
      • 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;
        Specified by:
        getEtag in interface OSPolicyAssignmentOrBuilder
        Returns:
        The etag.
      • getEtagBytes

        public com.google.protobuf.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;
        Specified by:
        getEtagBytes in interface OSPolicyAssignmentOrBuilder
        Returns:
        The bytes for etag.
      • 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];
        Specified by:
        getRolloutStateValue in interface OSPolicyAssignmentOrBuilder
        Returns:
        The enum numeric value on the wire for rolloutState.
      • 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];
        Specified by:
        getBaseline in interface OSPolicyAssignmentOrBuilder
        Returns:
        The baseline.
      • getDeleted

        public boolean getDeleted()
         Output only. Indicates that this revision deletes the OS policy assignment.
         
        bool deleted = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDeleted in interface OSPolicyAssignmentOrBuilder
        Returns:
        The deleted.
      • 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];
        Specified by:
        getReconciling in interface OSPolicyAssignmentOrBuilder
        Returns:
        The reconciling.
      • 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];
        Specified by:
        getUid in interface OSPolicyAssignmentOrBuilder
        Returns:
        The uid.
      • getUidBytes

        public com.google.protobuf.ByteString getUidBytes()
         Output only. Server generated unique id for the OS policy assignment
         resource.
         
        string uid = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUidBytes in interface OSPolicyAssignmentOrBuilder
        Returns:
        The bytes for uid.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static OSPolicyAssignment parseFrom​(ByteBuffer data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OSPolicyAssignment parseFrom​(ByteBuffer data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OSPolicyAssignment parseFrom​(com.google.protobuf.ByteString data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OSPolicyAssignment parseFrom​(com.google.protobuf.ByteString data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OSPolicyAssignment parseFrom​(byte[] data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OSPolicyAssignment parseFrom​(byte[] data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OSPolicyAssignment parseFrom​(com.google.protobuf.CodedInputStream input,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws IOException
        Throws:
        IOException
      • newBuilderForType

        public OSPolicyAssignment.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public OSPolicyAssignment.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected OSPolicyAssignment.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<OSPolicyAssignment> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public OSPolicyAssignment getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder