openapi: 3.1.0
info:
  title: Autoscaling Groups API
  description: |-
    Instance Autoscaling Groups dynamically adjust their number of Instances based on defined scaling policies. Scaling actions (scaling-out or scaling-in) are triggered when the monitored metric exceeds the configured thresholds from your policies. Instance Autoscaling Groups rely on the Cockpit product to gather the Instance metrics, such as RAM or bandwidth usage. If a Scaleway Load Balancer is configured in the Instances Autoscaling Group, the Load Balancer will automatically be updated on scaling-out and scaling-in actions so that connections are properly distributed among the active set of Instances. You may also configure the Autoscaling Group to re-cycle Instances that appear as un-healthy by the Load Balancer.

    The purpose of this product is to maintain optimal application performance and cost efficiency by scaling your Instance group up during peak traffic and scaling it down when demand decreases. This ensures that applications have the necessary resources to handle varying loads without manual intervention, providing high availability and fault tolerance. Instance Scaling Groups are particularly useful for dynamic workloads, enabling businesses to optimize resource usage and reduce operational overhead.


    <Message type="note">
    This product is currently in [Private Beta](https://www.scaleway.com/en/betas/).
    </Message>


    ## Quickstart

    1. Configure your environment variables.

        <Message type="note">
        This is an optional step that seeks to simplify your usage of the Instance Scaling Groups API.
        </Message>

        ```bash
        export SCW_SECRET_KEY="<API secret key>"
        export SCW_DEFAULT_ZONE="<Scaleway default Availability Zone>"
        export SCW_PROJECT_ID="<Scaleway Project ID>"
        ```

    2. **Create an Instance Template**: run the following command to create an Instance Template using the Instances API. The created template will be used by the group during scaling to start new Instances, according to the given settings.

        ```bash
        curl -X POST \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          -H "Content-Type: application/json" \
          "https://api.scaleway.com/instance/v2alpha1/zones/$SCW_DEFAULT_ZONE/templates" \
          -d '{
            "name": "my_template",
            "server_type": "PLAY2-NANO",
            "volumes": [
                {
                  "name": "boot volume",
                  "image_label": "ubuntu_noble",
                  "volume_type": "sbs"
                }
            ],
            "private_networks": [
                {
                  "private_network_id": "<PRIVATE_NETWORK_ID>"
                }
            ],
            "project_id": "'"$SCW_PROJECT_ID"'"
          }'
        ```

    3. **Create an Autoscaling Group**: run the following command to create an Instance Autoscaling group. You may have already configured a Load Balancer, so that the Instance group can update its backend servers list during scaling actions.

        ```bash
        curl -X POST \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          -H "Content-Type: application/json" \
          "https://api.scaleway.com/autoscaling/v1alpha2/zones/$SCW_DEFAULT_ZONE/groups" \
          -d '{
            "project_id": "'"$SCW_PROJECT_ID"'",
            "name": "my_autoscaling_group",
            "template_id": "<INSTANCE_TEMPLATE_ID>",
            "scaling_policy_spec": {
              "minimum_size": 2,
              "maximum_size": 8,
              "cpu_target": {
                "target_avg_percent": 30
              }
            },
            "load_balancer_configuration_spec":{
              "load_balancer_id": "<LOAD_BALANCER_ID>",
              "auto_healing": {
                "enabled": true,
                "grace_period": "300s"
              },
              "backends": [
                {
                  "backend_id": "<BACKEND_ID>",
                  "address_family": "ipv4",
                  "private_network_id": "<PRIVATE_NETWORK_ID>"
                }
              ]
            }
          }'
        ```

    4. **Get the Autoscaling Group logs**: run the following command to get the logs for the given Instance Autoscaling Group:

        ```bash
        curl -X GET \
          -H "Content-Type: application/json" \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/autoscaling/v1alpha2/zones/$SCW_DEFAULT_ZONE/logs?group_id=<AUTOSCALING_GROUP_ID>"
        ```

    5. **Get a list of scaling alerts**: run the following command to get a list of all the alerts which occurred for the given Instance Autoscaling Group:

        ```bash
        curl -X GET \
          -H "Content-Type: application/json" \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/autoscaling/v1alpha2/zones/$SCW_DEFAULT_ZONE/alerts?group_id=<AUTOSCALING_GROUP_ID>"

    6. **Get a list of active instances**: run the following command to get a list of all the instances managed by the given Instance Autoscaling Group:

        ```bash
        curl -X GET \
          -H "Content-Type: application/json" \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/autoscaling/v1alpha2/zones/$SCW_DEFAULT_ZONE/servers?group_id=<AUTOSCALING_GROUP_ID>"
        ```

    7. **Delete your Instance Autoscaling Group**: run the following command to delete an Instance Autoscaling Group:

        ```bash
        curl -X DELETE \
          -H "Content-Type: application/json" \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/autoscaling/v1alpha2/zones/$SCW_DEFAULT_ZONE/servers?group_id=<AUTOSCALING_GROUP_ID>"
        ```


    <Message type="requirement">
    - You have a [Scaleway account](https://console.scaleway.com/)
    - You have created an [API key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/) to perform the actions described on this page
    - You have [installed `curl`](https://curl.se/download.html)
    </Message>


    ## Technical information

    Instance Scaling Groups rely on the [Cockpit](https://www.scaleway.com/en/docs/cockpit/) product to gather metrics and take scaling actions based on defined policies.

    ### Availability Zones

    The Scaleway Instance Scaling Groups API is a **zoned** API, meaning that each call must specify in its path parameters the Availability Zone for the resources concerned by the call.

    The following Availability Zones are available for Instance Scaling Groups:

    | Name      | API ID                           |
    |-----------|----------------------------------|
    | Paris     | `fr-par-1` `fr-par-2` `fr-par-3` |

    ### IAM Managed Application

    Instance Autoscaling Group needs to take actions on behalf of the user, to create resources (Instances, Block volumes, Ipam addresses, Observability tokens), delete them, or update existing resources (Load Balancers, Private Networks). When an Instance Autoscaling Group is created, an IAM managed Application is created with the following permission sets:
    - BlockStorageFullAccess
    - InstancesFullAccess
    - IPAMReadOnly
    - LoadBalancersFullAccess
    - ObservabilityFullAccess
    - PrivateNetworksFullAccess

    ### Cockpit token

    Instance Autoscaling Group need to query the managed Instances metrics, to take scale-out or scale-in decisions. Managed tokens will be created in the Cockpit product with access level "Query metrics" to access the required metrics.

    ## Technical limitations

    - When you update an Instance template, changes are not replicated to existing Instances. If you need to refresh all existing Instances so that they comply with the new template, you must terminate them so that the group can create new Instances based on the updated template.
    - Custom metrics are not supported yet. You can only set scaling policies according to RAM or CPU usage.
    - Instance Scaling Groups do not handle the creation of Load Balancers and their associated backends. Only backend server updates for the given existing backend are managed by the group.

    ## Going further

    For more help using Scaleway Instance Scaling Groups, check out the following resources:
    - Our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/)
    - Our [support ticketing system](https://www.scaleway.com/en/docs/account/how-to/open-a-support-ticket/).
  version: v1alpha2
servers:
- url: https://api.scaleway.com
tags:
- name: Autoscaling Groups
  description: |
    Autoscaling groups automatically adjust the number of Instances based on metrics like CPU or memory usage.
    This allows you to automatically scale your infrastructure up or down to meet demand while optimizing costs.
- name: Group Logs
  description: |
    Logs provide visibility into the autoscaling group activities and events.
    You can query logs to understand scaling decisions and troubleshoot issues.
- name: Group Servers
  description: |
    List the Instances that belong to an autoscaling group.
- name: Alerts
  description: |
    Alerts notify you of issues affecting your autoscaling groups, such as quota limits, stock issues, or configuration problems.
components:
  schemas:
    scaleway.autoscaling.v1alpha2.Alert:
      type: object
      properties:
        type:
          description: Type of alert.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Alert.AlertType'
        opened_at:
          type:
          - string
          - "null"
          description: Timestamp when the alert was opened. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        closed_at:
          type:
          - string
          - "null"
          description: Optional timestamp when the alert was closed. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        group_id:
          type: string
          description: ID of the group.
        failing_quotas:
          type: array
          description: List of quota names that are exceeded (for quotas_exceeded
            alerts).
          items:
            type: string
      x-properties-order:
      - type
      - opened_at
      - closed_at
      - group_id
      - failing_quotas
    scaleway.autoscaling.v1alpha2.Alert.AlertType:
      type: string
      enum:
      - unknown_alert_type
      - quotas_exceeded
      - out_of_stock
      - invalid_template
      - template_not_found
      - invalid_instance
      - template_permissions_denied
      - load_balancer_not_found
      - load_balancer_permissions_denied
      - backend_not_found
      - backend_permissions_denied
      x-enum-descriptions:
        values:
          unknown_alert_type: Unknown alert type
          quotas_exceeded: Quotas exceeded during scaling
          out_of_stock: Out of stock error during scaling out
          invalid_template: Invalid template configuration
          template_not_found: Template not found
          invalid_instance: Invalid instance configuration
          template_permissions_denied: Template permissions denied
          load_balancer_not_found: Load balancer not found
          load_balancer_permissions_denied: Load balancer permissions denied
          backend_not_found: Load balancer backend not found
          backend_permissions_denied: Load balancer backend permissions denied
      default: unknown_alert_type
    scaleway.autoscaling.v1alpha2.Group:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the autoscaling group.
        project_id:
          type: string
          description: Project ID owning this group.
        name:
          type: string
          description: Name of the autoscaling group.
        tags:
          type: array
          description: Tags associated with the group.
          items:
            type: string
        created_at:
          type:
          - string
          - "null"
          description: Creation timestamp of the group. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        updated_at:
          type:
          - string
          - "null"
          description: Last update timestamp of the group. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        status:
          description: Current status of the autoscaling group.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.GroupStatus'
        open_alerts:
          type: array
          description: List of active alerts on the group.
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Alert'
        current_size:
          type: integer
          description: Current number of instances in the group.
          format: uint32
        target_size:
          type: integer
          description: Target number of instances the group is scaling to.
          format: uint32
        last_scale_out_at:
          type:
          - string
          - "null"
          description: Timestamp of the last scale out event. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        last_scale_in_at:
          type:
          - string
          - "null"
          description: Timestamp of the last scale in event. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        template_id:
          type: string
          description: The Instance template ID used to create instances in this group.
        scaling_policy:
          description: Scaling policy configuration.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy'
        load_balancer_configuration:
          description: Optional load balancer configuration.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration'
      x-properties-order:
      - id
      - project_id
      - name
      - tags
      - created_at
      - updated_at
      - status
      - open_alerts
      - current_size
      - target_size
      - last_scale_out_at
      - last_scale_in_at
      - template_id
      - scaling_policy
      - load_balancer_configuration
    scaleway.autoscaling.v1alpha2.Group.GroupStatus:
      type: string
      enum:
      - unknown_group_status
      - active
      - scaling_out
      - scaling_in
      - refreshing
      - healing
      - scaling_failure
      - deleting
      x-enum-descriptions:
        values:
          unknown_group_status: Unknown status
          active: Group is active and operating normally
          scaling_out: Group is scaling out (adding instances)
          scaling_in: Group is scaling in (removing instances)
          refreshing: Group is refreshing its configuration
          healing: Group is healing failed instances
          scaling_failure: Group encountered a scaling failure
          deleting: Group is being deleted
      default: unknown_group_status
    scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration:
      type: object
      properties:
        load_balancer_id:
          type: string
        backends:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.Backend'
        auto_healing:
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.AutoHealing'
      x-properties-order:
      - load_balancer_id
      - backends
      - auto_healing
    scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.AutoHealing:
      type: object
      properties:
        enabled:
          type: boolean
        grace_period:
          type:
          - string
          - "null"
          description: (in seconds)
          example: 2.5s
      x-properties-order:
      - enabled
      - grace_period
    scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.Backend:
      type: object
      properties:
        backend_id:
          type: string
        address_family:
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.Backend.AddressFamily'
        private_network_id:
          type:
          - string
          - "null"
      x-properties-order:
      - backend_id
      - address_family
      - private_network_id
    scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.Backend.AddressFamily:
      type: string
      enum:
      - unknown_address_family
      - ipv4
      - ipv6
      default: unknown_address_family
    scaleway.autoscaling.v1alpha2.Group.ScalingPolicy:
      type: object
      properties:
        minimum_size:
          type: integer
          format: uint32
        maximum_size:
          type: integer
          format: uint32
        scale_out_cooldown:
          type:
          - string
          - "null"
          description: (in seconds)
          example: 2.5s
        scale_in_cooldown:
          type:
          - string
          - "null"
          description: (in seconds)
          example: 2.5s
        scale_in_step:
          type: integer
          format: uint32
        scale_out_step:
          type: integer
          format: uint32
        fixed_size:
          x-one-of: target
          oneOf:
          - $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyFixedSize'
          - type: "null"
        cpu_target:
          x-one-of: target
          oneOf:
          - $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyCpuTarget'
          - type: "null"
        memory_target:
          x-one-of: target
          oneOf:
          - $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyMemoryTarget'
          - type: "null"
      x-properties-order:
      - minimum_size
      - maximum_size
      - scale_out_cooldown
      - scale_in_cooldown
      - scale_in_step
      - scale_out_step
      - fixed_size
      - cpu_target
      - memory_target
    scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyCpuTarget:
      type: object
      properties:
        target_avg_percent:
          type: integer
          format: uint32
      x-properties-order:
      - target_avg_percent
    scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyFixedSize:
      type: object
      properties:
        size:
          type: integer
          format: uint32
      x-properties-order:
      - size
    scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyMemoryTarget:
      type: object
      properties:
        target_avg_percent:
          type: integer
          format: uint32
      x-properties-order:
      - target_avg_percent
    scaleway.autoscaling.v1alpha2.GroupSummary:
      type: object
      properties:
        project_id:
          type: string
          description: Project ID owning this group.
        id:
          type: string
          description: Unique identifier of the autoscaling group.
        name:
          type: string
          description: Name of the autoscaling group.
        tags:
          type: array
          description: Tags associated with the group.
          items:
            type: string
        status:
          description: Current status of the autoscaling group.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.GroupStatus'
        created_at:
          type:
          - string
          - "null"
          description: Creation timestamp of the group. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        updated_at:
          type:
          - string
          - "null"
          description: Last update timestamp of the group. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        template_id:
          type: string
          description: The Instance template ID used to create instances in this group.
        load_balancer_id:
          type:
          - string
          - "null"
          description: Optional load balancer ID.
        current_size:
          type: integer
          description: Current number of instances in the group.
          format: uint32
        latest_open_alert:
          description: Most recent active alert if any.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Alert'
        minimum_size:
          type: integer
          description: The minimum number of instances in the group.
          format: uint32
        maximum_size:
          type: integer
          description: The maximum number of instances in the group.
          format: uint32
        scaling_policy_target_type:
          description: Defines which metric the group uses for scaling (cpu, memory,
            or fixed size).
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.GroupSummary.ScalingPolicyTargetType'
        zone:
          type: string
          description: Availability zone of the group.
      x-properties-order:
      - project_id
      - id
      - name
      - tags
      - status
      - created_at
      - updated_at
      - template_id
      - load_balancer_id
      - current_size
      - latest_open_alert
      - minimum_size
      - maximum_size
      - scaling_policy_target_type
      - zone
    scaleway.autoscaling.v1alpha2.GroupSummary.ScalingPolicyTargetType:
      type: string
      enum:
      - unknown_scaling_policy_target_type
      - fixed_size
      - cpu_target
      - memory_target
      default: unknown_scaling_policy_target_type
    scaleway.autoscaling.v1alpha2.ListAlertsResponse:
      type: object
      properties:
        alerts:
          type: array
          description: List of alerts.
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Alert'
        next_page_token:
          type:
          - string
          - "null"
          description: Token for the next page of results.
        total_count:
          type: integer
          description: Total number of alerts.
          format: uint64
      x-properties-order:
      - alerts
      - next_page_token
      - total_count
    scaleway.autoscaling.v1alpha2.ListGroupsRequest.OrderBy:
      type: string
      enum:
      - created_at_desc
      - created_at_asc
      default: created_at_desc
    scaleway.autoscaling.v1alpha2.ListGroupsResponse:
      type: object
      properties:
        group_summaries:
          type: array
          description: List of group summaries.
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.GroupSummary'
        next_page_token:
          type:
          - string
          - "null"
          description: Token for the next page of results.
        total_count:
          type: integer
          description: Total number of groups.
          format: uint64
      x-properties-order:
      - group_summaries
      - next_page_token
      - total_count
    scaleway.autoscaling.v1alpha2.ListLogsResponse:
      type: object
      properties:
        logs:
          type: array
          description: List of log entries.
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Log'
        next_page_token:
          type:
          - string
          - "null"
          description: Token for the next page of results.
        total_count:
          type: integer
          description: Total number of logs.
          format: uint64
      x-properties-order:
      - logs
      - next_page_token
      - total_count
    scaleway.autoscaling.v1alpha2.ListServersResponse:
      type: object
      properties:
        servers:
          type: array
          description: List of servers.
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Server'
        next_page_token:
          type:
          - string
          - "null"
          description: Token for the next page of results.
        total_count:
          type: integer
          description: Total number of servers.
          format: uint64
      x-properties-order:
      - servers
      - next_page_token
      - total_count
    scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec:
      type: object
      properties:
        load_balancer_id:
          type:
          - string
          - "null"
          description: ID of the load balancer (set to empty to disable).
        backends:
          type: array
          description: List of load balancer backend configurations.
          items:
            $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec.Backend'
        auto_healing:
          description: Auto-healing configuration.
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec.AutoHealing'
      x-properties-order:
      - load_balancer_id
      - backends
      - auto_healing
    scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec.AutoHealing:
      type: object
      properties:
        enabled:
          type:
          - boolean
          - "null"
          description: Whether auto-healing is enabled.
        grace_period:
          type:
          - string
          - "null"
          description: Grace period for health checks. (in seconds)
          example: 2.5s
      x-properties-order:
      - enabled
      - grace_period
    scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec.Backend:
      type: object
      properties:
        backend_id:
          type: string
          description: ID of the load balancer backend.
        address_family:
          description: IP address family (IPv4 or IPv6).
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.LoadBalancerConfiguration.Backend.AddressFamily'
        private_network_id:
          type:
          - string
          - "null"
          description: Optional private network ID.
      x-properties-order:
      - backend_id
      - address_family
      - private_network_id
    scaleway.autoscaling.v1alpha2.Log:
      type: object
      properties:
        timestamp:
          type:
          - string
          - "null"
          description: Timestamp of the log entry. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        level:
          description: Log level (info, warning, error).
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Log.LogLevel'
        message:
          type: string
          description: Log message content.
      x-properties-order:
      - timestamp
      - level
      - message
    scaleway.autoscaling.v1alpha2.Log.LogLevel:
      type: string
      enum:
      - unknown_log_level
      - info
      - warning
      - error
      default: unknown_log_level
    scaleway.autoscaling.v1alpha2.ScalingPolicySpec:
      type: object
      properties:
        minimum_size:
          type:
          - integer
          - "null"
          description: Minimum number of instances in the group.
          format: uint32
        maximum_size:
          type:
          - integer
          - "null"
          description: Maximum number of instances in the group.
          format: uint32
        scale_out_cooldown:
          type:
          - string
          - "null"
          description: Cooldown period after a scale out event. (in seconds)
          example: 2.5s
        scale_in_cooldown:
          type:
          - string
          - "null"
          description: Cooldown period after a scale in event. (in seconds)
          example: 2.5s
        scale_in_step:
          type:
          - integer
          - "null"
          description: Number of instances to remove in a single scale in event.
          format: uint32
        scale_out_step:
          type:
          - integer
          - "null"
          description: Number of instances to add in a single scale out event.
          format: uint32
        fixed_size:
          description: Fixed size scaling policy configuration.
          x-one-of: target
          oneOf:
          - $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyFixedSize'
          - type: "null"
        cpu_target:
          description: CPU target scaling policy configuration.
          x-one-of: target
          oneOf:
          - $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyCpuTarget'
          - type: "null"
        memory_target:
          description: Memory target scaling policy configuration.
          x-one-of: target
          oneOf:
          - $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group.ScalingPolicy.ScalingPolicyMemoryTarget'
          - type: "null"
      x-properties-order:
      - minimum_size
      - maximum_size
      - scale_out_cooldown
      - scale_in_cooldown
      - scale_in_step
      - scale_out_step
      - fixed_size
      - cpu_target
      - memory_target
    scaleway.autoscaling.v1alpha2.Server:
      type: object
      properties:
        server_id:
          type: string
          description: ID of the instance server.
      x-properties-order:
      - server_id
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /autoscaling/v1alpha2/zones/{zone}/alerts:
    get:
      tags:
      - Alerts
      operationId: ListAlerts
      summary: List autoscaling group alerts
      description: List active and historical alerts for a specified autoscaling group.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: query
        name: page_token
        schema:
          type: string
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ListAlertsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/alerts"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/alerts" \
            X-Auth-Token:$SCW_SECRET_KEY
  /autoscaling/v1alpha2/zones/{zone}/groups:
    get:
      tags:
      - Autoscaling Groups
      operationId: ListGroups
      summary: List autoscaling groups
      description: List all autoscaling groups in a project.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: query
        name: order_by
        description: Order criteria for listing groups.
        schema:
          $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ListGroupsRequest.OrderBy'
      - in: query
        name: page_size
        description: Page size for pagination.
        schema:
          type: integer
          format: uint32
      - in: query
        name: page_token
        description: Token for pagination.
        schema:
          type: string
      - in: query
        name: project_id
        description: Project ID to filter groups.
        required: true
        schema:
          type: string
      - in: query
        name: template_id
        description: Template ID to filter groups.
        schema:
          type: string
      - in: query
        name: load_balancer_id
        description: Load balancer ID to filter groups.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ListGroupsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
    post:
      tags:
      - Autoscaling Groups
      operationId: CreateGroup
      summary: Create an autoscaling group
      description: |-
        Create a new autoscaling group with the specified configuration
        including template, scaling policy, and optional load balancer
        settings.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: Project ID to create the group in.
                name:
                  type: string
                  description: Name of the autoscaling group.
                tags:
                  type: array
                  description: Tags associated with the group.
                  items:
                    type: string
                template_id:
                  type: string
                  description: Template ID for instances in this group.
                scaling_policy_spec:
                  description: Scaling policy configuration.
                  $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ScalingPolicySpec'
                load_balancer_configuration_spec:
                  description: Optional load balancer configuration.
                  $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec'
              x-properties-order:
              - project_id
              - name
              - tags
              - template_id
              - scaling_policy_spec
              - load_balancer_configuration_spec
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "name": "string",
              "project_id": "string",
              "template_id": "string"
            }' \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups" \
            X-Auth-Token:$SCW_SECRET_KEY \
            name="string" \
            project_id="string" \
            template_id="string"
  /autoscaling/v1alpha2/zones/{zone}/groups/{group_id}:
    get:
      tags:
      - Autoscaling Groups
      operationId: GetGroup
      summary: Get an autoscaling group
      description: |-
        Get details of a specified autoscaling group including its
        configuration, current size, and status.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: path
        name: group_id
        description: ID of the group to get.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups/{group_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups/{group_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Autoscaling Groups
      operationId: UpdateGroup
      summary: Update an autoscaling group
      description: |-
        Update the configuration of a specified autoscaling group including
        name, tags, template, scaling policy, and load balancer settings.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: path
        name: group_id
        description: ID of the group to update.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                  - string
                  - "null"
                  description: New name for the group.
                tags:
                  type:
                  - array
                  - "null"
                  description: New tags for the group.
                template_id:
                  type:
                  - string
                  - "null"
                  description: New template ID for instances.
                scaling_policy_spec:
                  description: New scaling policy configuration.
                  $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ScalingPolicySpec'
                load_balancer_configuration_spec:
                  description: New load balancer configuration.
                  $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.LoadBalancerConfigurationSpec'
              x-properties-order:
              - name
              - tags
              - template_id
              - scaling_policy_spec
              - load_balancer_configuration_spec
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups/{group_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups/{group_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Autoscaling Groups
      operationId: DeleteGroup
      summary: Delete an autoscaling group
      description: |-
        Delete a specified autoscaling group and all its associated
        resources.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: path
        name: group_id
        description: ID of the group to delete.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.Group'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups/{group_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/groups/{group_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /autoscaling/v1alpha2/zones/{zone}/logs:
    get:
      tags:
      - Group Logs
      operationId: ListLogs
      summary: List autoscaling group logs
      description: |-
        List logs for a specified autoscaling group to view scaling events
        and activities.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: query
        name: group_id
        required: true
        schema:
          type: string
      - in: query
        name: page_token
        schema:
          type: string
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: start_time
        description: (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: end_time
        description: (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ListLogsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/logs?group_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/logs" \
            X-Auth-Token:$SCW_SECRET_KEY \
            group_id==string
  /autoscaling/v1alpha2/zones/{zone}/servers:
    get:
      tags:
      - Group Servers
      operationId: ListServers
      summary: List autoscaling group servers
      description: List all Instances belonging to a specified autoscaling group.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par-1
          - fr-par-2
          - fr-par-3
      - in: query
        name: group_id
        required: true
        schema:
          type: string
      - in: query
        name: page_token
        schema:
          type: string
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.autoscaling.v1alpha2.ListServersResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/servers?group_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/autoscaling/v1alpha2/zones/{zone}/servers" \
            X-Auth-Token:$SCW_SECRET_KEY \
            group_id==string
