Google Cloud Run Jobs API

Operations for managing Cloud Run jobs

OpenAPI Specification

google-cloud-run-jobs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Cloud Run Admin Jobs API
  description: The Cloud Run Admin API deploys and manages user-provided container images as serverless services. It supports creating, updating, and deleting services, managing revisions and traffic splitting, executing jobs, and configuring domain mappings.
  version: v2
  contact:
    name: Google Cloud
    url: https://cloud.google.com/run
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://run.googleapis.com/v2
  description: Google Cloud Run Admin API v2
security:
- oauth2: []
tags:
- name: Jobs
  description: Operations for managing Cloud Run jobs
paths:
  /projects/{projectId}/locations/{location}/jobs:
    get:
      operationId: listJobs
      summary: Google Cloud Run List jobs
      description: Lists jobs in the given project and location.
      tags:
      - Jobs
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: pageSize
        in: query
        schema:
          type: integer
      - name: pageToken
        in: query
        schema:
          type: string
      - name: showDeleted
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListJobsResponse'
    post:
      operationId: createJob
      summary: Google Cloud Run Create a job
      description: Creates a new job in the given project and location.
      tags:
      - Jobs
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: jobId
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Job'
      responses:
        '200':
          description: Successful response with long-running operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
  /projects/{projectId}/locations/{location}/jobs/{jobId}:
    get:
      operationId: getJob
      summary: Google Cloud Run Get a job
      description: Gets information about a job.
      tags:
      - Jobs
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: jobId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
    patch:
      operationId: updateJob
      summary: Google Cloud Run Update a job
      description: Updates a job.
      tags:
      - Jobs
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: jobId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Job'
      responses:
        '200':
          description: Successful response with long-running operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
    delete:
      operationId: deleteJob
      summary: Google Cloud Run Delete a job
      description: Deletes a job.
      tags:
      - Jobs
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: jobId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response with long-running operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
  /projects/{projectId}/locations/{location}/jobs/{jobId}:run:
    post:
      operationId: runJob
      summary: Google Cloud Run Run a job
      description: Triggers creation of a new execution of this job.
      tags:
      - Jobs
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: location
        in: path
        required: true
        schema:
          type: string
      - name: jobId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                overrides:
                  type: object
                  properties:
                    containerOverrides:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          args:
                            type: array
                            items:
                              type: string
                          env:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                value:
                                  type: string
                    taskCount:
                      type: integer
                    timeout:
                      type: string
      responses:
        '200':
          description: Successful response with long-running operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
components:
  schemas:
    ListJobsResponse:
      type: object
      properties:
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/Job'
        nextPageToken:
          type: string
    Operation:
      type: object
      properties:
        name:
          type: string
        metadata:
          type: object
        done:
          type: boolean
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
        response:
          type: object
    Job:
      type: object
      properties:
        name:
          type: string
        uid:
          type: string
        generation:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        annotations:
          type: object
          additionalProperties:
            type: string
        createTime:
          type: string
          format: date-time
        updateTime:
          type: string
          format: date-time
        launchStage:
          type: string
        template:
          type: object
          properties:
            labels:
              type: object
              additionalProperties:
                type: string
            parallelism:
              type: integer
            taskCount:
              type: integer
            template:
              type: object
              properties:
                containers:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      image:
                        type: string
                      command:
                        type: array
                        items:
                          type: string
                      args:
                        type: array
                        items:
                          type: string
                      env:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                      resources:
                        type: object
                        properties:
                          limits:
                            type: object
                            additionalProperties:
                              type: string
                timeout:
                  type: string
                serviceAccount:
                  type: string
                maxRetries:
                  type: integer
        executionCount:
          type: integer
        latestCreatedExecution:
          type: object
          properties:
            name:
              type: string
            createTime:
              type: string
              format: date-time
            completionTime:
              type: string
              format: date-time
        reconciling:
          type: boolean
        conditions:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              state:
                type: string
              message:
                type: string
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/cloud-platform: Full access to Google Cloud Platform
            https://www.googleapis.com/auth/run: View and manage Cloud Run services
externalDocs:
  description: Google Cloud Run Documentation
  url: https://cloud.google.com/run/docs/reference/rest