public sealed class ResourceSelector : IMessage<ResourceSelector>, IEquatable<ResourceSelector>, IDeepCloneable<ResourceSelector>, IBufferMessage, IMessage
Reference documentation and code samples for the Backup for GKE v1 API class ResourceSelector.
Defines a selector to identify a single or a group of resources.
Conditions in the selector are optional, but at least one field
should be set to a non-empty value. If a condition is not specified,
no restrictions will be applied on that dimension.
If more than one condition is specified, a resource will be selected
if and only if all conditions are met.
Optional. Selects resources using Kubernetes
labels.
If specified, a resource will be selected if and only if the resource
has all of the provided labels and all the label values match.
Optional. Selects resources using their namespaces. This only applies to
namespace scoped resources and cannot be used for selecting
cluster scoped resources. If specified, only resources in the provided
namespace will be selected. If not specified, the filter will apply to
both cluster scoped and namespace scoped resources (e.g. name or label).
The Namespace resource
itself will be restored if and only if any resources within the namespace
are restored.
[[["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\u003eThe \u003ccode\u003eResourceSelector\u003c/code\u003e class in the Google Cloud GKE Backup v1 API defines criteria for selecting individual or groups of resources for backup or restore operations.\u003c/p\u003e\n"],["\u003cp\u003eVersion 2.6.0 is the latest available version of the \u003ccode\u003eResourceSelector\u003c/code\u003e class, with older versions from 2.5.0 down to 1.0.0-beta01 available as well.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows filtering resources by \u003ccode\u003eGroupKind\u003c/code\u003e, \u003ccode\u003eLabels\u003c/code\u003e, \u003ccode\u003eName\u003c/code\u003e, and \u003ccode\u003eNamespace\u003c/code\u003e, and if multiple criteria are specified, a resource must meet all of them to be selected.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eResourceSelector\u003c/code\u003e class inherits from \u003ccode\u003eobject\u003c/code\u003e and implements \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e interfaces.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes constructors to create new instances, either empty or by copying another, and defines properties for setting filtering criteria.\u003c/p\u003e\n"]]],[],null,["# Backup for GKE v1 API - Class ResourceSelector (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.ResourceSelector)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.7.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.6.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.5.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.4.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.3.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.2.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.1.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/2.0.0/Google.Cloud.GkeBackup.V1.ResourceSelector)\n- [1.0.0-beta01](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/1.0.0-beta01/Google.Cloud.GkeBackup.V1.ResourceSelector) \n\n public sealed class ResourceSelector : IMessage\u003cResourceSelector\u003e, IEquatable\u003cResourceSelector\u003e, IDeepCloneable\u003cResourceSelector\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Backup for GKE v1 API class ResourceSelector.\n\nDefines a selector to identify a single or a group of resources.\nConditions in the selector are optional, but at least one field\nshould be set to a non-empty value. If a condition is not specified,\nno restrictions will be applied on that dimension.\nIf more than one condition is specified, a resource will be selected\nif and only if all conditions are met. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ResourceSelector \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ResourceSelector](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.ResourceSelector), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ResourceSelector](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.ResourceSelector), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ResourceSelector](/dotnet/docs/reference/Google.Cloud.GkeBackup.V1/latest/Google.Cloud.GkeBackup.V1.ResourceSelector), [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### ResourceSelector()\n\n public ResourceSelector()\n\n### ResourceSelector(ResourceSelector)\n\n public ResourceSelector(ResourceSelector other)\n\nProperties\n----------\n\n### GroupKind\n\n public RestoreConfig.Types.GroupKind GroupKind { get; set; }\n\nOptional. Selects resources using their Kubernetes GroupKinds. If\nspecified, only resources of provided GroupKind will be selected.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nOptional. Selects resources using Kubernetes\n[labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/).\nIf specified, a resource will be selected if and only if the resource\nhas all of the provided labels and all the label values match.\n\n### Name\n\n public string Name { get; set; }\n\nOptional. Selects resources using their resource names. If specified,\nonly resources with the provided name will be selected.\n\n### Namespace\n\n public string Namespace { get; set; }\n\nOptional. Selects resources using their namespaces. This only applies to\nnamespace scoped resources and cannot be used for selecting\ncluster scoped resources. If specified, only resources in the provided\nnamespace will be selected. If not specified, the filter will apply to\nboth cluster scoped and namespace scoped resources (e.g. name or label).\nThe [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace) resource\nitself will be restored if and only if any resources within the namespace\nare restored."]]