Class RestoreConfig.SubstitutionRule

  • All Implemented Interfaces:
    RestoreConfig.SubstitutionRuleOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
    Enclosing class:
    RestoreConfig

    public static final class RestoreConfig.SubstitutionRule
    extends com.google.protobuf.GeneratedMessageV3
    implements RestoreConfig.SubstitutionRuleOrBuilder
     A transformation rule to be applied against Kubernetes resources as they
     are selected for restoration from a Backup. A rule contains both filtering
     logic (which resources are subject to substitution) and substitution logic.
     
    Protobuf type google.cloud.gkebackup.v1.RestoreConfig.SubstitutionRule
    See Also:
    Serialized Form
    • Field Detail

      • TARGET_NAMESPACES_FIELD_NUMBER

        public static final int TARGET_NAMESPACES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TARGET_GROUP_KINDS_FIELD_NUMBER

        public static final int TARGET_GROUP_KINDS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TARGET_JSON_PATH_FIELD_NUMBER

        public static final int TARGET_JSON_PATH_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ORIGINAL_VALUE_PATTERN_FIELD_NUMBER

        public static final int ORIGINAL_VALUE_PATTERN_FIELD_NUMBER
        See Also:
        Constant Field Values
    • 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
      • getTargetNamespacesList

        public com.google.protobuf.ProtocolStringList getTargetNamespacesList()
         (Filtering parameter) Any resource subject to substitution must be
         contained within one of the listed Kubernetes Namespace in the Backup.
         If this field is not provided, no namespace filtering will be performed
         (all resources in all Namespaces, including all cluster-scoped resources,
         will be candidates for substitution).
         To mix cluster-scoped and namespaced resources in the same rule, use an
         empty string ("") as one of the target namespaces.
         
        repeated string target_namespaces = 1;
        Specified by:
        getTargetNamespacesList in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        A list containing the targetNamespaces.
      • getTargetNamespacesCount

        public int getTargetNamespacesCount()
         (Filtering parameter) Any resource subject to substitution must be
         contained within one of the listed Kubernetes Namespace in the Backup.
         If this field is not provided, no namespace filtering will be performed
         (all resources in all Namespaces, including all cluster-scoped resources,
         will be candidates for substitution).
         To mix cluster-scoped and namespaced resources in the same rule, use an
         empty string ("") as one of the target namespaces.
         
        repeated string target_namespaces = 1;
        Specified by:
        getTargetNamespacesCount in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The count of targetNamespaces.
      • getTargetNamespaces

        public String getTargetNamespaces​(int index)
         (Filtering parameter) Any resource subject to substitution must be
         contained within one of the listed Kubernetes Namespace in the Backup.
         If this field is not provided, no namespace filtering will be performed
         (all resources in all Namespaces, including all cluster-scoped resources,
         will be candidates for substitution).
         To mix cluster-scoped and namespaced resources in the same rule, use an
         empty string ("") as one of the target namespaces.
         
        repeated string target_namespaces = 1;
        Specified by:
        getTargetNamespaces in interface RestoreConfig.SubstitutionRuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The targetNamespaces at the given index.
      • getTargetNamespacesBytes

        public com.google.protobuf.ByteString getTargetNamespacesBytes​(int index)
         (Filtering parameter) Any resource subject to substitution must be
         contained within one of the listed Kubernetes Namespace in the Backup.
         If this field is not provided, no namespace filtering will be performed
         (all resources in all Namespaces, including all cluster-scoped resources,
         will be candidates for substitution).
         To mix cluster-scoped and namespaced resources in the same rule, use an
         empty string ("") as one of the target namespaces.
         
        repeated string target_namespaces = 1;
        Specified by:
        getTargetNamespacesBytes in interface RestoreConfig.SubstitutionRuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the targetNamespaces at the given index.
      • getTargetGroupKindsList

        public List<RestoreConfig.GroupKind> getTargetGroupKindsList()
         (Filtering parameter) Any resource subject to substitution must belong to
         one of the listed "types".
         If this field is not provided, no type filtering will be performed (all
         resources of all types matching previous filtering parameters will be
         candidates for substitution).
         
        repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2;
        Specified by:
        getTargetGroupKindsList in interface RestoreConfig.SubstitutionRuleOrBuilder
      • getTargetGroupKindsOrBuilderList

        public List<? extends RestoreConfig.GroupKindOrBuilder> getTargetGroupKindsOrBuilderList()
         (Filtering parameter) Any resource subject to substitution must belong to
         one of the listed "types".
         If this field is not provided, no type filtering will be performed (all
         resources of all types matching previous filtering parameters will be
         candidates for substitution).
         
        repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2;
        Specified by:
        getTargetGroupKindsOrBuilderList in interface RestoreConfig.SubstitutionRuleOrBuilder
      • getTargetGroupKindsCount

        public int getTargetGroupKindsCount()
         (Filtering parameter) Any resource subject to substitution must belong to
         one of the listed "types".
         If this field is not provided, no type filtering will be performed (all
         resources of all types matching previous filtering parameters will be
         candidates for substitution).
         
        repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2;
        Specified by:
        getTargetGroupKindsCount in interface RestoreConfig.SubstitutionRuleOrBuilder
      • getTargetGroupKinds

        public RestoreConfig.GroupKind getTargetGroupKinds​(int index)
         (Filtering parameter) Any resource subject to substitution must belong to
         one of the listed "types".
         If this field is not provided, no type filtering will be performed (all
         resources of all types matching previous filtering parameters will be
         candidates for substitution).
         
        repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2;
        Specified by:
        getTargetGroupKinds in interface RestoreConfig.SubstitutionRuleOrBuilder
      • getTargetGroupKindsOrBuilder

        public RestoreConfig.GroupKindOrBuilder getTargetGroupKindsOrBuilder​(int index)
         (Filtering parameter) Any resource subject to substitution must belong to
         one of the listed "types".
         If this field is not provided, no type filtering will be performed (all
         resources of all types matching previous filtering parameters will be
         candidates for substitution).
         
        repeated .google.cloud.gkebackup.v1.RestoreConfig.GroupKind target_group_kinds = 2;
        Specified by:
        getTargetGroupKindsOrBuilder in interface RestoreConfig.SubstitutionRuleOrBuilder
      • getTargetJsonPath

        public String getTargetJsonPath()
         Required. This is a [JSONPath]
         (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
         expression that matches specific fields of candidate
         resources and it operates as both a filtering parameter (resources that
         are not matched with this expression will not be candidates for
         substitution) as well as a field identifier (identifies exactly which
         fields out of the candidate resources will be modified).
         
        string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTargetJsonPath in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The targetJsonPath.
      • getTargetJsonPathBytes

        public com.google.protobuf.ByteString getTargetJsonPathBytes()
         Required. This is a [JSONPath]
         (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
         expression that matches specific fields of candidate
         resources and it operates as both a filtering parameter (resources that
         are not matched with this expression will not be candidates for
         substitution) as well as a field identifier (identifies exactly which
         fields out of the candidate resources will be modified).
         
        string target_json_path = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTargetJsonPathBytes in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The bytes for targetJsonPath.
      • getOriginalValuePattern

        public String getOriginalValuePattern()
         (Filtering parameter) This is a [regular expression]
         (https://en.wikipedia.org/wiki/Regular_expression)
         that is compared against the fields matched by the target_json_path
         expression (and must also have passed the previous filters).
         Substitution will not be performed against fields whose
         value does not match this expression. If this field is NOT specified,
         then ALL fields matched by the target_json_path expression will undergo
         substitution. Note that an empty (e.g., "", rather than unspecified)
         value for this field will only match empty fields.
         
        string original_value_pattern = 4;
        Specified by:
        getOriginalValuePattern in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The originalValuePattern.
      • getOriginalValuePatternBytes

        public com.google.protobuf.ByteString getOriginalValuePatternBytes()
         (Filtering parameter) This is a [regular expression]
         (https://en.wikipedia.org/wiki/Regular_expression)
         that is compared against the fields matched by the target_json_path
         expression (and must also have passed the previous filters).
         Substitution will not be performed against fields whose
         value does not match this expression. If this field is NOT specified,
         then ALL fields matched by the target_json_path expression will undergo
         substitution. Note that an empty (e.g., "", rather than unspecified)
         value for this field will only match empty fields.
         
        string original_value_pattern = 4;
        Specified by:
        getOriginalValuePatternBytes in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The bytes for originalValuePattern.
      • getNewValue

        public String getNewValue()
         This is the new value to set for any fields that pass the filtering and
         selection criteria. To remove a value from a Kubernetes resource, either
         leave this field unspecified, or set it to the empty string ("").
         
        string new_value = 5;
        Specified by:
        getNewValue in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The newValue.
      • getNewValueBytes

        public com.google.protobuf.ByteString getNewValueBytes()
         This is the new value to set for any fields that pass the filtering and
         selection criteria. To remove a value from a Kubernetes resource, either
         leave this field unspecified, or set it to the empty string ("").
         
        string new_value = 5;
        Specified by:
        getNewValueBytes in interface RestoreConfig.SubstitutionRuleOrBuilder
        Returns:
        The bytes for newValue.
      • 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 RestoreConfig.SubstitutionRule parseFrom​(ByteBuffer data)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

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

        public com.google.protobuf.Parser<RestoreConfig.SubstitutionRule> 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 RestoreConfig.SubstitutionRule getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder