public sealed class RestoreConfig.Types.SubstitutionRule : IMessage<RestoreConfig.Types.SubstitutionRule>, IEquatable<RestoreConfig.Types.SubstitutionRule>, IDeepCloneable<RestoreConfig.Types.SubstitutionRule>, IBufferMessage, IMessage
Reference documentation and code samples for the Backup for GKE v1 API class RestoreConfig.Types.SubstitutionRule.
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.
Optional. 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 ("").
Optional. (Filtering parameter) This is a 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.
public RepeatedField<RestoreConfig.Types.GroupKind> TargetGroupKinds { get; }
Optional. (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).
Required. This is a 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).
public RepeatedField<string> TargetNamespaces { get; }
Optional. (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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis page provides reference documentation for the \u003ccode\u003eRestoreConfig.Types.SubstitutionRule\u003c/code\u003e class within the Backup for GKE v1 API, which is used to transform Kubernetes resources during restoration.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSubstitutionRule\u003c/code\u003e class allows for defining filtering and substitution logic to modify resources as they are restored from a Backup, offering control over the transformation process.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers various filtering options such as \u003ccode\u003eTargetGroupKinds\u003c/code\u003e, \u003ccode\u003eTargetNamespaces\u003c/code\u003e, \u003ccode\u003eOriginalValuePattern\u003c/code\u003e and \u003ccode\u003eTargetJsonPath\u003c/code\u003e to identify specific resources and fields to modify.\u003c/p\u003e\n"],["\u003cp\u003eThere are multiple versions of the \u003ccode\u003eRestoreConfig.Types.SubstitutionRule\u003c/code\u003e available, with the latest being version 2.6.0, and ranging as low as 1.0.0-beta01.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, with inheritance from \u003ccode\u003eobject\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Backup for GKE v1 API - Class RestoreConfig.Types.SubstitutionRule (2.8.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.8.0 (latest)](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.7.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.6.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.5.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.4.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.3.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.2.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.1.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.0.0/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule)\n- [1.0.0-beta01](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/1.0.0-beta01/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule) \n\n public sealed class RestoreConfig.Types.SubstitutionRule : IMessage\u003cRestoreConfig.Types.SubstitutionRule\u003e, IEquatable\u003cRestoreConfig.Types.SubstitutionRule\u003e, IDeepCloneable\u003cRestoreConfig.Types.SubstitutionRule\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Backup for GKE v1 API class RestoreConfig.Types.SubstitutionRule.\n\nA transformation rule to be applied against Kubernetes resources as they\nare selected for restoration from a Backup. A rule contains both filtering\nlogic (which resources are subject to substitution) and substitution logic. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e RestoreConfig.Types.SubstitutionRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[RestoreConfig](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig)[Types](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types)[SubstitutionRule](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[RestoreConfig](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig)[Types](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types)[SubstitutionRule](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[RestoreConfig](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig)[Types](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types)[SubstitutionRule](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.RestoreConfig.Types.SubstitutionRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.GkeBackup.V1](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.GkeBackup.V1.dll\n\nConstructors\n------------\n\n### SubstitutionRule()\n\n public SubstitutionRule()\n\n### SubstitutionRule(SubstitutionRule)\n\n public SubstitutionRule(RestoreConfig.Types.SubstitutionRule other)\n\nProperties\n----------\n\n### NewValue\n\n public string NewValue { get; set; }\n\nOptional. This is the new value to set for any fields that pass the\nfiltering and selection criteria. To remove a value from a Kubernetes\nresource, either leave this field unspecified, or set it to the empty\nstring (\"\").\n\n### OriginalValuePattern\n\n public string OriginalValuePattern { get; set; }\n\nOptional. (Filtering parameter) This is a [regular expression](https://en.wikipedia.org/wiki/Regular_expression)\nthat is compared against the fields matched by the target_json_path\nexpression (and must also have passed the previous filters).\nSubstitution will not be performed against fields whose\nvalue does not match this expression. If this field is NOT specified,\nthen ALL fields matched by the target_json_path expression will undergo\nsubstitution. Note that an empty (e.g., \"\", rather than unspecified)\nvalue for this field will only match empty fields.\n\n### TargetGroupKinds\n\n public RepeatedField\u003cRestoreConfig.Types.GroupKind\u003e TargetGroupKinds { get; }\n\nOptional. (Filtering parameter) Any resource subject to substitution must\nbelong to one of the listed \"types\". If this field is not provided, no\ntype filtering will be performed (all resources of all types matching\nprevious filtering parameters will be candidates for substitution).\n\n### TargetJsonPath\n\n public string TargetJsonPath { get; set; }\n\nRequired. This is a [JSONPath](https://kubernetes.io/docs/reference/kubectl/jsonpath/)\nexpression that matches specific fields of candidate\nresources and it operates as both a filtering parameter (resources that\nare not matched with this expression will not be candidates for\nsubstitution) as well as a field identifier (identifies exactly which\nfields out of the candidate resources will be modified).\n\n### TargetNamespaces\n\n public RepeatedField\u003cstring\u003e TargetNamespaces { get; }\n\nOptional. (Filtering parameter) Any resource subject to substitution must\nbe contained within one of the listed Kubernetes Namespace in the Backup.\nIf this field is not provided, no namespace filtering will be performed\n(all resources in all Namespaces, including all cluster-scoped resources,\nwill be candidates for substitution).\nTo mix cluster-scoped and namespaced resources in the same rule, use an\nempty string (\"\") as one of the target namespaces."]]