openapi: 3.1.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/account/how-to/open-a-support-ticket).
  version: v1alpha2
servers:
- url: https://api.scaleway.com
tags:
- name: Job definitions
  description: A job definition is a template that contains all the information necessary
    to run a job
- name: Job runs
  description: A job run is the execution of a job definition
- 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.
- name: triggers
  description: A trigger is an object that specifies an automatic execution of a job
    definition, for example with a periodic CRON schedule
components:
  schemas:
    scaleway.serverless_jobs.v1alpha2.CreateJobDefinitionRequest.CronScheduleConfig:
      type: object
      properties:
        schedule:
          type: string
        timezone:
          type: string
      x-properties-order:
      - schedule
      - timezone
    scaleway.serverless_jobs.v1alpha2.CreateSecretsRequest.SecretConfig:
      type: object
      properties:
        secret_manager_id:
          type: string
        secret_manager_version:
          type: string
        path:
          type:
          - string
          - "null"
          description: One of path, env_var_name is required.
          pattern: ^/[a-zA-Z0-9/_.-]*(\.[a-zA-Z0-9]+)?$
          x-one-of: path_or_env_var
        env_var_name:
          type:
          - string
          - "null"
          description: One of path, env_var_name is required.
          pattern: '[-._a-zA-Z0-9]+'
          x-one-of: path_or_env_var
      x-properties-order:
      - secret_manager_id
      - secret_manager_version
      - path
      - env_var_name
      oneOf:
      - required:
        - path
      - required:
        - env_var_name
    scaleway.serverless_jobs.v1alpha2.CreateSecretsResponse:
      type: object
      properties:
        secrets:
          type: array
          description: List of secrets created.
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Secret'
      x-properties-order:
      - secrets
    scaleway.serverless_jobs.v1alpha2.CreateTriggerRequest.CronConfig:
      type: object
      properties:
        schedule:
          type: string
          description: CRON schedule in UNIX format.
        timezone:
          type: string
          description: Time zone for the CRON schedule.
        startup_command:
          type: array
          description: Startup command that will be used by the triggered job.
          items:
            type: string
        args:
          type: array
          description: Arguments passed to the startup command used by the triggered
            job.
          items:
            type: string
      required:
      - schedule
      - timezone
      x-properties-order:
      - schedule
      - timezone
      - startup_command
      - args
    scaleway.serverless_jobs.v1alpha2.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.v1alpha2.JobDefinition:
      type: object
      properties:
        id:
          type: string
          description: UUID of the job definition. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        srn:
          type: string
          description: SRN of the job definition.
          pattern: ^srn://jobs\.[^/]+/regions/[^/]+/job-definitions/[^/]+$
        name:
          type: string
          description: Name of the job definition.
        project_id:
          type: string
          description: UUID of the Scaleway Project containing the job. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        created_at:
          type:
          - string
          - "null"
          description: Creation date of the job definition. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        updated_at:
          type:
          - string
          - "null"
          description: Last update date of the job definition. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        cpu_limit:
          type: integer
          description: CPU limit of the job (in mvCPU).
          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
        image_uri:
          type: string
          description: Image to use for the job.
        command:
          type: string
          description: Deprecated, please use startup_command instead.
          deprecated: true
        environment_variables:
          type: object
          description: Environment variables of the job.
          properties:
            <environment_variableKey>:
              type: string
              description: Environment variables of the job.
          additionalProperties: true
        job_timeout:
          type:
          - string
          - "null"
          description: Timeout of the job in seconds. (in seconds)
          example: 2.5s
        description:
          type: string
          description: Description of the job.
        cron_schedule:
          description: Configure a cron for the job.
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.CronSchedule'
        startup_command:
          type: array
          description: Job startup command.
          items:
            type: string
        args:
          type: array
          description: Job arguments passed to the startup command at runtime.
          items:
            type: string
        retry_policy:
          description: Retry behaviour in case of job failure.
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.RetryPolicy'
        region:
          type: string
          description: Region in which the job definition exists.
      x-properties-order:
      - id
      - srn
      - name
      - project_id
      - created_at
      - updated_at
      - cpu_limit
      - memory_limit
      - local_storage_capacity
      - image_uri
      - command
      - environment_variables
      - job_timeout
      - description
      - cron_schedule
      - startup_command
      - args
      - retry_policy
      - region
    scaleway.serverless_jobs.v1alpha2.JobRun:
      type: object
      properties:
        id:
          type: string
          description: UUID of the job run. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        srn:
          type: string
          description: SRN of the job run.
          pattern: ^srn://jobs\.[^/]+/regions/[^/]+/job-runs/[^/]+$
        job_definition_id:
          type: string
          description: UUID of the job definition. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        created_at:
          type:
          - string
          - "null"
          description: Creation date of the job run. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        updated_at:
          type:
          - string
          - "null"
          description: Last update date of the job run. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        started_at:
          type:
          - string
          - "null"
          description: Start date of the job run. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        terminated_at:
          type:
          - string
          - "null"
          description: Termination date of the job run. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        run_duration:
          type:
          - string
          - "null"
          description: Duration of the job run. (in seconds)
          example: 2.5s
        state:
          description: State of the job run.
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun.State'
        reason:
          description: Reason for failure if the job failed.
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun.Reason'
        exit_code:
          type:
          - integer
          - "null"
          description: Exit code of the job.
          format: int32
        error_message:
          type:
          - string
          - "null"
          description: Error message if the job failed.
        cpu_limit:
          type: integer
          description: CPU limit of the job (in mvCPU).
          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
        command:
          type: string
          description: Deprecated, please use startup_command instead.
          deprecated: true
        environment_variables:
          type: object
          description: Environment variables of the job run.
          properties:
            <environment_variableKey>:
              type: string
              description: Environment variables of the job run.
          additionalProperties: true
        startup_command:
          type: array
          description: Job startup command.
          items:
            type: string
        args:
          type: array
          description: Job arguments passed to the startup command at runtime.
          items:
            type: string
        attempts:
          type:
          - integer
          - "null"
          description: Number of run attempts.
          format: uint32
        region:
          type: string
          description: Region in which the job run exists.
      x-properties-order:
      - id
      - srn
      - job_definition_id
      - created_at
      - updated_at
      - started_at
      - terminated_at
      - run_duration
      - state
      - reason
      - exit_code
      - error_message
      - cpu_limit
      - memory_limit
      - local_storage_capacity
      - command
      - environment_variables
      - startup_command
      - args
      - attempts
      - region
    scaleway.serverless_jobs.v1alpha2.JobRun.Reason:
      type: string
      enum:
      - unknown_reason
      - invalid_request
      - timeout
      - cancellation
      - technical_error
      - image_not_found
      - invalid_image
      - memory_usage_exceeded
      - storage_usage_exceeded
      - exited_with_error
      - secret_disabled
      - secret_not_found
      - quota_exceeded
      - application_not_started
      default: unknown_reason
    scaleway.serverless_jobs.v1alpha2.JobRun.State:
      type: string
      enum:
      - unknown_state
      - initialized
      - validated
      - queued
      - running
      - succeeded
      - failed
      - interrupting
      - interrupted
      - retrying
      default: unknown_state
    scaleway.serverless_jobs.v1alpha2.ListJobDefinitionsRequest.OrderBy:
      type: string
      enum:
      - created_at_asc
      - created_at_desc
      default: created_at_asc
    scaleway.serverless_jobs.v1alpha2.ListJobDefinitionsResponse:
      type: object
      properties:
        job_definitions:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobDefinition'
        total_count:
          type: integer
          format: uint64
      x-properties-order:
      - job_definitions
      - total_count
    scaleway.serverless_jobs.v1alpha2.ListJobRunsRequest.OrderBy:
      type: string
      enum:
      - created_at_asc
      - created_at_desc
      default: created_at_asc
    scaleway.serverless_jobs.v1alpha2.ListJobRunsResponse:
      type: object
      properties:
        job_runs:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun'
        total_count:
          type: integer
          format: uint64
      x-properties-order:
      - job_runs
      - total_count
    scaleway.serverless_jobs.v1alpha2.ListSecretsResponse:
      type: object
      properties:
        secrets:
          type: array
          description: List of secret references within a job definition.
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.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.v1alpha2.ListTriggersRequest.OrderBy:
      type: string
      enum:
      - created_at_asc
      - created_at_desc
      default: created_at_asc
    scaleway.serverless_jobs.v1alpha2.ListTriggersResponse:
      type: object
      properties:
        triggers:
          type: array
          description: List of triggers.
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Trigger'
        total_count:
          type: integer
          description: Total count of triggers.
          format: uint64
      x-properties-order:
      - triggers
      - total_count
    scaleway.serverless_jobs.v1alpha2.RetryPolicy:
      type: object
      properties:
        max_retries:
          type: integer
          description: Maximum number of retries upon a job failure.
          format: uint32
      required:
      - max_retries
      x-properties-order:
      - max_retries
    scaleway.serverless_jobs.v1alpha2.Secret:
      type: object
      properties:
        secret_id:
          type: string
          description: UUID of the secret reference within the job. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        srn:
          type: string
          description: SRN of the secret reference.
          pattern: ^srn://jobs\.[^/]+/regions/[^/]+/secrets/[^/]+$
        secret_manager_id:
          type: string
          description: UUID of the secret in Secret Manager. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        secret_manager_version:
          type: string
          description: Version of the secret in Secret Manager.
        job_definition_id:
          type: string
          description: UUID of the job definition. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        file:
          description: |-
            File secret mounted inside the job.
            One of file, env_var is required.
          x-one-of: secret_config
          oneOf:
          - $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Secret.File'
          - type: "null"
        env_var:
          description: |-
            Environment variable used to expose the secret.
            One of file, env_var is required.
          x-one-of: secret_config
          oneOf:
          - $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Secret.EnvVar'
          - type: "null"
        region:
          type: string
          description: Region in which the secret reference exists.
      required:
      - job_definition_id
      x-properties-order:
      - secret_id
      - srn
      - secret_manager_id
      - secret_manager_version
      - job_definition_id
      - file
      - env_var
      - region
      oneOf:
      - required:
        - file
      - required:
        - env_var
    scaleway.serverless_jobs.v1alpha2.Secret.EnvVar:
      type: object
      properties:
        name:
          type: string
      x-properties-order:
      - name
    scaleway.serverless_jobs.v1alpha2.Secret.File:
      type: object
      properties:
        path:
          type: string
      x-properties-order:
      - path
    scaleway.serverless_jobs.v1alpha2.StartJobDefinitionResponse:
      type: object
      properties:
        job_runs:
          type: array
          description: List of started job runs.
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun'
      required:
      - job_runs
      x-properties-order:
      - job_runs
    scaleway.serverless_jobs.v1alpha2.Trigger:
      type: object
      properties:
        id:
          type: string
          description: UUID of the trigger. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        srn:
          type: string
          description: SRN of the trigger.
          pattern: ^srn://jobs\.[^/]+/regions/[^/]+/triggers/[^/]+$
        job_definition_id:
          type: string
          description: UUID of the job definition. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        name:
          type: string
          description: Human readable name of the trigger.
        created_at:
          type:
          - string
          - "null"
          description: Creation time of the trigger. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        updated_at:
          type:
          - string
          - "null"
          description: Last update time of the trigger. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
        cron_config:
          description: |-
            Configuration of the CRON trigger.
            Precisely one of cron_config can be set.
          x-one-of: config
          oneOf:
          - $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Trigger.CronConfig'
          - type: "null"
        region:
          type: string
          description: Region in which the trigger exists.
      x-properties-order:
      - id
      - srn
      - job_definition_id
      - name
      - created_at
      - updated_at
      - cron_config
      - region
    scaleway.serverless_jobs.v1alpha2.Trigger.CronConfig:
      type: object
      properties:
        schedule:
          type: string
          description: CRON schedule in UNIX format.
        timezone:
          type: string
          description: Time zone for the CRON schedule.
        startup_command:
          type: array
          description: Startup command that will be used by the triggered job.
          items:
            type: string
        args:
          type: array
          description: Arguments passed to the startup command used by the triggered
            job.
          items:
            type: string
      x-properties-order:
      - schedule
      - timezone
      - startup_command
      - args
    scaleway.serverless_jobs.v1alpha2.UpdateJobDefinitionRequest.CronScheduleConfig:
      type: object
      properties:
        schedule:
          type:
          - string
          - "null"
        timezone:
          type:
          - string
          - "null"
      x-properties-order:
      - schedule
      - timezone
    scaleway.serverless_jobs.v1alpha2.UpdateJobDefinitionRequest.UpdateRetryPolicy:
      type: object
      properties:
        max_retries:
          type:
          - integer
          - "null"
          format: uint32
      x-properties-order:
      - max_retries
    scaleway.serverless_jobs.v1alpha2.UpdateTriggerRequest.CronConfig:
      type: object
      properties:
        schedule:
          type:
          - string
          - "null"
          description: CRON schedule in UNIX format.
        timezone:
          type:
          - string
          - "null"
          description: Time zone for the CRON schedule.
        startup_command:
          type:
          - array
          - "null"
          description: Startup command that will be used by the triggered job.
        args:
          type:
          - array
          - "null"
          description: Arguments passed to the startup command used by the triggered
            job.
      x-properties-order:
      - schedule
      - timezone
      - startup_command
      - args
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /serverless-jobs/v1alpha2/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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListJobDefinitionsRequest.OrderBy'
      - in: query
        name: project_id
        schema:
          type: string
      - in: query
        name: organization_id
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListJobDefinitionsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobDefinition'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the job definition.
                  pattern: ^[A-Za-z0-9-_]{3,50}$
                cpu_limit:
                  type: integer
                  description: CPU limit of the job (in mvCPU).
                  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
                image_uri:
                  type: string
                  description: Image to use for the job.
                  pattern: ^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$
                command:
                  type: string
                  description: |-
                    Startup command. If empty or not defined, the image's default command is used.
                    Deprecated: please use startup_command instead.
                  deprecated: true
                startup_command:
                  type: array
                  description: |-
                    Job startup command. Overrides the default defined in the job image.
                    The main executable or entrypoint script to run.
                    If both command and startup_command are provided, only startup_command will be used.
                  items:
                    type: string
                args:
                  type: array
                  description: |-
                    Job arguments. Overrides the default arguments defined in the job image.
                    Passed to the startup command at runtime.
                    Environment variables and secrets can be included, and will be expanded before the arguments are used.
                  items:
                    type: string
                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
                      description: Environment variables of the job.
                  additionalProperties: true
                description:
                  type: string
                  description: Description of the job.
                job_timeout:
                  type:
                  - string
                  - "null"
                  description: Timeout of the job in seconds. (in seconds)
                  example: 2.5s
                cron_schedule:
                  description: Configure a cron for the job.
                  $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.CreateJobDefinitionRequest.CronScheduleConfig'
                retry_policy:
                  description: Retry policy upon a job failure.
                  $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.RetryPolicy'
              required:
              - name
              - cpu_limit
              - memory_limit
              - local_storage_capacity
              - image_uri
              - project_id
              x-properties-order:
              - name
              - cpu_limit
              - memory_limit
              - local_storage_capacity
              - image_uri
              - command
              - startup_command
              - args
              - project_id
              - environment_variables
              - description
              - job_timeout
              - cron_schedule
              - retry_policy
      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": {
                  "<environment_variableKey>": "string"
              },
              "image_uri": "string",
              "local_storage_capacity": 42,
              "memory_limit": 42,
              "name": "string",
              "project_id": "string"
            }' \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions" \
            X-Auth-Token:$SCW_SECRET_KEY \
            command="string" \
            cpu_limit:=42 \
            description="string" \
            environment_variables:='{
              "<environment_variableKey>": "string"
            }' \
            image_uri="string" \
            local_storage_capacity:=42 \
            memory_limit:=42 \
            name="string" \
            project_id="string"
  /serverless-jobs/v1alpha2/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
          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
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobDefinition'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions/{job_definition_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/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
          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
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobDefinition'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                  - string
                  - "null"
                  description: Name of the job definition.
                  pattern: ^[A-Za-z0-9-_]{3,50}$
                cpu_limit:
                  type:
                  - integer
                  - "null"
                  description: CPU limit of the job (in mvCPU).
                  format: uint32
                memory_limit:
                  type:
                  - integer
                  - "null"
                  description: Memory limit of the job (in MiB).
                  format: uint32
                local_storage_capacity:
                  type:
                  - integer
                  - "null"
                  description: Local storage capacity of the job (in MiB).
                  format: uint32
                image_uri:
                  type:
                  - string
                  - "null"
                  description: Image to use for the job.
                  pattern: ^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$
                command:
                  type:
                  - string
                  - "null"
                  description: |-
                    Startup command. If empty or not defined, the image's default command is used.
                    Deprecated: please use startup_command instead.
                  deprecated: true
                startup_command:
                  type:
                  - array
                  - "null"
                  description: |-
                    Job startup command. Overrides the default defined in the job image.
                    The main executable or entrypoint script to run.
                    If both command and startup_command are provided, only startup_command will be used.
                args:
                  type:
                  - array
                  - "null"
                  description: |-
                    Job arguments. Overrides the default arguments defined in the job image.
                    Passed to the startup command at runtime.
                    Environment variables and secrets can be included, and will be expanded before the arguments are used.
                environment_variables:
                  type:
                  - object
                  - "null"
                  description: Environment variables of the job.
                  properties:
                    <key>:
                      type: string
                description:
                  type:
                  - string
                  - "null"
                  description: Description of the job.
                job_timeout:
                  type:
                  - string
                  - "null"
                  description: Timeout of the job in seconds. (in seconds)
                  example: 2.5s
                cron_schedule:
                  description: Configure a cron for the job.
                  $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.UpdateJobDefinitionRequest.CronScheduleConfig'
                retry_policy:
                  description: Retry policy upon a job failure.
                  $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.UpdateJobDefinitionRequest.UpdateRetryPolicy'
              x-properties-order:
              - name
              - cpu_limit
              - memory_limit
              - local_storage_capacity
              - image_uri
              - command
              - startup_command
              - args
              - environment_variables
              - description
              - job_timeout
              - cron_schedule
              - retry_policy
      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/v1alpha2/regions/{region}/job-definitions/{job_definition_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions/{job_definition_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Job definitions
      operationId: DeleteJobDefinition
      summary: Delete an existing job definition by its unique identifier
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: job_definition_id
        description: UUID of the job definition to delete.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions/{job_definition_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions/{job_definition_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha2/regions/{region}/job-definitions/{job_definition_id}/start:
    post:
      tags:
      - Job definitions
      operationId: StartJobDefinition
      summary: Run an existing job definition using its unique identifier and create
        a new job run
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: job_definition_id
        description: UUID of the job definition to start.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.StartJobDefinitionResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type:
                  - string
                  - "null"
                  description: |-
                    Contextual startup command for this specific job run.
                    If empty or not defined, the image's default command is used.
                    Deprecated: please use startup_command instead.
                  deprecated: true
                startup_command:
                  type:
                  - array
                  - "null"
                  description: |-
                    Contextual startup command for this specific job run.
                    Overrides the default defined in the job image.
                    The main executable or entrypoint script to run.
                    If both command and startup_command are provided, only startup_command will be used.
                args:
                  type:
                  - array
                  - "null"
                  description: |-
                    Contextual arguments for this specific job run.
                    Overrides the default arguments defined in the job image.
                    Passed to the contextual startup command at runtime.
                    Environment variables and secrets can be included, and will be expanded before the arguments are used.
                environment_variables:
                  type:
                  - object
                  - "null"
                  description: Contextual environment variables for this specific
                    job run.
                  properties:
                    <key>:
                      type: string
                replicas:
                  type:
                  - integer
                  - "null"
                  description: Number of jobs to run.
                  format: uint32
              x-properties-order:
              - command
              - startup_command
              - args
              - 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/v1alpha2/regions/{region}/job-definitions/{job_definition_id}/start"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-definitions/{job_definition_id}/start" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha2/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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: page
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListJobRunsRequest.OrderBy'
      - in: query
        name: job_definition_id
        schema:
          type: string
      - in: query
        name: project_id
        schema:
          type: string
      - in: query
        name: organization_id
        schema:
          type: string
      - in: query
        name: state
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun.State'
      - in: query
        name: states
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun.State'
      - in: query
        name: reasons
        schema:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun.Reason'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListJobRunsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-runs"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-runs" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha2/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
          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
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.JobRun'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-runs/{job_run_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-runs/{job_run_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha2/regions/{region}/job-runs/{job_run_id}/stop:
    post:
      tags:
      - Job runs
      operationId: StopJobRun
      summary: Stop a job run using its unique identifier
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: job_run_id
        description: UUID of the job run to stop.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.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/v1alpha2/regions/{region}/job-runs/{job_run_id}/stop"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/job-runs/{job_run_id}/stop" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha2/regions/{region}/secrets:
    get:
      tags:
      - Secrets
      operationId: ListSecrets
      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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListSecretsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets?job_definition_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets" \
            X-Auth-Token:$SCW_SECRET_KEY \
            job_definition_id==string
    post:
      tags:
      - Secrets
      operationId: CreateSecrets
      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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.CreateSecretsResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                job_definition_id:
                  type: string
                  description: UUID of the job definition.
                secrets:
                  type: array
                  description: List of secrets to inject into the job.
                  items:
                    $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.CreateSecretsRequest.SecretConfig'
              required:
              - job_definition_id
              - secrets
              x-properties-order:
              - job_definition_id
              - secrets
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"job_definition_id":"string","secrets":[""]}' \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets" \
            X-Auth-Token:$SCW_SECRET_KEY \
            job_definition_id="string" \
            secrets:='[""]'
  /serverless-jobs/v1alpha2/regions/{region}/secrets/{secret_id}:
    get:
      tags:
      - Secrets
      operationId: GetSecret
      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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: secret_id
        description: UUID of the secret reference within the job.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Secret'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets/{secret_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets/{secret_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Secrets
      operationId: UpdateSecret
      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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: secret_id
        description: UUID of the secret reference within the job.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Secret'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                secret_manager_version:
                  type:
                  - string
                  - "null"
                  description: Version of the secret in Secret Manager.
                path:
                  type:
                  - string
                  - "null"
                  description: |-
                    Path of the secret to mount inside the job (either `path` or `env_var_name` must be set).
                    Precisely one of path, env_var_name can be set.
                  pattern: ^/[a-zA-Z0-9/_-]*(\.[a-zA-Z0-9]+)?$
                  x-one-of: secret_config
                env_var_name:
                  type:
                  - string
                  - "null"
                  description: |-
                    Environment variable name used to expose the secret inside the job (either `path` or `env_var_name` must be set).
                    Precisely one of path, env_var_name can be set.
                  pattern: '[-._a-zA-Z0-9]+'
                  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/v1alpha2/regions/{region}/secrets/{secret_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets/{secret_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Secrets
      operationId: DeleteSecret
      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
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: secret_id
        description: UUID of the secret reference within the job.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets/{secret_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/secrets/{secret_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-jobs/v1alpha2/regions/{region}/triggers:
    get:
      tags:
      - triggers
      operationId: ListTriggers
      summary: List triggers of a job definition
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: job_definition_id
        description: UUID of the job definition.
        required: true
        schema:
          type: string
      - in: query
        name: page
        description: Page number from paginated list of triggers.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Number of triggers per page.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Sorting order of triggers.
        schema:
          $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListTriggersRequest.OrderBy'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.ListTriggersResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers?job_definition_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers" \
            X-Auth-Token:$SCW_SECRET_KEY \
            job_definition_id==string
    post:
      tags:
      - triggers
      operationId: CreateTrigger
      summary: Create a trigger
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Trigger'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                job_definition_id:
                  type: string
                  description: UUID of the job definition.
                name:
                  type: string
                  description: Name of the trigger.
                  pattern: ^[A-Za-z0-9-_]*$
                cron_config:
                  description: |-
                    Configuration of the CRON trigger.
                    One of cron_config is required.
                  x-one-of: config
                  oneOf:
                  - $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.CreateTriggerRequest.CronConfig'
                  - type: "null"
              required:
              - job_definition_id
              - name
              x-properties-order:
              - job_definition_id
              - name
              - cron_config
              oneOf:
              - required:
                - cron_config
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"job_definition_id":"string","name":"string"}' \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers" \
            X-Auth-Token:$SCW_SECRET_KEY \
            job_definition_id="string" \
            name="string"
  /serverless-jobs/v1alpha2/regions/{region}/triggers/{trigger_id}:
    get:
      tags:
      - triggers
      operationId: GetTrigger
      summary: Get a trigger
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: trigger_id
        description: UUID of the trigger.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Trigger'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers/{trigger_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers/{trigger_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - triggers
      operationId: UpdateTrigger
      summary: Update a trigger
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: trigger_id
        description: UUID of the trigger.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.Trigger'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                  - string
                  - "null"
                  description: Name of the trigger.
                  pattern: ^[A-Za-z0-9-_]*$
                cron_config:
                  description: |-
                    Configuration of the CRON trigger.
                    Precisely one of cron_config can be set.
                  x-one-of: config
                  oneOf:
                  - $ref: '#/components/schemas/scaleway.serverless_jobs.v1alpha2.UpdateTriggerRequest.CronConfig'
                  - type: "null"
              x-properties-order:
              - name
              - cron_config
      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/v1alpha2/regions/{region}/triggers/{trigger_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers/{trigger_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - triggers
      operationId: DeleteTrigger
      summary: Delete a trigger
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: trigger_id
        description: UUID of the trigger.
        required: true
        schema:
          type: string
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers/{trigger_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/serverless-jobs/v1alpha2/regions/{region}/triggers/{trigger_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
