# Google Compute Engine Autoscaler API . autoscalers

## Instance Methods

Deletes the specified Autoscaler resource.

Gets the specified Autoscaler resource.

Adds new Autoscaler resource.

Lists all Autoscaler resources in this zone.

Retrieves the next page of results.

Update the entire content of the Autoscaler resource. This method supports patch semantics.

Update the entire content of the Autoscaler resource.

### Method Details

`delete(project, zone, autoscaler)`

    Deletes the specified Autoscaler resource.

    Args:
      project: string, Project ID of Autoscaler resource. (required)
      zone: string, Zone name of Autoscaler resource. (required)
      autoscaler: string, Name of the Autoscaler resource. (required)

    Returns:
      An object of the form:

        {
        "targetId": "A String",
        "clientOperationId": "A String",
        "creationTimestamp": "A String",
        "id": "A String",
        "zone": "A String",
        "insertTime": "A String",
        "operationType": "A String",
        "httpErrorMessage": "A String",
        "progress": 42,
        "httpErrorStatusCode": 42,
        "statusMessage": "A String",
        "status": "A String",
        "description": "A String",
        "warnings": [
          {
            "message": "A String",
            "code": "A String",
            "data": [
              {
                "value": "A String",
                "key": "A String",
              },
            ],
          },
        ],
        "user": "A String",
        "startTime": "A String",
        "kind": "autoscaler#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
        "name": "A String",
        "region": "A String",
        "error": {
          "errors": [
            {
              "message": "A String",
              "code": "A String",
              "location": "A String",
            },
          ],
        },
        "endTime": "A String",
        "selfLink": "A String",
        "targetLink": "A String",
      }

`get(project, zone, autoscaler)`

    Gets the specified Autoscaler resource.

    Args:
      project: string, Project ID of Autoscaler resource. (required)
      zone: string, Zone name of Autoscaler resource. (required)
      autoscaler: string, Name of the Autoscaler resource. (required)

    Returns:
      An object of the form:

        { # Cloud Autoscaler resource.
          "kind": "compute#autoscaler", # Type of resource.
          "description": "A String", # An optional textual description of the resource provided by the client.
          "autoscalingPolicy": { # Cloud Autoscaler policy. # Configuration parameters for autoscaling algorithm.
            "maxNumReplicas": 42, # The maximum number of replicas that the Autoscaler can scale up to.
            "coolDownPeriodSec": 42, # The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.
            "loadBalancingUtilization": { # Load balancing utilization policy. # Configuration parameters of autoscaling based on load balancer.
              "utilizationTarget": 3.14, # Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.
            },
            "customMetricUtilizations": [ # Configuration parameters of autoscaling based on custom metric.
              { # Custom utilization metric policy.
                "metric": "A String", # Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count.
                "utilizationTargetType": "A String", # Defines type in which utilization_target is expressed.
                "utilizationTarget": 3.14, # Target value of the metric which Autoscaler should maintain. Must be a positive value.
              },
            ],
            "cpuUtilization": { # CPU utilization policy. # Configuration parameters of CPU based autoscaling policy.
              "utilizationTarget": 3.14, # The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.
            },
            "minNumReplicas": 42, # The minimum number of replicas that the Autoscaler can scale down to.
          },
          "target": "A String", # URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target.
          "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
          "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
          "selfLink": "A String", # [Output Only] A self-link to the Autoscaler configuration resource.
          "name": "A String", # Name of the Autoscaler resource. Must be unique per project and zone.
        }

`insert(project, zone, body)`

    Adds new Autoscaler resource.

    Args:
      project: string, Project ID of Autoscaler resource. (required)
      zone: string, Zone name of Autoscaler resource. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # Cloud Autoscaler resource.
        "kind": "compute#autoscaler", # Type of resource.
        "description": "A String", # An optional textual description of the resource provided by the client.
        "autoscalingPolicy": { # Cloud Autoscaler policy. # Configuration parameters for autoscaling algorithm.
          "maxNumReplicas": 42, # The maximum number of replicas that the Autoscaler can scale up to.
          "coolDownPeriodSec": 42, # The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.
          "loadBalancingUtilization": { # Load balancing utilization policy. # Configuration parameters of autoscaling based on load balancer.
            "utilizationTarget": 3.14, # Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.
          },
          "customMetricUtilizations": [ # Configuration parameters of autoscaling based on custom metric.
            { # Custom utilization metric policy.
              "metric": "A String", # Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count.
              "utilizationTargetType": "A String", # Defines type in which utilization_target is expressed.
              "utilizationTarget": 3.14, # Target value of the metric which Autoscaler should maintain. Must be a positive value.
            },
          ],
          "cpuUtilization": { # CPU utilization policy. # Configuration parameters of CPU based autoscaling policy.
            "utilizationTarget": 3.14, # The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.
          },
          "minNumReplicas": 42, # The minimum number of replicas that the Autoscaler can scale down to.
        },
        "target": "A String", # URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "selfLink": "A String", # [Output Only] A self-link to the Autoscaler configuration resource.
        "name": "A String", # Name of the Autoscaler resource. Must be unique per project and zone.
      }

    Returns:
      An object of the form:

        {
        "targetId": "A String",
        "clientOperationId": "A String",
        "creationTimestamp": "A String",
        "id": "A String",
        "zone": "A String",
        "insertTime": "A String",
        "operationType": "A String",
        "httpErrorMessage": "A String",
        "progress": 42,
        "httpErrorStatusCode": 42,
        "statusMessage": "A String",
        "status": "A String",
        "description": "A String",
        "warnings": [
          {
            "message": "A String",
            "code": "A String",
            "data": [
              {
                "value": "A String",
                "key": "A String",
              },
            ],
          },
        ],
        "user": "A String",
        "startTime": "A String",
        "kind": "autoscaler#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
        "name": "A String",
        "region": "A String",
        "error": {
          "errors": [
            {
              "message": "A String",
              "code": "A String",
              "location": "A String",
            },
          ],
        },
        "endTime": "A String",
        "selfLink": "A String",
        "targetLink": "A String",
      }

`list(project, zone, maxResults=None, pageToken=None, filter=None)`

    Lists all Autoscaler resources in this zone.

    Args:
      project: string, Project ID of Autoscaler resource. (required)
      zone: string, Zone name of Autoscaler resource. (required)
      maxResults: integer, A parameter
      pageToken: string, A parameter
      filter: string, A parameter

    Returns:
      An object of the form:

        {
        "nextPageToken": "A String", # [Output only] A token used to continue a truncated list request.
        "items": [ # Autoscaler resources.
          { # Cloud Autoscaler resource.
              "kind": "compute#autoscaler", # Type of resource.
              "description": "A String", # An optional textual description of the resource provided by the client.
              "autoscalingPolicy": { # Cloud Autoscaler policy. # Configuration parameters for autoscaling algorithm.
                "maxNumReplicas": 42, # The maximum number of replicas that the Autoscaler can scale up to.
                "coolDownPeriodSec": 42, # The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.
                "loadBalancingUtilization": { # Load balancing utilization policy. # Configuration parameters of autoscaling based on load balancer.
                  "utilizationTarget": 3.14, # Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.
                },
                "customMetricUtilizations": [ # Configuration parameters of autoscaling based on custom metric.
                  { # Custom utilization metric policy.
                    "metric": "A String", # Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count.
                    "utilizationTargetType": "A String", # Defines type in which utilization_target is expressed.
                    "utilizationTarget": 3.14, # Target value of the metric which Autoscaler should maintain. Must be a positive value.
                  },
                ],
                "cpuUtilization": { # CPU utilization policy. # Configuration parameters of CPU based autoscaling policy.
                  "utilizationTarget": 3.14, # The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.
                },
                "minNumReplicas": 42, # The minimum number of replicas that the Autoscaler can scale down to.
              },
              "target": "A String", # URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target.
              "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
              "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
              "selfLink": "A String", # [Output Only] A self-link to the Autoscaler configuration resource.
              "name": "A String", # Name of the Autoscaler resource. Must be unique per project and zone.
            },
        ],
        "kind": "compute#autoscalerList", # Type of resource.
      }

`list_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.

`patch(project, zone, autoscaler, body)`

    Update the entire content of the Autoscaler resource. This method supports patch semantics.

    Args:
      project: string, Project ID of Autoscaler resource. (required)
      zone: string, Zone name of Autoscaler resource. (required)
      autoscaler: string, Name of the Autoscaler resource. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # Cloud Autoscaler resource.
        "kind": "compute#autoscaler", # Type of resource.
        "description": "A String", # An optional textual description of the resource provided by the client.
        "autoscalingPolicy": { # Cloud Autoscaler policy. # Configuration parameters for autoscaling algorithm.
          "maxNumReplicas": 42, # The maximum number of replicas that the Autoscaler can scale up to.
          "coolDownPeriodSec": 42, # The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.
          "loadBalancingUtilization": { # Load balancing utilization policy. # Configuration parameters of autoscaling based on load balancer.
            "utilizationTarget": 3.14, # Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.
          },
          "customMetricUtilizations": [ # Configuration parameters of autoscaling based on custom metric.
            { # Custom utilization metric policy.
              "metric": "A String", # Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count.
              "utilizationTargetType": "A String", # Defines type in which utilization_target is expressed.
              "utilizationTarget": 3.14, # Target value of the metric which Autoscaler should maintain. Must be a positive value.
            },
          ],
          "cpuUtilization": { # CPU utilization policy. # Configuration parameters of CPU based autoscaling policy.
            "utilizationTarget": 3.14, # The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.
          },
          "minNumReplicas": 42, # The minimum number of replicas that the Autoscaler can scale down to.
        },
        "target": "A String", # URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "selfLink": "A String", # [Output Only] A self-link to the Autoscaler configuration resource.
        "name": "A String", # Name of the Autoscaler resource. Must be unique per project and zone.
      }

    Returns:
      An object of the form:

        {
        "targetId": "A String",
        "clientOperationId": "A String",
        "creationTimestamp": "A String",
        "id": "A String",
        "zone": "A String",
        "insertTime": "A String",
        "operationType": "A String",
        "httpErrorMessage": "A String",
        "progress": 42,
        "httpErrorStatusCode": 42,
        "statusMessage": "A String",
        "status": "A String",
        "description": "A String",
        "warnings": [
          {
            "message": "A String",
            "code": "A String",
            "data": [
              {
                "value": "A String",
                "key": "A String",
              },
            ],
          },
        ],
        "user": "A String",
        "startTime": "A String",
        "kind": "autoscaler#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
        "name": "A String",
        "region": "A String",
        "error": {
          "errors": [
            {
              "message": "A String",
              "code": "A String",
              "location": "A String",
            },
          ],
        },
        "endTime": "A String",
        "selfLink": "A String",
        "targetLink": "A String",
      }

`update(project, zone, autoscaler, body)`

    Update the entire content of the Autoscaler resource.

    Args:
      project: string, Project ID of Autoscaler resource. (required)
      zone: string, Zone name of Autoscaler resource. (required)
      autoscaler: string, Name of the Autoscaler resource. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # Cloud Autoscaler resource.
        "kind": "compute#autoscaler", # Type of resource.
        "description": "A String", # An optional textual description of the resource provided by the client.
        "autoscalingPolicy": { # Cloud Autoscaler policy. # Configuration parameters for autoscaling algorithm.
          "maxNumReplicas": 42, # The maximum number of replicas that the Autoscaler can scale up to.
          "coolDownPeriodSec": 42, # The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.
          "loadBalancingUtilization": { # Load balancing utilization policy. # Configuration parameters of autoscaling based on load balancer.
            "utilizationTarget": 3.14, # Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.
          },
          "customMetricUtilizations": [ # Configuration parameters of autoscaling based on custom metric.
            { # Custom utilization metric policy.
              "metric": "A String", # Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count.
              "utilizationTargetType": "A String", # Defines type in which utilization_target is expressed.
              "utilizationTarget": 3.14, # Target value of the metric which Autoscaler should maintain. Must be a positive value.
            },
          ],
          "cpuUtilization": { # CPU utilization policy. # Configuration parameters of CPU based autoscaling policy.
            "utilizationTarget": 3.14, # The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.
          },
          "minNumReplicas": 42, # The minimum number of replicas that the Autoscaler can scale down to.
        },
        "target": "A String", # URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "selfLink": "A String", # [Output Only] A self-link to the Autoscaler configuration resource.
        "name": "A String", # Name of the Autoscaler resource. Must be unique per project and zone.
      }

    Returns:
      An object of the form:

        {
        "targetId": "A String",
        "clientOperationId": "A String",
        "creationTimestamp": "A String",
        "id": "A String",
        "zone": "A String",
        "insertTime": "A String",
        "operationType": "A String",
        "httpErrorMessage": "A String",
        "progress": 42,
        "httpErrorStatusCode": 42,
        "statusMessage": "A String",
        "status": "A String",
        "description": "A String",
        "warnings": [
          {
            "message": "A String",
            "code": "A String",
            "data": [
              {
                "value": "A String",
                "key": "A String",
              },
            ],
          },
        ],
        "user": "A String",
        "startTime": "A String",
        "kind": "autoscaler#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
        "name": "A String",
        "region": "A String",
        "error": {
          "errors": [
            {
              "message": "A String",
              "code": "A String",
              "location": "A String",
            },
          ],
        },
        "endTime": "A String",
        "selfLink": "A String",
        "targetLink": "A String",
      }