public sealed class AutoscalingPolicy : IMessage<AutoscalingPolicy>, IEquatable<AutoscalingPolicy>, IDeepCloneable<AutoscalingPolicy>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Dataproc v1 API class AutoscalingPolicy.
Describes an autoscaling policy for Dataproc cluster autoscaler.
The id must contain only letters (a-z, A-Z), numbers (0-9),
underscores (_), and hyphens (-). Cannot begin or end with underscore
or hyphen. Must consist of between 3 and 50 characters.
Optional. The labels to associate with this autoscaling policy.
Label keys must contain 1 to 63 characters, and must conform to
RFC 1035.
Label values may be empty, but, if present, must contain 1 to 63
characters, and must conform to RFC
1035. No more than 32 labels can be
associated with an autoscaling policy.
For projects.regions.autoscalingPolicies, the resource name of the
policy has the following format:
projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}
For projects.locations.autoscalingPolicies, the resource name of the
policy has the following format:
projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides reference documentation for the \u003ccode\u003eAutoscalingPolicy\u003c/code\u003e class within the Google Cloud Dataproc v1 API, detailing its structure, properties, and usage.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAutoscalingPolicy\u003c/code\u003e class describes how to manage autoscaling for Dataproc clusters, with features including setting policies for primary and secondary worker configurations, and applying a basic autoscaling algorithm.\u003c/p\u003e\n"],["\u003cp\u003eMultiple versions of the \u003ccode\u003eAutoscalingPolicy\u003c/code\u003e are available, ranging from the latest version 5.17.0 down to version 3.1.0, for the Google.Cloud.Dataproc.V1 API, allowing developers to select the version that best fits their project.\u003c/p\u003e\n"],["\u003cp\u003eThe class is implemented using multiple interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and it inherits from \u003ccode\u003eobject\u003c/code\u003e, as listed on this page.\u003c/p\u003e\n"],["\u003cp\u003eThe page lists all available attributes of the class, such as \u003ccode\u003eAlgorithmCase\u003c/code\u003e, \u003ccode\u003eAutoscalingPolicyName\u003c/code\u003e, \u003ccode\u003eBasicAlgorithm\u003c/code\u003e, \u003ccode\u003eId\u003c/code\u003e, \u003ccode\u003eLabels\u003c/code\u003e, \u003ccode\u003eName\u003c/code\u003e, \u003ccode\u003eSecondaryWorkerConfig\u003c/code\u003e and \u003ccode\u003eWorkerConfig\u003c/code\u003e, alongside all \u003ccode\u003eConstructors\u003c/code\u003e and \u003ccode\u003eInherited Members\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Dataproc v1 API - Class AutoscalingPolicy (5.20.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.20.0 (latest)](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.19.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.19.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.18.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.18.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.17.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.17.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.16.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.16.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.15.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.15.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.14.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.14.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.13.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.13.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.12.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.12.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.11.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.11.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.10.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.10.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.9.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.9.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.8.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.8.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.7.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.7.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.6.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.6.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.5.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.5.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.4.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.4.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.3.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.3.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.2.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.1.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/5.0.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/4.0.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.4.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.3.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.2.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/3.1.0/Google.Cloud.Dataproc.V1.AutoscalingPolicy) \n\n public sealed class AutoscalingPolicy : IMessage\u003cAutoscalingPolicy\u003e, IEquatable\u003cAutoscalingPolicy\u003e, IDeepCloneable\u003cAutoscalingPolicy\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Dataproc v1 API class AutoscalingPolicy.\n\nDescribes an autoscaling policy for Dataproc cluster autoscaler. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AutoscalingPolicy \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AutoscalingPolicy](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.AutoscalingPolicy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AutoscalingPolicy](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.AutoscalingPolicy), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AutoscalingPolicy](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.AutoscalingPolicy), [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.Dataproc.V1](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Dataproc.V1.dll\n\nConstructors\n------------\n\n### AutoscalingPolicy()\n\n public AutoscalingPolicy()\n\n### AutoscalingPolicy(AutoscalingPolicy)\n\n public AutoscalingPolicy(AutoscalingPolicy other)\n\nProperties\n----------\n\n### AlgorithmCase\n\n public AutoscalingPolicy.AlgorithmOneofCase AlgorithmCase { get; }\n\n### AutoscalingPolicyName\n\n public AutoscalingPolicyName AutoscalingPolicyName { get; set; }\n\n[AutoscalingPolicyName](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.AutoscalingPolicyName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.AutoscalingPolicy#Google_Cloud_Dataproc_V1_AutoscalingPolicy_Name) resource name property.\n\n### BasicAlgorithm\n\n public BasicAutoscalingAlgorithm BasicAlgorithm { get; set; }\n\n### Id\n\n public string Id { get; set; }\n\nRequired. The policy id.\n\nThe id must contain only letters (a-z, A-Z), numbers (0-9),\nunderscores (_), and hyphens (-). Cannot begin or end with underscore\nor hyphen. Must consist of between 3 and 50 characters.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nOptional. The labels to associate with this autoscaling policy.\nLabel **keys** must contain 1 to 63 characters, and must conform to\n[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).\nLabel **values** may be empty, but, if present, must contain 1 to 63\ncharacters, and must conform to [RFC\n1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be\nassociated with an autoscaling policy.\n\n### Name\n\n public string Name { get; set; }\n\nOutput only. The \"resource name\" of the autoscaling policy, as described\nin \u003chttps://cloud.google.com/apis/design/resource_names\u003e.\n\n- For `projects.regions.autoscalingPolicies`, the resource name of the\n policy has the following format:\n `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`\n\n- For `projects.locations.autoscalingPolicies`, the resource name of the\n policy has the following format:\n `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`\n\n### SecondaryWorkerConfig\n\n public InstanceGroupAutoscalingPolicyConfig SecondaryWorkerConfig { get; set; }\n\nOptional. Describes how the autoscaler will operate for secondary workers.\n\n### WorkerConfig\n\n public InstanceGroupAutoscalingPolicyConfig WorkerConfig { get; set; }\n\nRequired. Describes how the autoscaler will operate for primary workers."]]