- [Resource: AutoscalingPolicy](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies#AutoscalingPolicy)
  - [JSON representation](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies#AutoscalingPolicy.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies#METHODS_SUMMARY)

## Resource: AutoscalingPolicy

Describes an autoscaling policy for Dataproc cluster autoscaler.

| JSON representation |
|---|
| ``` { "id": string, "name": string, "workerConfig": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.InstanceGroupAutoscalingPolicyConfig`) }, "secondaryWorkerConfig": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.InstanceGroupAutoscalingPolicyConfig`) }, "clusterType": enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.ClusterType`), // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "basicAlgorithm": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.BasicAutoscalingAlgorithm`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `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 in <https://cloud.google.com/apis/design/resource_names>. - For `projects.regions.autoscalingPolicies`, the resource name of the policy has the following format: `projects/{projectId}/regions/{region}/autoscalingPolicies/{policyId}` - For `projects.locations.autoscalingPolicies`, the resource name of the policy has the following format: `projects/{projectId}/locations/{location}/autoscalingPolicies/{policyId}` |
| `workerConfig` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.InstanceGroupAutoscalingPolicyConfig`)`` Required. Describes how the autoscaler will operate for primary workers. |
| `secondaryWorkerConfig` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.InstanceGroupAutoscalingPolicyConfig`)`` Optional. Describes how the autoscaler will operate for secondary workers. |
| `clusterType` | ``enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.ClusterType`)`` Optional. The type of the clusters for which this autoscaling policy is to be configured. |
| Autoscaling algorithm for policy. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `basicAlgorithm` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.autoscalingPolicies#AutoscalingPolicy.BasicAutoscalingAlgorithm`)`` |
| End of mutually exclusive fields. ||

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/create` | Creates new autoscaling policy. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/delete` | Deletes an autoscaling policy. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/get` | Retrieves autoscaling policy. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/getIamPolicy` | Gets the access control policy for a resource. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/list` | Lists autoscaling policies in the project. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/setIamPolicy` | Sets the access control policy on the specified resource. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/testIamPermissions` | Returns permissions that a caller has on the specified resource. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.autoscalingPolicies/update` | Updates (replaces) autoscaling policy. |