openapi: 3.0.0
info:
  title: Cockpit Global 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 and logs through a Grafana dashboard.
    With Cockpit, you can also push your own data as Scaleway products' data is included
    by default.\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. **Activate your Cockpit.**\n\n    Run the following command
    to activate your Cockpit:\n\n    ```bash\n    curl -X POST \\\n      -H \"X-Auth-Token:
    $SCW_SECRET_KEY\" \\\n      https://api.scaleway.com/cockpit/v1beta1/activate
    \\\n      -H \"Content-Type: application/json\" \\\n      -d '{\"project_id\":
    \"'\"$SCW_PROJECT_ID\"'\"}'\n    ```\n3.  **Build push URLs.**\n\n    Your Cockpit
    has 4 [endpoints](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#endpoints)
    which look like the following:\n\n    ```json\n    {\n        [...],\n        \"endpoints\":
    {\n            \"metrics_url\": \"https://metrics.cockpit.fr-par.scw.cloud\",\n
    \           \"logs_url\": \"https://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        },\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 and logs, you need the **exact
    URL** to use with your **pushers**.\n    </Message>\n\n    - The Prometheus Remote
    Write endpoint to push your metrics is the following: `https://metrics.cockpit.fr-par.scw.cloud/api/v1/push`\n
    \   - The Remote Write endpoint to push your logs is the following: `https://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://traces.cockpit.fr-par.scw.cloud/otlp`.\n\n4.
    **Create your token to push metrics and logs.**\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 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\":
    false\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.
    Metric pushers should only have the `write_metrics` scope, and log pushers the
    `write_logs` one.\n    </Message>\n\n5. **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\n6. **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 activated your Cockpit
    via the [console](https://www.scaleway.com/en/docs/observability/cockpit/how-to/activate-cockpit/)
    or [API](#path-cockpits-activate-a-cockpit)\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: Grafana
  description: |
    Grafana is an open-source analytics and monitoring solution that is used to visualize data available in your Cockpit
    You need to create a Grafana user to access your Cockpit's Grafana. Note that the `admin` username is not available for creation.
    On Grafana you can also interact with the Scaleway and Grafana alert managers and create alert rules.
- name: Pricing Plans
  description: |
    A pricing plan is associated with each Cockpit. Pricing plans give you information on how you are billed for the Cockpit product.
components:
  schemas:
    scaleway.cockpit.v1.Grafana:
      type: object
      properties:
        grafana_url:
          type: string
          description: URL to access your Cockpit's Grafana.
      x-properties-order:
      - grafana_url
    scaleway.cockpit.v1.GrafanaProductDashboard:
      type: object
      properties:
        name:
          type: string
          description: Dashboard name.
        title:
          type: string
          description: Dashboard title.
        url:
          type: string
          description: Dashboard URL.
        tags:
          type: array
          description: Dashboard tags.
          items:
            type: string
        variables:
          type: array
          description: Dashboard variables.
          items:
            type: string
      x-properties-order:
      - name
      - title
      - url
      - tags
      - variables
    scaleway.cockpit.v1.GrafanaUser:
      type: object
      properties:
        id:
          type: integer
          description: ID of the Grafana user.
          format: uint32
        login:
          type: string
          description: Username of the Grafana user.
        role:
          type: string
          description: Role assigned to the Grafana user.
          enum:
          - unknown_role
          - editor
          - viewer
          x-enum-descriptions:
            values:
              unknown_role: Unknown role
              editor: Editor role
              viewer: Viewer role
          default: unknown_role
        password:
          type: string
          description: Grafana user's password.
          nullable: true
      x-properties-order:
      - id
      - login
      - role
      - password
    scaleway.cockpit.v1.ListGrafanaProductDashboardsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of Grafana dashboards.
          format: uint64
        dashboards:
          type: array
          description: Grafana dashboards information.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.GrafanaProductDashboard'
      x-properties-order:
      - total_count
      - dashboards
    scaleway.cockpit.v1.ListGrafanaUsersResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of Grafana users.
          format: uint64
        grafana_users:
          type: array
          description: Grafana users information.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.GrafanaUser'
      x-properties-order:
      - total_count
      - grafana_users
    scaleway.cockpit.v1.ListPlansRequest.OrderBy:
      type: string
      enum:
      - name_asc
      - name_desc
      default: name_asc
    scaleway.cockpit.v1.ListPlansResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total count of available pricing plans.
          format: uint64
        plans:
          type: array
          description: Plan types information.
          items:
            $ref: '#/components/schemas/scaleway.cockpit.v1.Plan'
      x-properties-order:
      - total_count
      - plans
    scaleway.cockpit.v1.Plan:
      type: object
      properties:
        name:
          type: string
          description: Name of a given pricing plan.
          enum:
          - unknown_name
          - free
          - premium
          - custom
          default: unknown_name
        retention_metrics_interval:
          type: string
          description: Interval of time during which Scaleway's Cockpit keeps your
            metrics. (in seconds)
          example: 2.5s
          nullable: true
        retention_logs_interval:
          type: string
          description: Interval of time during which Scaleway's Cockpit keeps your
            logs. (in seconds)
          example: 2.5s
          nullable: true
        retention_traces_interval:
          type: string
          description: Interval of time during which Scaleway's Cockpit keeps your
            traces. (in seconds)
          example: 2.5s
          nullable: true
        sample_ingestion_price:
          type: integer
          description: Ingestion price in cents for 1 million samples.
          format: uint32
        logs_ingestion_price:
          type: integer
          description: Ingestion price in cents for 1 GB of logs.
          format: uint32
        traces_ingestion_price:
          type: integer
          description: Ingestion price in cents for 1 GB of traces.
          format: uint32
        monthly_price:
          type: integer
          description: Retention price in euros per month.
          format: uint32
      x-properties-order:
      - name
      - retention_metrics_interval
      - retention_logs_interval
      - retention_traces_interval
      - sample_ingestion_price
      - logs_ingestion_price
      - traces_ingestion_price
      - monthly_price
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /cockpit/v1/current-plan:
    get:
      tags:
      - Pricing Plans
      operationId: GetCurrentPlan
      summary: Get current plan
      description: |-
        Retrieve a pricing plan for the given Project, specified by the ID of the Project.
        Deprecated, retention is now managed at the data source level.
      parameters:
      - in: query
        name: project_id
        description: ID of the Project. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Plan'
      security:
      - scaleway: []
      deprecated: true
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/current-plan?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/current-plan" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /cockpit/v1/grafana:
    get:
      tags:
      - Grafana
      operationId: GetGrafana
      summary: Get your Cockpit's Grafana
      description: |-
        Retrieve information on your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to.
        The output returned displays the URL to access your Cockpit's Grafana.
      parameters:
      - in: query
        name: project_id
        description: ID of the Project. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Grafana'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/grafana?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/grafana" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /cockpit/v1/grafana/product-dashboards:
    get:
      tags:
      - Grafana
      operationId: ListGrafanaProductDashboards
      summary: List Scaleway resources dashboards
      description: Retrieve a list of available dashboards in Grafana, for all Scaleway
        resources which are integrated with Cockpit.
      parameters:
      - in: query
        name: project_id
        description: ID of the Project to target. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project to target. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          description: Page number.
          format: int32
      - in: query
        name: page_size
        description: Page size.
        schema:
          type: integer
          description: Page size.
          format: uint32
      - in: query
        name: tags
        description: Tags to filter for.
        schema:
          type: array
          description: Tags to filter for.
          items:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListGrafanaProductDashboardsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/grafana/product-dashboards?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/grafana/product-dashboards" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /cockpit/v1/grafana/product-dashboards/{dashboard_name}:
    get:
      tags:
      - Grafana
      operationId: GetGrafanaProductDashboard
      summary: Get Scaleway resource dashboard
      description: Retrieve information about the dashboard of a Scaleway resource
        in Grafana, specified by the ID of the Project the Cockpit belongs to, and
        the name of the dashboard.
      parameters:
      - in: path
        name: dashboard_name
        description: Name of the dashboard.
        required: true
        schema:
          type: string
          description: Name of the dashboard.
      - in: query
        name: project_id
        description: ID of the Project the dashboard belongs to. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project the dashboard belongs to. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.GrafanaProductDashboard'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/grafana/product-dashboards/{dashboard_name}?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/grafana/product-dashboards/{dashboard_name}" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /cockpit/v1/grafana/sync-data-sources:
    post:
      tags:
      - Grafana
      operationId: SyncGrafanaDataSources
      summary: Synchronize Grafana data sources
      description: Trigger the synchronization of all your data sources and the alert
        manager in the relevant regions. The alert manager will only be synchronized
        if you have enabled it.
      responses:
        "204":
          description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project to target. (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/grafana/sync-data-sources"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/grafana/sync-data-sources" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /cockpit/v1/grafana/users:
    get:
      tags:
      - Grafana
      operationId: ListGrafanaUsers
      summary: List Grafana users
      description: List all Grafana users created in your Cockpit's Grafana. By default,
        the Grafana users returned in the list are ordered in ascending order.
      parameters:
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          description: Page number.
          format: int32
      - in: query
        name: page_size
        description: Page size.
        schema:
          type: integer
          description: Page size.
          format: uint32
      - in: query
        name: order_by
        description: Order of the Grafana users.
        schema:
          type: string
          description: Order of the Grafana users.
          enum:
          - login_asc
          - login_desc
          default: login_asc
      - in: query
        name: project_id
        description: ID of the Project to target. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project to target. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListGrafanaUsersResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/grafana/users?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/grafana/users" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
    post:
      tags:
      - Grafana
      operationId: CreateGrafanaUser
      summary: Create a Grafana user
      description: |-
        Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
        Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the `admin` username is not available for creation.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.GrafanaUser'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project in which to create the Grafana user.
                    (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                login:
                  type: string
                  description: Username of the Grafana user. Note that the `admin`
                    username is not available for creation.
                role:
                  type: string
                  description: Role assigned to the Grafana user.
                  enum:
                  - unknown_role
                  - editor
                  - viewer
                  x-enum-descriptions:
                    values:
                      unknown_role: Unknown role
                      editor: Editor role
                      viewer: Viewer role
                  default: unknown_role
              x-properties-order:
              - project_id
              - login
              - role
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"login":"string","project_id":"6170692e-7363-616c-6577-61792e636f6d"}' \
            "https://api.scaleway.com/cockpit/v1/grafana/users"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/grafana/users" \
            X-Auth-Token:$SCW_SECRET_KEY \
            login="string" \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /cockpit/v1/grafana/users/{grafana_user_id}:
    delete:
      tags:
      - Grafana
      operationId: DeleteGrafanaUser
      summary: Delete a Grafana user
      description: Delete a Grafana user from your Cockpit's Grafana, specified by
        the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
      parameters:
      - in: path
        name: grafana_user_id
        description: ID of the Grafana user.
        required: true
        schema:
          type: integer
          description: ID of the Grafana user.
          format: uint32
      - in: query
        name: project_id
        description: ID of the Project to target. (UUID format)
        required: true
        schema:
          type: string
          description: ID of the Project to target. (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/grafana/users/{grafana_user_id}?project_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/cockpit/v1/grafana/users/{grafana_user_id}" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id==6170692e-7363-616c-6577-61792e636f6d
  /cockpit/v1/grafana/users/{grafana_user_id}/reset-password:
    post:
      tags:
      - Grafana
      operationId: ResetGrafanaUserPassword
      summary: Reset a Grafana user password
      description: |-
        Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.
        A new password regenerates and only displays once. Make sure that you save it.
      parameters:
      - in: path
        name: grafana_user_id
        description: ID of the Grafana user.
        required: true
        schema:
          type: integer
          description: ID of the Grafana user.
          format: uint32
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.GrafanaUser'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: ID of the Project to target. (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/grafana/users/{grafana_user_id}/reset-password"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/cockpit/v1/grafana/users/{grafana_user_id}/reset-password" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
  /cockpit/v1/plans:
    get:
      tags:
      - Pricing Plans
      operationId: ListPlans
      summary: List plan types
      description: |-
        Retrieve a list of available pricing plan types.
        Deprecated, retention is now managed at the data source level.
      parameters:
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          description: Page number.
          format: int32
      - in: query
        name: page_size
        description: Page size.
        schema:
          type: integer
          description: Page size.
          format: uint32
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.cockpit.v1.ListPlansRequest.OrderBy'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.ListPlansResponse'
      security:
      - scaleway: []
      deprecated: true
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/cockpit/v1/plans"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/cockpit/v1/plans" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Pricing Plans
      operationId: SelectPlan
      summary: Apply a pricing plan
      description: |-
        Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.
        Deprecated, retention is now managed at the data source level.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.cockpit.v1.Plan'
      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
                plan_name:
                  type: string
                  description: Name of the pricing plan.
                  enum:
                  - unknown_name
                  - free
                  - premium
                  - custom
                  default: unknown_name
              x-properties-order:
              - project_id
              - plan_name
      security:
      - scaleway: []
      deprecated: true
      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/plans"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/cockpit/v1/plans" \
            X-Auth-Token:$SCW_SECRET_KEY \
            project_id="6170692e-7363-616c-6577-61792e636f6d"
