openapi: 3.0.0
info:
  title: Serverless Jobs API
  description: |-
    Serverless Jobs is a fully managed solution that enables you to plan, schedule, and run batch processing workloads without needing to provision or scale any infrastructure. Each job is run from a job definition, which includes the image used to run the job, as well as its resources.

    ## Concepts

    Refer to our [dedicated concepts](https://www.scaleway.com/en/docs/serverless/jobs/concepts/) page to find definitions of all terminology related to Scaleway Serverless Jobs.

    ## Quickstart

    <Message type="note">
      For jobs concepts and advanced documentation, please refer to [Scaleway Quickstart for Jobs](https://www.scaleway.com/en/docs/serverless/jobs/quickstart/).
    </Message>

    ## Technical information

    ### Regions

    Serverless Jobs is available in the Paris, Amsterdam and Warsaw regions, which are represented by the following path parameters:

    - `fr-par`
    - `nl-ams`
    - `pl-waw`

    ## Going further

    For more information on Scaleway Serverless Jobs, check out the following resources:

    - Our [main documentation](https://www.scaleway.com/en/docs/serverless/jobs/)
    - The `#serverless-jobs` channel on our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/)
    - Our [support ticketing system](https://www.scaleway.com/en/docs/console/my-account/how-to/open-a-support-ticket).
  version: v1alpha1
servers:
- url: https://api.scaleway.com
tags:
- name: Job definitions
  description: A Job definition is a template for a Serverless Job. It contains all
    the information necessary to run the job, including the container image used,
    the resources allocated, and the command to execute. The definition acts as a
    blueprint for job runs
- name: Job runs
  description: A job run is the execution of a job definition. It can be in a running,
    succeeded, canceled, or failed status. Each job run has a unique identifier and
    can be individually monitored using Cockpit
- name: Secrets
  description: A secret reference is a logical reference to a secret stored in Scaleway
    Secret Manager, and it can only be managed within the context of a job definition.
components:
  schemas:
    google.protobuf.Int32Value:
      type: integer
      format: int32
      nullable: true
    google.protobuf.StringValue:
      type: string
      nullable: true
    scaleway.serverless_jobs.v1alpha1.CreateJobDefinitionSecretsRequest.SecretConfig:
      type: object
      properties:
        secret_manager_id:
          type: string
        secret_manager_version:
          type: string
        path:
          type: string
          nullable: true
          x-one-of: path_or_env_var
        env_var_name:
          type: string
          nullable: true
          x-one-of: path_or_env_var
      x-properties-order:
      - secret_manager_id
      - secret_manager_version
      - path
      - env_var_name
    scaleway.serverless_jobs.v1alpha1.CreateJobDefinitionSecretsResponse:
      type: object
      properties:
        secrets:
          type: array
          description: List of secrets created.
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.Secret'
      x-properties-order:
      - secrets
    scaleway.serverless_jobs.v1alpha1.CronSchedule:
      type: object
      properties:
        schedule:
          type: string
          description: UNIX cron schedule to run job (e.g., '* * * * *').
        timezone:
          type: string
          description: Timezone for the cron schedule, in tz database format (e.g.,
            'Europe/Paris').
      required:
      - schedule
      - timezone
      x-properties-order:
      - schedule
      - timezone
    scaleway.serverless_jobs.v1alpha1.JobDefinition:
      type: object
      properties:
        id:
          type: string
          description: (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
        created_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        cpu_limit:
          type: integer
          format: uint32
        memory_limit:
          type: integer
          format: uint32
        image_uri:
          type: string
        command:
          type: string
        project_id:
          type: string
          description: (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        environment_variables:
          type: object
          properties:
            <environment_variableKey>:
              type: string
          additionalProperties: true
        description:
          type: string
        job_timeout:
          type: string
          description: (in seconds)
          example: 2.5s
          nullable: true
        cron_schedule:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.CronSchedule'
        local_storage_capacity:
          type: integer
          format: uint32
        region:
          type: string
          description: The region you want to target
      x-properties-order:
      - id
      - name
      - created_at
      - updated_at
      - cpu_limit
      - memory_limit
      - image_uri
      - command
      - project_id
      - environment_variables
      - description
      - job_timeout
      - cron_schedule
      - local_storage_capacity
      - region
    scaleway.serverless_jobs.v1alpha1.JobRun:
      type: object
      properties:
        id:
          type: string
          description: (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        job_definition_id:
          type: string
          description: (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        state:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobRun.State'
        created_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        terminated_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        exit_code:
          $ref: '#/components/schemas/google.protobuf.Int32Value'
        run_duration:
          type: string
          description: (in seconds)
          example: 2.5s
          nullable: true
        error_message:
          type: string
        cpu_limit:
          type: integer
          format: uint32
        memory_limit:
          type: integer
          format: uint32
        command:
          type: string
        environment_variables:
          type: object
          properties:
            <environment_variableKey>:
              type: string
          additionalProperties: true
        local_storage_capacity:
          type: integer
          format: uint32
        started_at:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        region:
          type: string
          description: The region you want to target
      x-properties-order:
      - id
      - job_definition_id
      - state
      - created_at
      - updated_at
      - terminated_at
      - exit_code
      - run_duration
      - error_message
      - cpu_limit
      - memory_limit
      - command
      - environment_variables
      - local_storage_capacity
      - started_at
      - region
    scaleway.serverless_jobs.v1alpha1.JobRun.State:
      type: string
      enum:
      - unknown_state
      - queued
      - scheduled
      - running
      - succeeded
      - failed
      - canceled
      - internal_error
      default: unknown_state
    scaleway.serverless_jobs.v1alpha1.ListJobDefinitionSecretsResponse:
      type: object
      properties:
        secrets:
          type: array
          description: List of secret references within a job definition.
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.Secret'
        total_count:
          type: integer
          description: Total count of secret references within a job definition.
          format: uint64
      x-properties-order:
      - secrets
      - total_count
    scaleway.serverless_jobs.v1alpha1.ListJobDefinitionsRequest.OrderBy:
      type: string
      enum:
      - created_at_asc
      - created_at_desc
      default: created_at_asc
    scaleway.serverless_jobs.v1alpha1.ListJobDefinitionsResponse:
      type: object
      properties:
        job_definitions:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobDefinition'
        total_count:
          type: integer
          format: uint64
      x-properties-order:
      - job_definitions
      - total_count
    scaleway.serverless_jobs.v1alpha1.ListJobRunsRequest.OrderBy:
      type: string
      enum:
      - created_at_asc
      - created_at_desc
      default: created_at_asc
    scaleway.serverless_jobs.v1alpha1.ListJobRunsResponse:
      type: object
      properties:
        job_runs:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobRun'
        total_count:
          type: integer
          format: uint64
      x-properties-order:
      - job_runs
      - total_count
    scaleway.serverless_jobs.v1alpha1.Secret:
      type: object
      properties:
        secret_id:
          type: string
          description: UUID of the secret reference within the job.
        secret_manager_id:
          type: string
          description: UUID of the secret in Secret Manager.
        secret_manager_version:
          type: string
          description: Version of the secret in Secret Manager.
        file:
          type: object
          description: File secret mounted inside the job.
          properties:
            path:
              type: string
          nullable: true
          x-properties-order:
          - path
          x-one-of: secret_config
        env_var:
          type: object
          description: Environment variable used to expose the secret.
          properties:
            name:
              type: string
          nullable: true
          x-properties-order:
          - name
          x-one-of: secret_config
      x-properties-order:
      - secret_id
      - secret_manager_id
      - secret_manager_version
      - file
      - env_var
    scaleway.serverless_jobs.v1alpha1.StartJobDefinitionResponse:
      type: object
      properties:
        job_runs:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobRun'
      x-properties-order:
      - job_runs
    scaleway.serverless_jobs.v1alpha1.UpdateJobDefinitionRequest.CronScheduleConfig:
      type: object
      properties:
        schedule:
          type: string
        timezone:
          type: string
      x-properties-order:
      - schedule
      - timezone
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /serverless-jobs/v1alpha1/regions/{region}/job-definitions:
    get:
      tags:
      - Job definitions
      operationId: ListJobDefinitions
      summary: List all your job definitions with filters
      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
        schema:
          $ref: '#/components/schemas/google.protobuf.Int32Value'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.ListJobDefinitionsRequest.OrderBy'
      - in: query
        name: project_id
        schema:
          $ref: '#/components/schemas/google.protobuf.StringValue'
      - in: query
        name: organization_id
        schema:
          $ref: '#/components/schemas/google.protobuf.StringValue'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.ListJobDefinitionsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions" \
            X-Auth-Token:$SCW_SECRET_KEY
    post:
      tags:
      - Job definitions
      operationId: CreateJobDefinition
      summary: Create a new job definition in a 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.serverless_jobs.v1alpha1.JobDefinition'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the job definition.
                cpu_limit:
                  type: integer
                  description: CPU limit of the job.
                  format: uint32
                memory_limit:
                  type: integer
                  description: Memory limit of the job (in MiB).
                  format: uint32
                local_storage_capacity:
                  type: integer
                  description: Local storage capacity of the job (in MiB).
                  format: uint32
                  nullable: true
                image_uri:
                  type: string
                  description: Image to use for the job.
                command:
                  type: string
                  description: Startup command. If empty or not defined, the image's
                    default command is used.
                project_id:
                  type: string
                  description: UUID of the Scaleway Project containing the job.
                environment_variables:
                  type: object
                  description: Environment variables of the job.
                  properties:
                    <environment_variableKey>:
                      type: string
                  additionalProperties: true
                description:
                  type: string
                  description: Description of the job.
                job_timeout:
                  type: string
                  description: Timeout of the job in seconds. (in seconds)
                  example: 2.5s
                  nullable: true
                cron_schedule:
                  type: object
                  description: Configure a cron for the job.
                  properties:
                    schedule:
                      type: string
                    timezone:
                      type: string
                  x-properties-order:
                  - schedule
                  - timezone
              required:
              - name
              - cpu_limit
              - memory_limit
              - image_uri
              - project_id
              x-properties-order:
              - name
              - cpu_limit
              - memory_limit
              - local_storage_capacity
              - image_uri
              - command
              - project_id
              - environment_variables
              - description
              - job_timeout
              - cron_schedule
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "command": "string",
              "cpu_limit": 42,
              "description": "string",
              "environment_variables": {
                  "\u003cenvironment_variableKey\u003e": "string"
              },
              "image_uri": "string",
              "memory_limit": 42,
              "name": "string",
              "project_id": "string"
            }' \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions" \
            X-Auth-Token:$SCW_SECRET_KEY \
            command="string" \
            cpu_limit:=42 \
            description="string" \
            environment_variables:='{
              "\u003cenvironment_variableKey\u003e": "string"
            }' \
            image_uri="string" \
            memory_limit:=42 \
            name="string" \
            project_id="string"
  /serverless-jobs/v1alpha1/regions/{region}/job-definitions/{job_definition_id}:
    get:
      tags:
      - Job definitions
      operationId: GetJobDefinition
      summary: Get a job definition by its unique identifier
      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: job_definition_id
        description: UUID of the job definition to get.
        required: true
        schema:
          type: string
          description: UUID of the job definition to get.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobDefinition'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Job definitions
      operationId: UpdateJobDefinition
      summary: Update an existing job definition associated with the specified unique
        identifier
      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: job_definition_id
        description: UUID of the job definition to update.
        required: true
        schema:
          type: string
          description: UUID of the job definition to update.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobDefinition'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the job definition.
                  nullable: true
                cpu_limit:
                  type: integer
                  description: CPU limit of the job.
                  format: uint32
                  nullable: true
                memory_limit:
                  type: integer
                  description: Memory limit of the job (in MiB).
                  format: uint32
                  nullable: true
                local_storage_capacity:
                  type: integer
                  description: Local storage capacity of the job (in MiB).
                  format: uint32
                  nullable: true
                image_uri:
                  type: string
                  description: Image to use for the job.
                  nullable: true
                command:
                  type: string
                  description: Startup command.
                  nullable: true
                environment_variables:
                  type: object
                  description: Environment variables of the job.
                  properties:
                    <key>:
                      type: string
                  nullable: true
                description:
                  type: string
                  description: Description of the job.
                  nullable: true
                job_timeout:
                  type: string
                  description: Timeout of the job in seconds. (in seconds)
                  example: 2.5s
                  nullable: true
                cron_schedule:
                  $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.UpdateJobDefinitionRequest.CronScheduleConfig'
              x-properties-order:
              - name
              - cpu_limit
              - memory_limit
              - local_storage_capacity
              - image_uri
              - command
              - environment_variables
              - description
              - job_timeout
              - cron_schedule
      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/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Job definitions
      operationId: DeleteJobDefinition
      summary: Delete an exsisting job definition by its unique identifier
      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: job_definition_id
        description: UUID of the job definition to delete.
        required: true
        schema:
          type: string
          description: UUID of the job definition to delete.
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha1/regions/{region}/job-definitions/{job_definition_id}/secrets:
    get:
      tags:
      - Secrets
      operationId: ListJobDefinitionSecrets
      summary: List secrets references within a job definition
      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: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
          description: UUID of the job definition.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.ListJobDefinitionSecretsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets" \
            X-Auth-Token:$SCW_SECRET_KEY
    post:
      tags:
      - Secrets
      operationId: CreateJobDefinitionSecrets
      summary: Create a secret reference within a job definition
      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: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
          description: UUID of the job definition.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.CreateJobDefinitionSecretsResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                secrets:
                  type: array
                  description: List of secrets to inject into the job.
                  items:
                    $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.CreateJobDefinitionSecretsRequest.SecretConfig'
              required:
              - secrets
              x-properties-order:
              - secrets
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"secrets":[""]}' \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets" \
            X-Auth-Token:$SCW_SECRET_KEY \
            secrets:='[""]'
  /serverless-jobs/v1alpha1/regions/{region}/job-definitions/{job_definition_id}/secrets/{secret_id}:
    get:
      tags:
      - Secrets
      operationId: GetJobDefinitionSecret
      summary: Get a secret references within a job definition
      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: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
          description: UUID of the job definition.
      - in: path
        name: secret_id
        description: UUID of the secret reference within the job.
        required: true
        schema:
          type: string
          description: UUID of the secret reference within the job.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.Secret'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets/{secret_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets/{secret_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Secrets
      operationId: UpdateJobDefinitionSecret
      summary: Update a secret reference within a job definition
      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: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
          description: UUID of the job definition.
      - in: path
        name: secret_id
        description: UUID of the secret reference within the job.
        required: true
        schema:
          type: string
          description: UUID of the secret reference within the job.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.Secret'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                secret_manager_version:
                  type: string
                  description: Version of the secret in Secret Manager.
                path:
                  type: string
                  description: Path of the secret to mount inside the job (either
                    `path` or `env_var_name` must be set).
                  nullable: true
                  x-one-of: secret_config
                env_var_name:
                  type: string
                  description: Environment variable name used to expose the secret
                    inside the job (either `path` or `env_var_name` must be set).
                  nullable: true
                  x-one-of: secret_config
              x-properties-order:
              - secret_manager_version
              - path
              - env_var_name
      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/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets/{secret_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets/{secret_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Secrets
      operationId: DeleteJobDefinitionSecret
      summary: Delete a secret reference within a job definition
      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: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
          description: UUID of the job definition.
      - in: path
        name: secret_id
        description: UUID of the secret reference within the job.
        required: true
        schema:
          type: string
          description: UUID of the secret reference within the job.
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets/{secret_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/secrets/{secret_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha1/regions/{region}/job-definitions/{job_definition_id}/start:
    post:
      tags:
      - Job definitions
      operationId: StartJobDefinition
      summary: Run an existing job definition by its unique identifier. This will
        create a new job run
      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: job_definition_id
        description: UUID of the job definition to start.
        required: true
        schema:
          type: string
          description: UUID of the job definition to start.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.StartJobDefinitionResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                  description: Contextual startup command for this specific job run.
                environment_variables:
                  type: object
                  description: Contextual environment variables for this specific
                    job run.
                  properties:
                    <key>:
                      type: string
                  nullable: true
                replicas:
                  type: integer
                  description: Number of jobs to run.
                  format: uint32
              x-properties-order:
              - command
              - environment_variables
              - replicas
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/start"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-definitions/{job_definition_id}/start" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha1/regions/{region}/job-runs:
    get:
      tags:
      - Job runs
      operationId: ListJobRuns
      summary: List all job runs with filters
      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
        schema:
          $ref: '#/components/schemas/google.protobuf.Int32Value'
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.ListJobRunsRequest.OrderBy'
      - in: query
        name: job_definition_id
        schema:
          $ref: '#/components/schemas/google.protobuf.StringValue'
      - in: query
        name: project_id
        schema:
          $ref: '#/components/schemas/google.protobuf.StringValue'
      - in: query
        name: organization_id
        schema:
          $ref: '#/components/schemas/google.protobuf.StringValue'
      - in: query
        name: state
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobRun.State'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.ListJobRunsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-runs"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-runs" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha1/regions/{region}/job-runs/{job_run_id}:
    get:
      tags:
      - Job runs
      operationId: GetJobRun
      summary: Get a job run by its unique identifier
      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: job_run_id
        description: UUID of the job run to get.
        required: true
        schema:
          type: string
          description: UUID of the job run to get.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobRun'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-runs/{job_run_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-runs/{job_run_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha1/regions/{region}/job-runs/{job_run_id}/stop:
    post:
      tags:
      - Job runs
      operationId: StopJobRun
      summary: Stop a job run by its unique identifier
      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: job_run_id
        description: UUID of the job run to stop.
        required: true
        schema:
          type: string
          description: UUID of the job run to stop.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha1.JobRun'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-runs/{job_run_id}/stop"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha1/regions/fr-par/job-runs/{job_run_id}/stop" \
            X-Auth-Token:$SCW_SECRET_KEY
