openapi: 3.1.0
info:
  title: Cockpit API
  description: |-
    Scaleway's Cockpit allows you to monitor your applications and their infrastructure by giving you insights and context into their behavior. Cockpit also enables you to visualize your metrics, logs, and traces through a Grafana dashboard. With Cockpit, you can also push data from your Scaleway resources, if they are [integrated with Cockpit](https://www.scaleway.com/en/docs/observability/cockpit/reference-content/cockpit-limitations/#product-integration-into-cockpit).

    The Observability Cockpit provides you with two Prometheus Remote Write endpoints for pushing metrics and logs. You can push metrics with any `Prometheus Remote Write` compatible agent such as [Prometheus](https://prometheus.io/docs/introduction/overview/), [Grafana](https://grafana.com/docs/agent/latest/) or [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/).

    You can push logs with any Loki compatible agent such as [Promtail](https://grafana.com/docs/loki/latest/clients/promtail/), [Fluentd](https://docs.fluentd.org/), [Fluent Bit](https://docs.fluentbit.io/manual/), [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/), or [Logstash](https://www.elastic.co/guide/en/logstash/current/introduction.html).

    Refer to the [Cockpit Global API](https://www.scaleway.com/en/developers/api/cockpit/global-api/) for information on how to perform Cockpit visualization actions such as retrieving your dashboard URLs, managing Grafana users, and synchronizing your data through Grafana dashboards.

    (switchcolumn)
    (switchcolumn)

    ## Concepts

    Refer to our [dedicated concepts page](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) to find definitions of the different terms referring to the Observability Cockpit.

    (switchcolumn)
    (switchcolumn)
    ## Quickstart

    1. **Configure your environment variables.**

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

        ```bash
        export SCW_SECRET_KEY="<API secret key>"
        export SCW_PROJECT_ID="<Scaleway Project ID>"
        ```
    2.  **Retrieve push URLs.**

        Retrieve your endpoints for metrics, logs, and traces from the [Data sources tab](https://console.scaleway.com/cockpit/dataSource) of the Scaleway console.
        The `metrics_url` is a domain that exposes a Prometheus-like API to manage metrics, and the `logs_url` exposes a Loki API to manage logs.

        - The Prometheus Remote Write endpoint to push your metrics is the following: `https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/api/v1/push`.
        - The Remote Write endpoint to push your logs is the following: `https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.logs.cockpit.fr-par.scw.cloud/loki/api/v1/push`
        - Traces have different endpoints depending on the [push path](https://www.scaleway.com/en/docs/observability/cockpit/how-to/activate-push-traces/#retrieve-traces-push-paths) you use. The traces endpoint for the OpenTelemetry agent is: `https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.traces.cockpit.fr-par.scw.cloud/otlp`.

    3. **Create your Cockpit token to push metrics, logs, and traces.**

        Find out [how to create your Cockpit token via the console](https://www.scaleway.com/en/docs/observability/cockpit/how-to/create-token/) or run the following command to create it via the API.

        ```bash
        curl -X POST \
        "https://api.scaleway.com/cockpit/v1beta1/tokens" \
        -H "Content-Type: application/json" \
        -H "X-Auth-Token: $SCW_SECRET_KEY" \
        -d '{
          "project_id": "<Scaleway Project ID>",
          "name": "token-name",
          "scopes": {
            "query_metrics": false,
            "write_metrics": true,
            "setup_metrics_rules": false,
            "query_logs": false,
            "write_logs": true,
            "setup_logs_rules": false,
            "setup_alerts": false,
            "query_traces": false,
            "write_traces": true
          }
        }'
        ```

        <Message type="important">
          Your Cockpit token's `secret_key` only displays once. Make sure that you save it. We strongly recommend that you only give the minimal amount of permissions to your token.
        </Message>

    4. **Configure the Grafana alloy agent.**

        Find out [how to configure the Grafana alloy agent](https://www.scaleway.com/en/docs/cockpit/how-to/send-metrics-with-grafana-alloy/) to push your data to Cockpit.

    5. **Configure rules and alerts.**

        Upon creation, your Grafana instance is already configured by default with your logs and metrics data sources and with the alert manager data source. This means that you will be able to configure and manage advanced alerting rules, for metrics and logs, configure contact points and notification policies, from Grafana.

        To do so, [access your Grafana dashboard](https://www.scaleway.com/en/docs/observability/cockpit/how-to/access-grafana-and-managed-dashboards/) and read our [dedicated documentation](https://www.scaleway.com/en/docs/observability/cockpit/how-to/configure-alerts-for-scw-resources/) to find out how to configure alert rules for Scaleway resources. Refer to the **External links** section of this page if you are not familiar with the alert manager or alert rules.

        <Message type="important">
         - Make sure that you select the `Scaleway Alerting` alert manager, as Scaleway does not support the `Grafana` alert manager.
         - Make sure that you create rules on the data source containing the data you wish to be alerted on rather than on Grafana. (`datasource-managed-alerts`)
        </Message>

    (switchcolumn)
    <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>
    (switchcolumn)

    ## Technical information

    ### Regional availability

    Scaleway's infrastructure is spread across different regions.
    Your Cockpit resources are available in the Paris, Amsterdam and Warsaw regions (fr-par, nl-ams, pl-waw)

    ### Current supported endpoints

    Cockpit supports telemetry ingestion and querying using the following open-source technologies:

    - [Mimir](https://grafana.com/oss/mimir/) for metrics
    - [Loki](https://grafana.com/oss/loki/) for logs
    - [Tempo](https://grafana.com/oss/tempo/) for traces
    - [Prometheus](https://prometheus.io/docs/alerting/latest/alertmanager/) for the alert manager

    Cockpit exposes a subset of their HTTP APIs so users can push, query, and manage telemetry data from Cockpit.

    Refer to the [dedicated documentation](https://www.scaleway.com/en/docs/cockpit/reference-content/cockpit-supported-endpoints/) to find out which API endpoints are supported by Cockpit for data source management.


    ### Troubleshooting

    Refer to our troubleshooting documentation if [your pusher does not support HTTP headers](https://www.scaleway.com/en/docs/observability/cockpit/troubleshooting/pusher-does-not-support-custom-http-headers/) or if  [no data showing up on Grafana dashboards](https://www.scaleway.com/en/docs/cockpit/troubleshooting/synchronize-grafana-data-sources/).

    ## Technical limitations

    - Metrics and logs data is retained **31 days**. After this period, data older than 31 days is deleted.
    - The number of **active metrics time series** is limited to **250,000 per Cockpit** by default.
    - The number of **active log streams** is limited to **5000 per Cockpit**.
    - It is not yet possible to downsample metrics.


    ## Going further

    For more information about Cockpit, you can check out the following pages:

    - [Cockpit Documentation](https://www.scaleway.com/en/docs/observability/cockpit/)
    - [Scaleway Slack Community](http://slack.scaleway.com) join the #observability-beta and the #observability channels
    - [Contact our support team](https://console.scaleway.com/support/tickets)

    ### External links

    If you are interested in learning more, you can check out the following pages:

    - [Pushing logs using Fluentbit](https://docs.fluentbit.io/manual/pipeline/outputs/loki). Fluentbit is another commonly used agent that collects and forwards logs.
    - [Pushing metrics using Prometheus's agent mode](https://prometheus.io/blog/2021/11/16/agent/). Prometheus can be used in an "agent-mode" that can scrape local targets and forward them using remote-write. This is useful for scenarios where targets are exposed in a private network (like a VPN or a single host) but need to be forwarded outside of it.
    - [How to create a Mimir or Loki managed alerting rule using Grafana](https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-mimir-loki-managed-rule/).
  version: v1
servers:
- url: https://api.scaleway.com
tags:
- name: Data sources
  description: |
    Data sources are regional backends that allow you to store and query metrics, logs and traces.
    Data sources for Scaleway metrics and logs are enabled by default if you are using Scaleway resources which are integrated into Cockpit.
    You can create additional data sources to store and query metrics, logs and traces to push custom data.
- name: Tokens
  description: |
    Tokens are secret keys that allow you to authenticate against your Cockpit’s regional data sources and Alert manager. Make sure that you create your tokens in the same regions as the data sources you want to use them for.
- name: Alert manager
  description: |
    The Alert manager endpoints allow you to manage Cockpit's alerting services.
    Once you have enabled the Alert manager in your desired regions, you can create contact points and activate preconfigured alerts.
- name: Data exporter
  description: |
    The data exporter endpoints allow you to manage and send your Scaleway product's metrics and logs as data exports, to external destinations.
- name: Products
  description: |
    The products endpoints provide information about all Scaleway products that send metrics and/or logs to Cockpit.
components:
  schemas:
    scaleway.cockpit.v1.Alert:
      type: object
      properties:
        region:
          type: string
          description: The region in which the alert is defined.
        preconfigured:
          type: boolean
          description: Indicates if the alert is preconfigured or custom.
        name:
          type: string
          description: Name of the alert.
        rule:
          type: string
          description: Rule defining the alert condition.
        duration:
          type: string
          description: Duration for which the alert must be active before firing.
            The format of this duration follows the prometheus duration format.
        rule_status:
          type: string
          description: Indicates if the alert is enabled, enabling, disabled or disabling.
            Preconfigured alerts can have any of these values, whereas custom alerts
            can only have the status "enabled".
          enum:
          - unknown_status
          - enabled
          - disabled
          - enabling
          - disabling
          x-enum-descriptions:
            values:
              enabled: The alert is enabled and may trigger based on its conditions.
              disabled: The alert is disabled. It will never trigger, and will not
                be evaluated.
              enabling: The alert has been marked for activation. It will be enabled
                momentarily.
              disabling: The alert has been marked for deactivation. It will be disabled
                momentarily.
          default: unknown_status
        state:
          type: string
          description: Current state of the alert. Possible states are `inactive`,
            `pending`, and `firing`.
          enum:
          - unknown_state
          - inactive
          - pending
          - firing
          x-enum-descriptions:
            values:
              inactive: The alert is inactive and may transition to `pending` or `firing`
                if its conditions are met.
              pending: The alert's conditions are met. They must persist for the configured
                duration before transitioning to the `firing` state.
              firing: The alert's conditions, including the required duration, have
                been fully met.
          default: unknown_state
        annotations:
          type: object
          description: Annotations for the alert, used to provide additional information
            about the alert.
          properties:
            <annotationKey>:
              type: string
              description: Annotations for the alert, used to provide additional information
                about the alert.
          additionalProperties: true
        preconfigured_data:
          type: object
          description: Contains additional data for preconfigured alerts, such as
            the rule ID, display name, and description. Only present if the alert
            is preconfigured.
          properties:
            preconfigured_rule_id:
              type: string
              description: ID of the preconfigured rule if the alert is preconfigured.
                (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            display_name:
              type: string
              description: Human readable name of the alert.
            display_description:
              type: string
              description: Human readable description of the alert.
            product_name:
              type: string
              description: Product associated with the alert.
            product_family:
              type: string
              description: Family of the product associated with the alert.
          x-properties-order:
          - preconfigured_rule_id
          - display_name
          - display_description
          - product_name
          - product_family
        data_source_id:
          type: string
          description: ID of the data source containing the alert rule. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      x-properties-order:
      - region
      - preconfigured
      - name
      - rule
      - duration
      - rule_status
      - state
      - annotations
      - preconfigured_data
      - data_source_id
    scaleway.cockpit.v1.AlertManager:
      type: object
      properties:
        alert_manager_url:
          type: string
          description: Alert manager URL.
          nullable: true
        alert_manager_enabled:
          type: boolean
          description: The Alert manager is enabled.
        managed_alerts_enabled:
          type: boolean
          description: Managed alerts are enabled.
        region:
          type: string
          description: Regions where the Alert manager is enabled.
      x-properties-order:
      - alert_manager_url
      - alert_manager_enabled
      - managed_alerts_enabled
      - region
    scaleway.cockpit.v1.ContactPoint:
      type: object
      properties:
        email:
          type: object
          description: Email address to send alerts to.
          properties:
            to:
              type: string
          nullable: true
          x-properties-order:
          - to
          x-one-of: configuration
        region:
          type: string
          description: Region.
        send_resolved_notifications:
          type: boolean
          description: Send an email notification when an alert is marked as resolved.
      x-properties-order:
      - email
      - region
      - send_resolved_notifications
    scaleway.cockpit.v1.DataSource:
      type: object
      properties:
        id:
          type: string
          description: ID of the data source. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        project_id:
          type: string
          description: ID of the Project the data source belongs to. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Data source name.
        url:
          type: string
          description: Data source URL.
        type:
          type: string
          description: Data source type.
          enum:
          - unknown_type
          - metrics
          - logs
          - traces
          x-enum-descriptions:
            values:
              unknown_type: Unknown data source type
              metrics: Metrics data source type, used to store and query metrics using
                Grafana Mimir
              logs: Logs data source type, used to store and query logs using Grafana
                Loki
              traces: Traces data source type, used to store and query traces using
                Grafana Tempo
          default: unknown_type
        origin:
          type: string
          description: Data source origin.
          enum:
          - unknown_origin
          - scaleway
          - external
          - custom
          x-enum-descriptions:
            values:
              unknown_origin: Unknown data source origin
              scaleway: Data source managed by Scaleway, used to store and query metrics
                and logs from Scaleway resources
              external: Data source created by the user, used to store and query metrics,
                logs and traces from user's custom resources
              custom: Data source created by the user, used to store and query metrics,
                logs and traces from user's custom resources
          default: unknown_origin
        created_at:
          type: string
          description: Date the data source was created. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Date the data source was last updated. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        synchronized_with_grafana:
          type: boolean
          description: Indicates whether the data source is synchronized with Grafana.
        retention_days:
          type: integer
          description: Duration for which the data will be retained in the data source.
          format: uint32
        region:
          type: string
          description: Region of the data source.
        current_month_usage:
          type: integer
          description: Usage of the month in bytes. (in bytes)
          format: uint64
          nullable: true
      x-properties-order:
      - id
      - project_id
      - name
      - url
      - type
      - origin
      - created_at
      - updated_at
      - synchronized_with_grafana
      - retention_days
      - region
      - current_month_usage
    scaleway.cockpit.v1.DataSource.Type:
      type: string
      enum:
      - unknown_type
      - metrics
      - logs
      - traces
      x-enum-descriptions:
        values:
          unknown_type: Unknown data source type
          metrics: Metrics data source type, used to store and query metrics using
            Grafana Mimir
          logs: Logs data source type, used to store and query logs using Grafana
            Loki
          traces: Traces data source type, used to store and query traces using Grafana
            Tempo
      default: unknown_type
    scaleway.cockpit.v1.DisableAlertRulesResponse:
      type: object
      properties:
        disabled_rule_ids:
          type: array
          description: |-
            List of IDs of the rules that were disabled.
            Only newly disabled rules are listed. Rules that were already disabled are not returned in the output. (UUID format)
          example:
          - 6170692e-7363-616c-6577-61792e636f6d
          items:
            type: string
      x-properties-order:
      - disabled_rule_ids
    scaleway.cockpit.v1.EnableAlertRulesResponse:
      type: object
      properties:
        enabled_rule_ids:
          type: array
          description: |-
            List of IDs of the rules that were enabled.
            Only newly enabled rules are listed. Rules that were already enabled are not returned in the output. (UUID format)
          example:
          - 6170692e-7363-616c-6577-61792e636f6d
          items:
            type: string
      x-properties-order:
      - enabled_rule_ids
    scaleway.cockpit.v1.Exporter:
      type: object
      properties:
        id:
          type: string
          description: ID of the data export. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Name of the data export.
        description:
          type: string
          description: Description of the data export.
        datasource_id:
          type: string
          description: ID of the data source linked to the data export. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        datadog_destination:
          type: object
          description: Datadog destination configuration for the data export.
          properties:
            api_key:
              type: string
              nullable: true
            endpoint:
              type: string
              nullable: true
          nullable: true
          x-properties-order:
          - api_key
          - endpoint
          x-one-of: destination
        otlp_destination:
          type: object
          description: OTLP destination configuration for the data export.
          properties:
            endpoint:
              type: string
            headers:
              type: object
              properties:
                <headerKey>:
                  type: string
              additionalProperties: true
          nullable: true
          x-properties-order:
          - endpoint
          - headers
          x-one-of: destination
        status:
          type: string
          description: Status of the data export.
          enum:
          - unknown_status
          - creating
          - ready
          - error
          - idle
          x-enum-descriptions:
            values:
              unknown_status: The data export status is unknown
              creating: The data export is being created
              ready: The data export is active and sending data to the chosen destination
              error: The data export encountered an error and stopped sending data
          default: unknown_status
        exported_products:
          type: array
          description: List of Scaleway products name exported by the data export.
          items:
            type: string
        created_at:
          type: string
          description: A timestamp of the creation date of the data export. (RFC 3339
            format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: A timestamp of the last update date of the data export. (RFC
            3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        region:
          type: string
          description: The region in which the export is located.
      x-properties-order:
      - id
      - name
      - description
      - datasource_id
      - datadog_destination
      - otlp_destination
      - status
      - exported_products
      - created_at
      - updated_at
      - region
    scaleway.cockpit.v1.GetConfigResponse:
      type: object
      properties:
        custom_metrics_retention:
          type: object
          description: Custom metrics retention configuration.
          properties:
            min_days:
              type: integer
              format: uint32
            max_days:
              type: integer
              format: uint32
            default_days:
              type: integer
              format: uint32
          x-properties-order:
          - min_days
          - max_days
          - default_days
        custom_logs_retention:
          type: object
          description: Custom logs retention configuration.
          properties:
            min_days:
              type: integer
              format: uint32
            max_days:
              type: integer
              format: uint32
            default_days:
              type: integer
              format: uint32
          x-properties-order:
          - min_days
          - max_days
          - default_days
        custom_traces_retention:
          type: object
          description: Custom traces retention configuration.
          properties:
            min_days:
              type: integer
              format: uint32
            max_days:
              type: integer
              format: uint32
            default_days:
              type: integer
              format: uint32
          x-properties-order:
          - min_days
          - max_days
          - default_days
        product_metrics_retention:
          type: object
          description: Scaleway metrics retention configuration.
          properties:
            min_days:
              type: integer
              format: uint32
            max_days:
              type: integer
              format: uint32
            default_days:
              type: integer
              format: uint32
          x-properties-order:
          - min_days
          - max_days
          - default_days
        product_logs_retention:
          type: object
          description: Scaleway logs retention configuration.
          properties:
            min_days:
              type: integer
              format: uint32
            max_days:
              type: integer
              format: uint32
            default_days:
              type: integer
              format: uint32
          x-properties-order:
          - min_days
          - max_days
          - default_days
      x-properties-order:
      - custom_metrics_retention
      - custom_logs_retention
      - custom_traces_retention
      - product_metrics_retention
      - product_logs_retention
    scaleway.cockpit.v1.GetRulesCountResponse:
      type: object
      properties:
        rules_count_by_datasource:
          type: array
          description: Total count of rules grouped by data source.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.RulesCount'
        preconfigured_rules_count:
          type: integer
          description: Total count of preconfigured rules.
          format: int32
        custom_rules_count:
          type: integer
          description: Total count of custom rules.
          format: int32
      x-properties-order:
      - rules_count_by_datasource
      - preconfigured_rules_count
      - custom_rules_count
    scaleway.cockpit.v1.ListAlertsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of alerts matching the request.
          format: uint64
        alerts:
          type: array
          description: List of alerts matching the applied filters.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Alert'
      x-properties-order:
      - total_count
      - alerts
    scaleway.cockpit.v1.ListContactPointsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of contact points associated with the default receiver.
          format: uint64
        contact_points:
          type: array
          description: List of contact points associated with the default receiver.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.ContactPoint'
        has_additional_receivers:
          type: boolean
          description: Indicates whether the Alert manager has other receivers than
            the default one.
        has_additional_contact_points:
          type: boolean
          description: Indicates whether there are unmanaged contact points on the
            default receiver.
      x-properties-order:
      - total_count
      - contact_points
      - has_additional_receivers
      - has_additional_contact_points
    scaleway.cockpit.v1.ListDataSourcesResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of data sources matching the request.
          format: uint64
        data_sources:
          type: array
          description: Data sources matching the request within the pagination.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.DataSource'
      x-properties-order:
      - total_count
      - data_sources
    scaleway.cockpit.v1.ListExportersResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of data exports matching the request.
          format: uint64
        exporters:
          type: array
          description: Data exports matching the request within the pagination.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Exporter'
      x-properties-order:
      - total_count
      - exporters
    scaleway.cockpit.v1.ListProductsResponse:
      type: object
      properties:
        products_list:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Product'
        total_count:
          type: integer
          format: uint64
      x-properties-order:
      - products_list
      - total_count
    scaleway.cockpit.v1.ListTokensResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of tokens matching the request.
          format: uint64
        tokens:
          type: array
          description: Tokens matching the request within the pagination.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Token'
      x-properties-order:
      - total_count
      - tokens
    scaleway.cockpit.v1.Product:
      type: object
      properties:
        name:
          type: string
        display_name:
          type: string
        family_name:
          type: string
        resource_types:
          type: array
          items:
            type: string
      x-properties-order:
      - name
      - display_name
      - family_name
      - resource_types
    scaleway.cockpit.v1.RulesCount:
      type: object
      properties:
        data_source_id:
          type: string
          description: ID of the data source. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        data_source_name:
          type: string
          description: Name of the data source.
        rules_count:
          type: integer
          description: Total count of rules associated with this data source.
          format: int32
      x-properties-order:
      - data_source_id
      - data_source_name
      - rules_count
    scaleway.cockpit.v1.Token:
      type: object
      properties:
        id:
          type: string
          description: ID of the token.
        project_id:
          type: string
          description: ID of the Project the token belongs to.
        name:
          type: string
          description: Name of the token.
        created_at:
          type: string
          description: Token creation date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Token last modification date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        scopes:
          type: array
          description: Token permission scopes.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Token.Scope'
        secret_key:
          type: string
          description: Token secret key.
          nullable: true
        region:
          type: string
          description: Regions where the token is located.
      x-properties-order:
      - id
      - project_id
      - name
      - created_at
      - updated_at
      - scopes
      - secret_key
      - region
    scaleway.cockpit.v1.Token.Scope:
      type: string
      enum:
      - unknown_scope
      - read_only_metrics
      - write_only_metrics
      - full_access_metrics_rules
      - read_only_logs
      - write_only_logs
      - full_access_logs_rules
      - full_access_alert_manager
      - read_only_traces
      - write_only_traces
      x-enum-descriptions:
        values:
          unknown_scope: The token's permission scope is unknown
          read_only_metrics: Token has permission to read data from metrics data sources
          write_only_metrics: Token has permission to write data in metrics data sources
          full_access_metrics_rules: Token has permission to read and write prometheus
            rules in metrics data sources
          read_only_logs: Token has permission to read data from logs data sources
          write_only_logs: Token has permission to write data in logs data sources
          full_access_logs_rules: Token has permission to read and write prometheus
            rules in logs data sources
          full_access_alert_manager: Token has permission to read and write the Alert
            manager API
          read_only_traces: Token has permission to read data from traces data sources
          write_only_traces: Token has permission to write data in traces data sources
      default: unknown_scope
    scaleway.cockpit.v1.Usage:
      type: object
      properties:
        data_source_id:
          type: string
          description: ID of the data source.
          nullable: true
        project_id:
          type: string
          description: ID of the Project the data source belongs to. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        data_source_origin:
          type: string
          description: Origin of the data source.
          enum:
          - unknown_origin
          - scaleway
          - external
          - custom
          x-enum-descriptions:
            values:
              unknown_origin: Unknown data source origin
              scaleway: Data source managed by Scaleway, used to store and query metrics
                and logs from Scaleway resources
              external: Data source created by the user, used to store and query metrics,
                logs and traces from user's custom resources
              custom: Data source created by the user, used to store and query metrics,
                logs and traces from user's custom resources
          default: unknown_origin
        data_source_type:
          type: string
          description: Type of the data source.
          enum:
          - unknown_type
          - metrics
          - logs
          - traces
          x-enum-descriptions:
            values:
              unknown_type: Unknown data source type
              metrics: Metrics data source type, used to store and query metrics using
                Grafana Mimir
              logs: Logs data source type, used to store and query logs using Grafana
                Loki
              traces: Traces data source type, used to store and query traces using
                Grafana Tempo
          default: unknown_type
        unit:
          type: string
          description: Unit of the data source usage.
          enum:
          - unknown_unit
          - bytes
          - samples
          default: unknown_unit
        interval:
          type: string
          description: Interval for the data source usage. (in seconds)
          example: 2.5s
          nullable: true
        quantity_over_interval:
          type: integer
          description: Data source usage for the given interval.
          format: uint64
        region:
          type: string
          description: Region of the data source usage.
      x-properties-order:
      - data_source_id
      - project_id
      - data_source_origin
      - data_source_type
      - unit
      - interval
      - quantity_over_interval
      - region
    scaleway.cockpit.v1.UsageOverview:
      type: object
      properties:
        scaleway_metrics_usage:
          $ref: '#/components/schemas/scaleway.cockpit.v1.Usage'
        scaleway_logs_usage:
          $ref: '#/components/schemas/scaleway.cockpit.v1.Usage'
        external_metrics_usage:
          $ref: '#/components/schemas/scaleway.cockpit.v1.Usage'
        external_logs_usage:
          $ref: '#/components/schemas/scaleway.cockpit.v1.Usage'
        external_traces_usage:
          $ref: '#/components/schemas/scaleway.cockpit.v1.Usage'
      x-properties-order:
      - scaleway_metrics_usage
      - scaleway_logs_usage
      - external_metrics_usage
      - external_logs_usage
      - external_traces_usage
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /cockpit/v1/regions/{region}/alert-manager:
    get:
      tags:
      - Alert manager
      operationId: GetAlertManager
      summary: Get the Alert manager
      description: |-
        Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
        The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: Project ID of the requested Alert manager.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.AlertManager'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
  /cockpit/v1/regions/{region}/alert-manager/contact-points:
    get:
      tags:
      - Alert manager
      operationId: ListContactPoints
      summary: List contact points
      description: Retrieve a list of contact points for the specified Project. The
        response lists all contact points and receivers created in Grafana or via
        the API.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: ID of the Project containing the contact points to list.
        required: true
        schema:
          type: string
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Total count of contact points to return per page.
        schema:
          type: integer
          format: uint32
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListContactPointsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
    post:
      tags:
      - Alert manager
      operationId: CreateContactPoint
      summary: Create a contact point
      description: |-
        Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to.
        The source of the alerts are data sources within the same Project and region as the Alert manager.
        If you need to receive alerts for other receivers, you can create additional contact points and receivers in Grafana. Make sure that you select the Scaleway Alert manager.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ContactPoint'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project to create the contact point in.
                email:
                  type: object
                  description: Email address of the contact point to create.
                  properties:
                    to:
                      type: string
                  nullable: true
                  x-properties-order:
                  - to
                  x-one-of: configuration
                send_resolved_notifications:
                  type: boolean
                  description: Send an email notification when an alert is marked
                    as resolved.
                  nullable: true
              required:
              - project_id
              x-properties-order:
              - project_id
              - email
              - send_resolved_notifications
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
    patch:
      operationId: UpdateContactPoint
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ContactPoint'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project containing the contact point to update.
                email:
                  type: object
                  description: Email address of the contact point to update.
                  properties:
                    to:
                      type: string
                  nullable: true
                  x-properties-order:
                  - to
                  x-one-of: configuration
                send_resolved_notifications:
                  type: boolean
                  description: Enable or disable notifications when alert is resolved.
                  nullable: true
              required:
              - project_id
              x-properties-order:
              - project_id
              - email
              - send_resolved_notifications
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/contact-points/delete:
    post:
      tags:
      - Alert manager
      operationId: DeleteContactPoint
      summary: Delete a contact point
      description: Delete a contact point associated with the default receiver.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "204":
          description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project containing the contact point to delete.
                email:
                  type: object
                  description: Email address of the contact point to delete.
                  properties:
                    to:
                      type: string
                  nullable: true
                  x-properties-order:
                  - to
                  x-one-of: configuration
              required:
              - project_id
              x-properties-order:
              - project_id
              - email
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points/delete"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/contact-points/delete" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/disable:
    post:
      tags:
      - Alert manager
      operationId: DisableAlertManager
      summary: Disable the Alert manager
      description: Disabling the Alert manager deletes the contact points you have
        created and disables managed alerts in the specified Project and region.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.AlertManager'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project to disable the Alert manager in.
              required:
              - project_id
              x-properties-order:
              - project_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/disable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/disable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/disable-alert-rules:
    post:
      tags:
      - Alert manager
      operationId: DisableAlertRules
      summary: Disable preconfigured alert rules
      description: Disable alert rules from the list of available preconfigured rules.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.DisableAlertRulesResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project.
                rule_ids:
                  type: array
                  description: List of IDs of the rules to enable. If empty, disables
                    all preconfigured rules. (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              required:
              - project_id
              x-properties-order:
              - project_id
              - rule_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/disable-alert-rules"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/disable-alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/enable:
    post:
      tags:
      - Alert manager
      operationId: EnableAlertManager
      summary: Enable the Alert manager
      description: Enabling the Alert manager allows you to enable managed alerts
        and create contact points in the specified Project and region, to be notified
        when your Scaleway resources may require your attention.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.AlertManager'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project to enable the Alert manager in.
              required:
              - project_id
              x-properties-order:
              - project_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/enable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/enable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/enable-alert-rules:
    post:
      tags:
      - Alert manager
      operationId: EnableAlertRules
      summary: Enable preconfigured alert rules
      description: Enable alert rules from the list of available preconfigured rules.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.EnableAlertRulesResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project.
                rule_ids:
                  type: array
                  description: List of IDs of the rules to enable. If empty, enables
                    all preconfigured rules. (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              required:
              - project_id
              x-properties-order:
              - project_id
              - rule_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/enable-alert-rules"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/enable-alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/managed-alerts/disable:
    post:
      tags:
      - Alert manager
      operationId: DisableManagedAlerts
      summary: Disable managed alerts
      description: Disable the sending of managed alerts for the specified Project.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.AlertManager'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project.
              required:
              - project_id
              x-properties-order:
              - project_id
      security:
      - scaleway: []
      deprecated: true
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/managed-alerts/disable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/managed-alerts/disable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/managed-alerts/enable:
    post:
      tags:
      - Alert manager
      operationId: EnableManagedAlerts
      summary: Enable managed alerts
      description: Enable the sending of managed alerts for the specified Project.
        Managed alerts are predefined alerts that apply to Scaleway resources integrated
        with Cockpit by default.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.AlertManager'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project.
              required:
              - project_id
              x-properties-order:
              - project_id
      security:
      - scaleway: []
      deprecated: true
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/managed-alerts/enable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/managed-alerts/enable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alert-manager/trigger-test-alert:
    post:
      tags:
      - Alert manager
      operationId: TriggerTestAlert
      summary: Trigger a test alert
      description: Send a test alert to the Alert manager to make sure your contact
        points get notified.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "204":
          description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project.
              required:
              - project_id
              x-properties-order:
              - project_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"project_id":"string"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/trigger-test-alert"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/alert-manager/trigger-test-alert" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="string"
  /cockpit/v1/regions/{region}/alerts:
    get:
      tags:
      - Alert manager
      operationId: ListAlerts
      summary: List alerts
      description: List preconfigured and/or custom alerts for the specified Project
        and data source.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: Project ID to filter for, only alerts from this Project will
          be returned.
        required: true
        schema:
          type: string
      - in: query
        name: rule_status
        description: |-
          Filter alerts based on their activation status. Optional.
          Returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply.
        schema:
          type: string
          enum:
          - unknown_status
          - enabled
          - disabled
          - enabling
          - disabling
          x-enum-descriptions:
            values:
              enabled: The alert is enabled and may trigger based on its conditions.
              disabled: The alert is disabled. It will never trigger, and will not
                be evaluated.
              enabling: The alert has been marked for activation. It will be enabled
                momentarily.
              disabling: The alert has been marked for deactivation. It will be disabled
                momentarily.
          default: unknown_status
      - in: query
        name: is_preconfigured
        description: |-
          Filter alerts based on their types (preconfigured or custom). Optional.
          True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply.
        schema:
          type: boolean
      - in: query
        name: state
        description: |-
          Filter alerts based on their state. Optional.
          Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply.
        schema:
          type: string
          enum:
          - unknown_state
          - inactive
          - pending
          - firing
          x-enum-descriptions:
            values:
              inactive: The alert is inactive and may transition to `pending` or `firing`
                if its conditions are met.
              pending: The alert's conditions are met. They must persist for the configured
                duration before transitioning to the `firing` state.
              firing: The alert's conditions, including the required duration, have
                been fully met.
          default: unknown_state
      - in: query
        name: data_source_id
        description: |-
          Filter alerts from a specific data source. Optional.
          If omitted, only alerts from the default Scaleway metrics data source will be listed.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListAlertsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/alerts?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/alerts" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
  /cockpit/v1/regions/{region}/config:
    get:
      operationId: GetConfig
      summary: Get the Cockpit configuration
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.GetConfigResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/config"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/config" \
            X-Auth-Token:$SCW_SECRET_KEY
  /cockpit/v1/regions/{region}/data-sources:
    get:
      tags:
      - Data sources
      operationId: ListDataSources
      summary: List data sources
      description: Retrieve the list of data sources available in the specified region.
        By default, the data sources returned in the list are ordered by creation
        date, in ascending order.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: Project ID to filter for, only data sources from this Project
          will be returned.
        required: true
        schema:
          type: string
      - in: query
        name: origin
        description: Origin to filter for, only data sources with matching origin
          will be returned. If omitted, all types will be returned.
        schema:
          type: string
          enum:
          - unknown_origin
          - scaleway
          - external
          - custom
          x-enum-descriptions:
            values:
              unknown_origin: Unknown data source origin
              scaleway: Data source managed by Scaleway, used to store and query metrics
                and logs from Scaleway resources
              external: Data source created by the user, used to store and query metrics,
                logs and traces from user's custom resources
              custom: Data source created by the user, used to store and query metrics,
                logs and traces from user's custom resources
          default: unknown_origin
      - in: query
        name: types
        description: Types to filter for (metrics, logs, traces), only data sources
          with matching types will be returned. If omitted, all types will be returned.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.DataSource.Type'
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Number of data sources to return per page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Sort order for data sources in the response.
        schema:
          type: string
          enum:
          - created_at_asc
          - created_at_desc
          - name_asc
          - name_desc
          - type_asc
          - type_desc
          default: created_at_asc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListDataSourcesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
    post:
      tags:
      - Data sources
      operationId: CreateDataSource
      summary: Create a data source
      description: |-
        You must specify the data source name and type (metrics, logs, traces) upon creation.
        The name of the data source will then be used as reference to name the associated Grafana data source.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.DataSource'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project the data source belongs to.
                name:
                  type: string
                  description: Data source name.
                type:
                  type: string
                  description: Data source type.
                  enum:
                  - unknown_type
                  - metrics
                  - logs
                  - traces
                  x-enum-descriptions:
                    values:
                      unknown_type: Unknown data source type
                      metrics: Metrics data source type, used to store and query metrics
                        using Grafana Mimir
                      logs: Logs data source type, used to store and query logs using
                        Grafana Loki
                      traces: Traces data source type, used to store and query traces
                        using Grafana Tempo
                  default: unknown_type
                retention_days:
                  type: integer
                  description: |-
                    Duration for which the data will be retained in the data source.
                    Default values are 31 days for metrics, 7 days for logs and traces.
                  format: uint32
                  nullable: true
              required:
              - project_id
              - name
              - type
              x-properties-order:
              - project_id
              - name
              - type
              - retention_days
      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",
              "type": "unknown_type"
            }' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources" \
            X-Auth-Token:$SCW_SECRET_KEY \
            name="string" \
            project_id="string" \
            type="unknown_type"
  /cockpit/v1/regions/{region}/data-sources/{data_source_id}:
    get:
      tags:
      - Data sources
      operationId: GetDataSource
      summary: Get a data source
      description: Retrieve information about a given data source, specified by the
        data source ID. The data source's information such as its name, type, URL,
        origin, and retention period, is returned.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: data_source_id
        description: ID of the relevant data source.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.DataSource'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources/{data_source_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources/{data_source_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Data sources
      operationId: UpdateDataSource
      summary: Update a data source
      description: Update a given data source attributes (name and/or retention_days).
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: data_source_id
        description: ID of the data source to update.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.DataSource'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Updated name of the data source.
                  nullable: true
                retention_days:
                  type: integer
                  description: Duration for which the data will be retained in the
                    data source.
                  format: uint32
                  nullable: true
              x-properties-order:
              - name
              - retention_days
      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/cockpit/v1/regions/{region}/data-sources/{data_source_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources/{data_source_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Data sources
      operationId: DeleteDataSource
      summary: Delete a data source
      description: Delete a given data source. Note that this action will permanently
        delete this data source and any data associated with it.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: data_source_id
        description: ID of the data source to delete.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources/{data_source_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/cockpit/v1/regions/{region}/data-sources/{data_source_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /cockpit/v1/regions/{region}/exporters:
    get:
      tags:
      - Data exporter
      operationId: ListExporters
      summary: List data exports
      description: |-
        List all data exports within a given Scaleway Project, specified by its ID.
        Optionally, specify a Scaleway data source ID to retrieve only data exports associated with that data source.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: Project ID to filter for. Only data exports from this Project
          will be returned.
        required: true
        schema:
          type: string
      - in: query
        name: datasource_id
        description: Data source ID to filter for. Only data exports linked to this
          data source will be returned.
        schema:
          type: string
      - in: query
        name: page
        description: Page number to return from the paginated results.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Number of data exports to return per page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Sort order for data exports in the response.
        schema:
          type: string
          enum:
          - created_at_asc
          - created_at_desc
          - name_asc
          - name_desc
          default: created_at_asc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListExportersResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
    post:
      tags:
      - Data exporter
      operationId: CreateExporter
      summary: Create a data export
      description: |-
        Create an export to send your metrics/logs from a Scaleway data source to an external destination.
        Current supported destination for data exports are Datadog and OTLP endpoints.
        This feature is in Beta phase. During Beta phase, exporter can take up to 30 min to be effectively active.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Exporter'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                datasource_id:
                  type: string
                  description: ID of the data source linked to the data export.
                datadog_destination:
                  type: object
                  description: Datadog destination configuration for the data export.
                  properties:
                    api_key:
                      type: string
                      nullable: true
                    endpoint:
                      type: string
                      nullable: true
                  nullable: true
                  x-properties-order:
                  - api_key
                  - endpoint
                  x-one-of: destination
                otlp_destination:
                  type: object
                  description: OTLP destination configuration for the data export.
                  properties:
                    endpoint:
                      type: string
                    headers:
                      type: object
                      properties:
                        <headerKey>:
                          type: string
                      additionalProperties: true
                  nullable: true
                  x-properties-order:
                  - endpoint
                  - headers
                  x-one-of: destination
                exported_products:
                  type: array
                  description: |-
                    The list of products name your data export send to the destination.
                    To include all products in your data export, you can use an array containing "all"
                    You can retrieve the complete list of product names using the `ListProducts` endpoint.
                  items:
                    type: string
                name:
                  type: string
                  description: Name of the data export.
                description:
                  type: string
                  description: Description of the data export.
                  nullable: true
              required:
              - datasource_id
              - exported_products
              - name
              x-properties-order:
              - datasource_id
              - datadog_destination
              - otlp_destination
              - exported_products
              - name
              - description
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "datasource_id": "string",
              "exported_products": [
                  "string"
              ],
              "name": "string"
            }' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters" \
            X-Auth-Token:$SCW_SECRET_KEY \
            datasource_id="string" \
            exported_products:='[
              "string"
            ]' \
            name="string"
  /cockpit/v1/regions/{region}/exporters/{exporter_id}:
    get:
      tags:
      - Data exporter
      operationId: GetExporter
      summary: Get a data export
      description: Retrieve information about a given data export, specified by its
        ID.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: exporter_id
        description: ID of the data export to retrieve.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Exporter'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters/{exporter_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters/{exporter_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Data exporter
      operationId: UpdateExporter
      summary: Update a data export
      description: |-
        Update a data export attributes. Changes are effective immediately even during Beta phase.
        Note that you can not change the data source linked to the export. If you need to do so, you will need to re-create the export.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: exporter_id
        description: ID of the data export to update.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Exporter'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                datadog_destination:
                  type: object
                  description: Updated Datadog destination configuration for the data
                    export.
                  properties:
                    api_key:
                      type: string
                      nullable: true
                    endpoint:
                      type: string
                      nullable: true
                  nullable: true
                  x-properties-order:
                  - api_key
                  - endpoint
                  x-one-of: destination
                otlp_destination:
                  type: object
                  description: Updated OTLP destination configuration for the data
                    export.
                  properties:
                    endpoint:
                      type: string
                    headers:
                      type: object
                      properties:
                        <headerKey>:
                          type: string
                      additionalProperties: true
                  nullable: true
                  x-properties-order:
                  - endpoint
                  - headers
                  x-one-of: destination
                name:
                  type: string
                  description: Updated name of the data export.
                  nullable: true
                description:
                  type: string
                  description: Updated description of the data export.
                  nullable: true
                exported_products:
                  type: array
                  description: |-
                    Updated list of Scaleway products to export.
                    To include all products in your data export, you can use an array containing "all"
                    You can retrieve the complete list of product names using the `ListProducts` endpoint.
                  nullable: true
                  items:
                    type: string
              x-properties-order:
              - datadog_destination
              - otlp_destination
              - name
              - description
              - exported_products
      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/cockpit/v1/regions/{region}/exporters/{exporter_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters/{exporter_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Data exporter
      operationId: DeleteExporter
      summary: Delete a data export
      description: |-
        Delete a given data export, specified by its ID.
        Note that this action will immediately and permanently delete this data exports.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: exporter_id
        description: ID of the data export to update.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters/{exporter_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/cockpit/v1/regions/{region}/exporters/{exporter_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /cockpit/v1/regions/{region}/products:
    get:
      tags:
      - Products
      operationId: ListProducts
      summary: List Scaleway products
      description: |-
        List all Scaleway products that send metrics and/or logs to Cockpit.
        Note that all of those products send at least metrics, but only a subset send logs to Cockpit.
        For more information, see https://www.scaleway.com/en/docs/cockpit/reference-content/cockpit-product-integration/.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        description: Page number to return from the paginated results.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Number of products to return per page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Sort order for products in the response.
        schema:
          type: string
          enum:
          - created_at_asc
          - created_at_desc
          - display_name_asc
          - display_name_desc
          - family_name_asc
          - family_name_desc
          default: created_at_asc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListProductsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/products"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/products" \
            X-Auth-Token:$SCW_SECRET_KEY
  /cockpit/v1/regions/{region}/rules/count:
    get:
      tags:
      - Alert manager
      operationId: GetRulesCount
      summary: Get the number of enabled rules
      description: Get a detailed count of enabled rules in the specified Project.
        Includes preconfigured and custom alerting and recording rules.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: ID of the Project to retrieve the rule count for.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.GetRulesCountResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/rules/count?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/rules/count" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
  /cockpit/v1/regions/{region}/tokens:
    get:
      tags:
      - Tokens
      operationId: ListTokens
      summary: List tokens
      description: |-
        Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order.
        You can filter tokens by Project ID and token scopes.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: ID of the Project the tokens belong to.
        required: true
        schema:
          type: string
      - in: query
        name: token_scopes
        description: Token scopes to filter for.
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Token.Scope'
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Number of tokens to return per page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Order in which to return results.
        schema:
          type: string
          enum:
          - created_at_asc
          - created_at_desc
          - name_asc
          - name_desc
          default: created_at_asc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListTokensResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
    post:
      tags:
      - Tokens
      operationId: CreateToken
      summary: Create a token
      description: |-
        Give your token the relevant scopes to ensure it has the right permissions to interact with your data sources and the Alert manager. Make sure that you create your token in the same regions as the data sources you want to use it for.
        Upon creation, your token's secret key display only once. Make sure that you save it.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Token'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project the token belongs to.
                name:
                  type: string
                  description: Name of the token.
                token_scopes:
                  type: array
                  description: Token permission scopes.
                  items:
                    $ref: '#/components/schemas/scaleway.cockpit.v1.Token.Scope'
              required:
              - project_id
              - name
              x-properties-order:
              - project_id
              - name
              - token_scopes
      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"}' \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens" \
            X-Auth-Token:$SCW_SECRET_KEY \
            name="string" \
            project_id="string"
  /cockpit/v1/regions/{region}/tokens/{token_id}:
    get:
      tags:
      - Tokens
      operationId: GetToken
      summary: Get a token
      description: Retrieve information about a given token, specified by the token
        ID. The token's information such as its scopes, is returned.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: token_id
        description: Token ID.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Token'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens/{token_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens/{token_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Tokens
      operationId: DeleteToken
      summary: Delete a token
      description: Delete a given token, specified by the token ID. Deleting a token
        is irreversible and cannot be undone.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: token_id
        description: ID of the token to delete.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens/{token_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/cockpit/v1/regions/{region}/tokens/{token_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /cockpit/v1/regions/{region}/usage-overview:
    get:
      tags:
      - Data sources
      operationId: GetUsageOverview
      summary: Get data source usage overview
      description: Retrieve the volume of data ingested for each of your data sources
        in the specified project and region.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        required: true
        schema:
          type: string
      - in: query
        name: interval
        description: (in seconds)
        schema:
          type: string
          example: 2.5s
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.UsageOverview'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/regions/{region}/usage-overview?project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/{region}/usage-overview" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==string
