Skip to main content

autoscaling_policies

Creates, updates, deletes, gets or lists an autoscaling_policies resource.

Overview

Nameautoscaling_policies
TypeResource
Idgoogle.dataproc.autoscaling_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringRequired. 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.
namestringOutput 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/{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}
basicAlgorithmobjectBasic algorithm for autoscaling. (id: BasicAutoscalingAlgorithm)
clusterTypestringOptional. The type of the clusters for which this autoscaling policy is to be configured.
labelsobjectOptional. The labels to associate with this autoscaling policy. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with an autoscaling policy.
secondaryWorkerConfigobjectOptional. Describes how the autoscaler will operate for secondary workers. (id: InstanceGroupAutoscalingPolicyConfig)
workerConfigobjectRequired. Describes how the autoscaler will operate for primary workers. (id: InstanceGroupAutoscalingPolicyConfig)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_regions_autoscaling_policies_getselectprojectsId, regionsId, autoscalingPoliciesIdRetrieves autoscaling policy.
projects_locations_autoscaling_policies_getselectprojectsId, locationsId, autoscalingPoliciesIdRetrieves autoscaling policy.
projects_regions_autoscaling_policies_listselectprojectsId, regionsIdpageSize, pageTokenLists autoscaling policies in the project.
projects_locations_autoscaling_policies_listselectprojectsId, locationsIdpageSize, pageTokenLists autoscaling policies in the project.
projects_regions_autoscaling_policies_createinsertprojectsId, regionsIdCreates new autoscaling policy.
projects_locations_autoscaling_policies_createinsertprojectsId, locationsIdCreates new autoscaling policy.
projects_regions_autoscaling_policies_updatereplaceprojectsId, regionsId, autoscalingPoliciesIdUpdates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.
projects_locations_autoscaling_policies_updatereplaceprojectsId, locationsId, autoscalingPoliciesIdUpdates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.
projects_regions_autoscaling_policies_deletedeleteprojectsId, regionsId, autoscalingPoliciesIdDeletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.
projects_locations_autoscaling_policies_deletedeleteprojectsId, locationsId, autoscalingPoliciesIdDeletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
autoscalingPoliciesIdstring
locationsIdstring
projectsIdstring
regionsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Retrieves autoscaling policy.

SELECT
id,
name,
basicAlgorithm,
clusterType,
labels,
secondaryWorkerConfig,
workerConfig
FROM google.dataproc.autoscaling_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND regionsId = '{{ regionsId }}' -- required
AND autoscalingPoliciesId = '{{ autoscalingPoliciesId }}' -- required;

INSERT examples

Creates new autoscaling policy.

INSERT INTO google.dataproc.autoscaling_policies (
data__id,
data__basicAlgorithm,
data__workerConfig,
data__secondaryWorkerConfig,
data__labels,
data__clusterType,
projectsId,
regionsId
)
SELECT
'{{ id }}',
'{{ basicAlgorithm }}',
'{{ workerConfig }}',
'{{ secondaryWorkerConfig }}',
'{{ labels }}',
'{{ clusterType }}',
'{{ projectsId }}',
'{{ regionsId }}'
RETURNING
id,
name,
basicAlgorithm,
clusterType,
labels,
secondaryWorkerConfig,
workerConfig
;

REPLACE examples

Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.

REPLACE google.dataproc.autoscaling_policies
SET
data__id = '{{ id }}',
data__basicAlgorithm = '{{ basicAlgorithm }}',
data__workerConfig = '{{ workerConfig }}',
data__secondaryWorkerConfig = '{{ secondaryWorkerConfig }}',
data__labels = '{{ labels }}',
data__clusterType = '{{ clusterType }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND regionsId = '{{ regionsId }}' --required
AND autoscalingPoliciesId = '{{ autoscalingPoliciesId }}' --required
RETURNING
id,
name,
basicAlgorithm,
clusterType,
labels,
secondaryWorkerConfig,
workerConfig;

DELETE examples

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

DELETE FROM google.dataproc.autoscaling_policies
WHERE projectsId = '{{ projectsId }}' --required
AND regionsId = '{{ regionsId }}' --required
AND autoscalingPoliciesId = '{{ autoscalingPoliciesId }}' --required;