Reference documentation and code samples for the Google Cloud Dataproc V1 Client class AutoscalingPolicy.
Describes an autoscaling policy for Dataproc cluster autoscaler.
Generated from protobuf messagegoogle.cloud.dataproc.v1.AutoscalingPolicy
Namespace
Google \ Cloud \ Dataproc \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ id
string
Required. The policy id. 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.
↳ name
string
Output only. The "resource name" of the autoscaling policy, as described inhttps://cloud.google.com/apis/design/resource_names. * Forprojects.regions.autoscalingPolicies, the resource name of the policy has the following format:projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}* Forprojects.locations.autoscalingPolicies, the resource name of the policy has the following format:projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
Optional. The labels to associate with this autoscaling policy. Labelkeysmust contain 1 to 63 characters, and must conform toRFC 1035. Labelvaluesmay be empty, but, if present, must contain 1 to 63 characters, and must conform toRFC 1035. No more than 32 labels can be associated with an autoscaling policy.
getId
Required. The policy id.
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.
Returns
Type
Description
string
setId
Required. The policy id.
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.
Forprojects.regions.autoscalingPolicies, the resource name of the
policy has the following format:projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}
Forprojects.locations.autoscalingPolicies, the resource name of the
policy has the following format:projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
Forprojects.regions.autoscalingPolicies, the resource name of the
policy has the following format:projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}
Forprojects.locations.autoscalingPolicies, the resource name of the
policy has the following format:projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getBasicAlgorithm
Generated from protobuf field.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];
Optional. The labels to associate with this autoscaling policy.
Labelkeysmust contain 1 to 63 characters, and must conform toRFC 1035.
Labelvaluesmay be empty, but, if present, must contain 1 to 63
characters, and must conform toRFC
1035. No more than 32 labels can be
associated with an autoscaling policy.
Optional. The labels to associate with this autoscaling policy.
Labelkeysmust contain 1 to 63 characters, and must conform toRFC 1035.
Labelvaluesmay be empty, but, if present, must contain 1 to 63
characters, and must conform toRFC
1035. No more than 32 labels can be
associated with an autoscaling policy.
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Dataproc V1 Client - Class AutoscalingPolicy (3.14.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.14.0 (latest)](/php/docs/reference/cloud-dataproc/latest/V1.AutoscalingPolicy)\n- [3.13.4](/php/docs/reference/cloud-dataproc/3.13.4/V1.AutoscalingPolicy)\n- [3.12.0](/php/docs/reference/cloud-dataproc/3.12.0/V1.AutoscalingPolicy)\n- [3.11.0](/php/docs/reference/cloud-dataproc/3.11.0/V1.AutoscalingPolicy)\n- [3.10.1](/php/docs/reference/cloud-dataproc/3.10.1/V1.AutoscalingPolicy)\n- [3.9.0](/php/docs/reference/cloud-dataproc/3.9.0/V1.AutoscalingPolicy)\n- [3.8.1](/php/docs/reference/cloud-dataproc/3.8.1/V1.AutoscalingPolicy)\n- [3.7.1](/php/docs/reference/cloud-dataproc/3.7.1/V1.AutoscalingPolicy)\n- [3.6.1](/php/docs/reference/cloud-dataproc/3.6.1/V1.AutoscalingPolicy)\n- [3.5.1](/php/docs/reference/cloud-dataproc/3.5.1/V1.AutoscalingPolicy)\n- [3.4.0](/php/docs/reference/cloud-dataproc/3.4.0/V1.AutoscalingPolicy)\n- [3.3.0](/php/docs/reference/cloud-dataproc/3.3.0/V1.AutoscalingPolicy)\n- [3.2.2](/php/docs/reference/cloud-dataproc/3.2.2/V1.AutoscalingPolicy)\n- [2.6.1](/php/docs/reference/cloud-dataproc/2.6.1/V1.AutoscalingPolicy)\n- [2.5.0](/php/docs/reference/cloud-dataproc/2.5.0/V1.AutoscalingPolicy)\n- [2.3.0](/php/docs/reference/cloud-dataproc/2.3.0/V1.AutoscalingPolicy)\n- [2.2.3](/php/docs/reference/cloud-dataproc/2.2.3/V1.AutoscalingPolicy)\n- [2.1.0](/php/docs/reference/cloud-dataproc/2.1.0/V1.AutoscalingPolicy)\n- [2.0.0](/php/docs/reference/cloud-dataproc/2.0.0/V1.AutoscalingPolicy) \nReference documentation and code samples for the Google Cloud Dataproc V1 Client class AutoscalingPolicy.\n\nDescribes an autoscaling policy for Dataproc cluster autoscaler.\n\nGenerated from protobuf message `google.cloud.dataproc.v1.AutoscalingPolicy`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dataproc \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getId\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### setId\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### getName\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 policy has the following format: `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`\n- For `projects.locations.autoscalingPolicies`, the resource name of the policy has the following format: `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`\n\n### setName\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 policy has the following format: `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`\n- For `projects.locations.autoscalingPolicies`, the resource name of the policy has the following format: `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`\n\n### getBasicAlgorithm\n\nGenerated from protobuf field `.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];`\n\n### hasBasicAlgorithm\n\n### setBasicAlgorithm\n\nGenerated from protobuf field `.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm basic_algorithm = 3 [(.google.api.field_behavior) = REQUIRED];`\n\n### getWorkerConfig\n\nRequired. Describes how the autoscaler will operate for primary workers.\n\n### hasWorkerConfig\n\n### clearWorkerConfig\n\n### setWorkerConfig\n\nRequired. Describes how the autoscaler will operate for primary workers.\n\n### getSecondaryWorkerConfig\n\nOptional. Describes how the autoscaler will operate for secondary workers.\n\n### hasSecondaryWorkerConfig\n\n### clearSecondaryWorkerConfig\n\n### setSecondaryWorkerConfig\n\nOptional. Describes how the autoscaler will operate for secondary workers.\n\n### getLabels\n\nOptional. The labels to associate with this autoscaling policy.\n\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### setLabels\n\nOptional. The labels to associate with this autoscaling policy.\n\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### getAlgorithm"]]