openapi: 3.0.0
info:
  title: Cockpit Regional 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).\n\nThe
    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/).\n\nYou
    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/)
    or [Logstash](https://www.elastic.co/guide/en/logstash/current/introduction.html).\n\n(switchcolumn)\n<Message
    type=\"note\">\nThis API concerns the Cockpit service.\n</Message>\n(switchcolumn)\n\n##
    Concepts\n\nRefer 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.\n\n(switchcolumn)\n(switchcolumn)\n##
    Quickstart\n\n1. **Configure your environment variables.**\n\n    <Message type=\"note\">\n
    \   This is an optional step that seeks to simplify your usage of the API.\n    </Message>\n\n
    \   ```bash\n    export SCW_SECRET_KEY=\"<API secret key>\"\n    export SCW_PROJECT_ID=\"<Scaleway
    Project ID>\n    ```\n2.  **Build push URLs.**\n\n    Retrieve your [endpoints](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#endpoints)
    for metrics, logs, and traces from the [Data sources tab](https://console.scaleway.com/cockpit/dataSource)
    of the Scaleway console. Your endpoints should look like the following:\n\n    ```json\n
    \   {\n        [...],\n        \"endpoints\": {\n            \"metrics_url\":
    \"https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud\",\n
    \           \"logs_url\": \"https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.logs.cockpit.fr-par.scw.cloud\",\n
    \           \"alertmanager_url\": \"https://alertmanager.cockpit.fr-par.scw.cloud\",\n
    \           \"grafana_url\": \"<project_id>.dashboard.obs.fr-par.scw.cloud\",\n
    \           \"traces_url\": \"https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.traces.cockpit.fr-par.scw.cloud\"\n
    \       },\n        [...]\n    }\n    ```\n\n    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.\n\n    <Message type=\"important\">\n    To be able
    to send metrics, logs, and traces, you need the **exact URL** to use with your
    **pushers**. You can find the URL from the [Data sources tab](https://console.scaleway.com/cockpit/dataSource)
    of the Scaleway console.\n    </Message>\n\n    - 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`\n
    \   - 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`\n
    \   - The Prometheus Alertmanager endpoint is the following: `https://alertmanager.cockpit.fr-par.scw.cloud/alertmanager`\n
    \   - 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..cockpit.fr-par.scw.cloud/otlp`.\n\n3.
    **Create your token to push metrics, logs, and traces.**\n\n    Find out [how
    to create your token via the console](https://www.scaleway.com/en/docs/observability/cockpit/how-to/create-token/)
    or run the following command to create your token via the API.\n\n    ```bash\n
    \   curl -X POST \\\n    \"https://api.scaleway.com/cockpit/v1beta1/tokens\" \\\n
    \   -H \"Content-Type: application/json\" \\\n    -H \"X-Auth-Token: $SCW_SECRET_KEY\"
    \\\n    -d '{\n      \"project_id\": \"00000000-0000-0000-0000-000000000000\",\n
    \     \"name\": \"token-name\",\n      \"scopes\": {\n        \"query_metrics\":
    false,\n        \"write_metrics\": true,\n        \"setup_metrics_rules\": false,\n
    \       \"query_logs\": false,\n        \"write_logs\": true,\n        \"setup_logs_rules\":
    false,\n        \"setup_alerts\": false,\n        \"query_traces\": false,\n        \"write_traces\":
    true\n      }\n    }'\n    ```\n\n    <Message type=\"important\">\n      Your
    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.\n
    \   </Message>\n\n4. **Configure the Grafana agent.**\n\n    Find out [how to
    configure, start the Grafana agent and see your metrics and logs](https://www.scaleway.com/en/docs/observability/cockpit/api-cli/configuring-grafana-agent/)
    in our documentation.\n\n    <Message type=\"note\">\n    The promtail configuration
    for the logs does not support custom headers. The `tenant_id` field corresponds
    to the header `X-Scope-OrgID` which\n    is one of the supported headers. For
    more details on the different supported headers, see our [troubleshooting documentation
    for when your pusher does not support custom HTTP headers](https://www.scaleway.com/en/docs/observability/cockpit/troubleshooting/pusher-does-not-support-custom-http-headers/).\n
    \   </Message>\n\n5. **Configure rules and alerts.**\n\n    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.\n\n    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.\n\n    <Message type=\"important\">\n    For the alerts
    and rules to be created in your Cockpit, you must use the data sources provided
    by Scaleway.\n    </Message>\n\n    <Message type=\"important\">\n    Make sure
    that you select `Scaleway Alerting` as your alert manager when configuring  as
    the alerts are managed by the platform. If you use `Grafana` you will work with
    the local alert manager which is deactivated.\n    </Message>\n\n(switchcolumn)\n<Message
    type=\"requirement\">\n\n - You have a [Scaleway account](https://console.scaleway.com/)\n
    - You have [created an API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/)
    and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/identity-and-access-management/iam/reference-content/permission-sets/)
    to perform the actions described on this page\n - You have [installed `curl`](https://curl.se/download.html)\n
    - You have [installed docker](https://www.docker.com/)\n - You have [installed
    docker compose](https://docs.docker.com/compose/install/)\n - You have a Linux
    machine to run the container on. You can still run the container on macOS or Windows,
    but your logs will not be available in your Cockpit.\n</Message>\n(switchcolumn)\n\n##
    Technical information\n\n### Regional availability\n\nScaleway's infrastructure
    is spread across different [regions and Availability Zones](https://www.scaleway.com/en/docs/console/account/reference-content/organization-quotas/).\nYour
    Cockpit resources are available in the Paris, Amsterdam and Warsaw regions.\n\n###
    Current supported endpoints\n\n- The current supported endpoints for metrics are
    the following. For more information about the endpoints, refer to the [Mimir documentation](https://grafana.com/docs/mimir/latest/references/http-api/)\n
    \   ```\n    # Remote write endpoints\n    path /api/v1/push\n\n    # Query endpoints\n
    \   path /prometheus/api/v1/query\n    path /prometheus/api/v1/query_range\n    path
    /prometheus/api/v1/query_exemplars\n    path /prometheus/api/v1/series\n    path
    /prometheus/api/v1/labels\n    path /prometheus/api/v1/label/*\n    path /prometheus/api/v1/metadata\n
    \   path /prometheus/api/v1/read\n    path /prometheus/api/v1/status/buildinfo\n
    \   \n  # Ruler endpoints\n    path /prometheus/api/v1/rules\n    path /prometheus/api/v1/alerts\n
    \   path /prometheus/config/v1/rules\n    path /prometheus/config/v1/rules/*\n
    \   ```\n- The current supported endpoints for logs are the following. For more
    information about the endpoints, refer to the [Loki documentation](https://grafana.com/docs/loki/latest/api/)\n
    \   ```\n    # Remote write endpoints\n    path /loki/api/v1/push\n    \n    #
    Query endpoints\n    path /loki/api/v1/query\n    path /loki/api/v1/query_range\n
    \   path /loki/api/v1/labels\n    path /loki/api/v1/label\n    path /loki/api/v1/label/*\n
    \   path /loki/api/v1/tail\n    path /loki/api/v1/series\n    \n    # Ruler endpoints\n
    \   path /loki/api/v1/rules\n    path /loki/api/v1/rules/*\n    path /api/prom/rules\n
    \   path /api/prom/rules/*\n    path /prometheus/api/v1/rules\n    path /prometheus/api/v1/alerts\n
    \   ```\n- The current supported endpoints for the alert manager are the following.
    For more information on the endpoints, refer to the [Prometheus documentation](https://prometheus.io/docs/prometheus/latest/querying/api/#alerts)\n\n
    \   ```\n    # Prometheus alertmanager\n    path /alertmanager/* \n  \n    # Alertmanager
    configuration (see Mimir doc)\n    path /api/v1/alerts\n    ```\n### Troubleshooting\n\nRefer
    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 you want to [reset your Grafana password.](https://www.scaleway.com/en/docs/observability/cockpit/troubleshooting/resetting-grafana-password-via-the-api/)\n\n##
    Technical limitations\n\n- Metrics and logs data is retained **31 days**. After
    this period, data older than 31 days is deleted.\n- The number of **active metrics
    time series** is limited to **250,000 per Cockpit** by default.\n- The number
    of **active log streams** is limited to **5000 per Cockpit**.\n- It is not yet
    possible to downsample metrics.\n\n\n## Going further\n\nFor more information
    about Cockpit, you can check out the following pages:\n\n- [Cockpit Documentation](https://www.scaleway.com/en/docs/observability/cockpit/)\n-
    [Scaleway Slack Community](http://slack.scaleway.com) join the #observability-beta
    and the #observability channels\n- [Contact our support team](https://console.scaleway.com/support/tickets)\n\n###
    External links\n\nIf you are interested in learning more, you can check out the
    following pages:\n\n- [Introduction to Prometheus](https://prometheus.io/docs/introduction/overview/).
    This page gives a general introduction to what Prometheus is.\n- [Introduction
    to Promtail](https://grafana.com/docs/loki/latest/clients/promtail/). Promtail
    is an agent that collects and forwards logs to a Grafana Loki instance.\n- [Introduction
    to Grafana Agent](https://grafana.com/docs/grafana-cloud/agent/). Grafana Agent
    is an agent that embeds multiple other agents like Prometheus or Promtail.\n-
    [Pushing logs using Fluentbit](https://docs.fluentbit.io/manual/pipeline/outputs/loki).
    Fluentbit is another commonly used agent that collects and forwards logs.\n- [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.\n- [Prometheus remote write configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write).
    This page gives the exact configuration parameters that can be used to configure
    Prometheus's remote-write.\n- [Prometheus data model](https://prometheus.io/docs/concepts/data_model/).
    This page explains the Prometheus data model to help understand the concepts of
    metrics, time series, labels and samples, and how they work together.\n- [Article
    on Prometheus label cardinality and performance](https://www.robustperception.io/cardinality-is-key).
    When working with metrics, the cardinality, which is the number time series for
    a given metric, is extremely important. This article explains why.\n- [Integrations
    supported by Grafana Agent](https://grafana.com/docs/agent/latest/configuration/integrations/).
    Grafana Agent has many other embedded agents that can be used to monitor various
    software, like PostgreSQL or MongoDB. All of them can be found on the left menu
    of this page.\n- [Introduction to alerting using Prometheus](https://prometheus.io/docs/alerting/latest/overview/)\n-
    [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/)\n-
    [How to manage alerting rules using Grafana](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/alerting-rules/rule-list/)\n-
    [How to manage contact points using Grafana](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/contact-points/)\n-
    [How to manage notification policies using Grafana](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/notifications/)\n-
    [How to manage silences using Grafana](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/silences/)."
  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 from external sources.
- 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 by region
    Once you have enabled the Alert manager in your desired regions, you can create contact points and enable managed alerts. Your contact points will be notified when your Scaleway resources in the same regions as the Alert manager, may require your attention.
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.
        enabled:
          type: boolean
          description: Indicates if the alert is enabled or disabled. Only preconfigured
            alerts can be disabled.
        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
          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.
          x-properties-order:
          - preconfigured_rule_id
          - display_name
          - display_description
      x-properties-order:
      - region
      - preconfigured
      - name
      - rule
      - duration
      - enabled
      - state
      - annotations
      - preconfigured_data
    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: BETA - Duration for which the data will be retained in the
            data source.
          format: uint32
        region:
          type: string
          description: Region of the data source.
      x-properties-order:
      - id
      - project_id
      - name
      - url
      - type
      - origin
      - created_at
      - updated_at
      - synchronized_with_grafana
      - retention_days
      - region
    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: (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: (UUID format)
          example:
          - 6170692e-7363-616c-6577-61792e636f6d
          items:
            type: string
      x-properties-order:
      - enabled_rule_ids
    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.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.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.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
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: Project ID of the requested Alert manager. (UUID format)
        required: true
        schema:
          type: string
          description: Project ID of the requested Alert manager. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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/fr-par/alert-manager?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /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
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          description: Page number to return, from the paginated results.
          format: int32
      - in: query
        name: page_size
        description: Total count of contact points to return per page.
        schema:
          type: integer
          description: Total count of contact points to return per page.
          format: uint32
      - in: query
        name: project_id
        description: ID of the Project containing the contact points to list. (UUID
          format)
        required: true
        schema:
          type: string
          description: ID of the Project containing the contact points to list. (UUID
            format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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/fr-par/alert-manager/contact-points?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
    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
          description: The region you want to target
          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. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                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.
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
    patch:
      operationId: UpdateContactPoint
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          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.
                    (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                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.
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          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.
                    (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                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
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points/delete"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points/delete" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          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.
                    (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/disable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/disable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /cockpit/v1/regions/{region}/alert-manager/disable-alert-rules:
    post:
      tags:
      - Alert manager
      operationId: DisableAlertRules
      summary: Disable preconfigured alert rules. 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
          description: The region you want to target
          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: (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                rule_ids:
                  type: array
                  description: (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/disable-alert-rules"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/disable-alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          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. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/enable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/enable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /cockpit/v1/regions/{region}/alert-manager/enable-alert-rules:
    post:
      tags:
      - Alert manager
      operationId: EnableAlertRules
      summary: Enable preconfigured alert rules. 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
          description: The region you want to target
          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: (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                rule_ids:
                  type: array
                  description: (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/enable-alert-rules"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/enable-alert-rules" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          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. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/managed-alerts/disable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/managed-alerts/disable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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 recources integrated
        with Cockpit by default.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          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. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/managed-alerts/enable"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/managed-alerts/enable" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          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. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/trigger-test-alert"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/trigger-test-alert" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          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. (UUID format)
        required: true
        schema:
          type: string
          description: Project ID to filter for, only alerts from this Project will
            be returned. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: is_enabled
        description: |-
          Filter alerts based on their enabled status. Optional.
          True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply.
        schema:
          type: boolean
          description: |-
            Filter alerts based on their enabled status. Optional.
            True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply.
      - 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
          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.
      - 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
          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.
          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
      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/fr-par/alerts?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/alerts" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /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
          description: The region you want to target
          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/fr-par/config"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/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.
        You can list data sources by Project, type and origin.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          description: Page number to return, from the paginated results.
          format: int32
      - in: query
        name: page_size
        description: Number of data sources to return per page.
        schema:
          type: integer
          description: Number of data sources to return per page.
          format: uint32
      - in: query
        name: order_by
        description: Sort order for data sources in the response.
        schema:
          type: string
          description: Sort order for data sources in the response.
          enum:
          - created_at_asc
          - created_at_desc
          - name_asc
          - name_desc
          - type_asc
          - type_desc
          default: created_at_asc
      - in: query
        name: project_id
        description: Project ID to filter for, only data sources from this Project
          will be returned. (UUID format)
        required: true
        schema:
          type: string
          description: Project ID to filter for, only data sources from this Project
            will be returned. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: origin
        description: Origin to filter for, only data sources with matching origin
          will be returned.
        schema:
          type: string
          description: Origin to filter for, only data sources with matching origin
            will be returned.
          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, only data sources with matching types will
          be returned.
        schema:
          type: array
          description: Types to filter for, only data sources with matching types
            will be returned.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.DataSource.Type'
      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/fr-par/data-sources?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Data sources
      operationId: CreateDataSource
      summary: Create a data source
      description: |-
        You must specify the data source type upon creation. Available data source types include:
          - metrics
          - logs
          - traces
        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
          description: The region you want to target
          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. (UUID
                    format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                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: |-
                    BETA - Duration for which the data will be retained in the data source.
                    Default values are 30 days for metrics, 7 days for logs and traces.
                  format: uint32
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources" \
            X-Auth-Token:$SCW_SECRET_KEY \
            name="string" \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: data_source_id
        description: ID of the relevant data source. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the relevant data source. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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/fr-par/data-sources/{data_source_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/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 name, specified by the data source ID.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: data_source_id
        description: ID of the data source to update. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the data source to update. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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: BETA - Duration for which the data will be retained
                    in the data source.
                  format: uint32
              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/fr-par/data-sources/{data_source_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/cockpit/v1/regions/fr-par/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, specified by the data source ID. Note
        that deleting a data source is irreversible, and cannot be undone.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: data_source_id
        description: ID of the data source to delete. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the data source to delete. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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/fr-par/data-sources/{data_source_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/{data_source_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /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
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          description: Page number to return, from the paginated results.
          format: int32
      - in: query
        name: page_size
        description: Number of tokens to return per page.
        schema:
          type: integer
          description: Number of tokens to return per page.
          format: uint32
      - in: query
        name: order_by
        description: Order in which to return results.
        schema:
          type: string
          description: Order in which to return results.
          enum:
          - created_at_asc
          - created_at_desc
          - name_asc
          - name_desc
          default: created_at_asc
      - in: query
        name: project_id
        description: ID of the Project the tokens belong to. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project the tokens belong to. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: token_scopes
        description: Token scopes to filter for.
        schema:
          type: array
          description: Token scopes to filter for.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Token.Scope'
      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/fr-par/tokens?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/tokens" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
    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
          description: The region you want to target
          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. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                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'
              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":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/regions/fr-par/tokens"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/regions/fr-par/tokens" \
            X-Auth-Token:$SCW_SECRET_KEY \
            name="string" \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /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
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: token_id
        description: Token ID. (UUID format)
        required: true
        schema:
          type: string
          description: Token ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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/fr-par/tokens/{token_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/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
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: token_id
        description: ID of the token to delete. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the token to delete. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      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/fr-par/tokens/{token_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/cockpit/v1/regions/fr-par/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 data source usage overview per type for the specified
        Project.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: project_id
        description: (UUID format)
        required: true
        schema:
          type: string
          description: (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: interval
        description: (in seconds)
        schema:
          type: string
          description: (in seconds)
          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/fr-par/usage-overview?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/regions/fr-par/usage-overview" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
