Skip to content

Instantly share code, notes, and snippets.

@pingsutw
Created April 28, 2020 10:24
Show Gist options
  • Save pingsutw/4d96afb54d4c767304f74844b432585c to your computer and use it in GitHub Desktop.
Save pingsutw/4d96afb54d4c767304f74844b432585c to your computer and use it in GitHub Desktop.
Swagger YAML generated by submarine
swagger: '2.0'
info:
description: 'The Submarine REST API allows you to create, list, and get experiments. The API is hosted under the /v1/jobs route on the Submarine server. For example, to list experiments on a server hosted at http://localhost:8080, access http://localhost:8080/v1/jobs/status'
version: 1.0.0
title: ''
termsOfService: 'http://swagger.io/terms/'
contact:
email: submarine-dev@submarine.apache.org
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: 'localhost:8080'
basePath: /api/
tags:
- name: jobs
schemes:
- http
paths:
'/v1/jobs/{id}':
get:
tags:
- jobs
summary: Find job by ID
description: Returns a single job
operationId: getJob
produces:
- application/json; charset=utf-8
parameters:
- name: id
in: path
required: true
type: string
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Job'
'400':
description: Invalid ID supplied
'404':
description: Job not found
delete:
tags:
- jobs
summary: Deletes a job
description: ''
operationId: deleteJob
produces:
- application/json; charset=utf-8
parameters:
- name: id
in: path
required: true
type: string
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Job'
'400':
description: Invalid ID supplied
'404':
description: Job not found
patch:
tags:
- jobs
summary: Updates a job in the submarine server with job spec
description: ''
operationId: patchJob
consumes:
- application/yaml
- application/json
produces:
- application/json; charset=utf-8
parameters:
- name: id
in: path
required: true
type: string
- in: body
name: body
required: false
schema:
$ref: '#/definitions/JobSpec'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Job'
'405':
description: Invalid input
/v1/jobs:
get:
tags:
- jobs
summary: List jobs
description: List all job in submarine server
operationId: listJob
produces:
- application/json; charset=utf-8
parameters:
- name: status
in: query
required: false
type: string
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/Job'
'400':
description: Invalid status value
post:
tags:
- jobs
summary: Submit a job to server
description: ''
operationId: createJob
consumes:
- application/yaml
- application/json
produces:
- application/json; charset=utf-8
parameters:
- in: body
name: body
required: false
schema:
$ref: '#/definitions/JobSpec'
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Job'
'405':
description: Invalid input
/v1/jobs/ping:
get:
tags:
- jobs
summary: Ping submarine server
description: ''
operationId: ping
consumes:
- application/json
produces:
- application/json; charset=utf-8
parameters: []
responses:
'200':
description: successful operation
schema:
type: string
definitions:
Job:
type: object
properties:
jobId:
$ref: '#/definitions/JobId'
name:
type: string
uid:
type: string
status:
type: string
acceptedTime:
type: string
createdTime:
type: string
runningTime:
type: string
finishedTime:
type: string
spec:
$ref: '#/definitions/JobSpec'
JobId:
type: object
properties:
id:
type: integer
format: int32
serverTimestamp:
type: integer
format: int64
JobLibrarySpec:
type: object
properties:
name:
type: string
version:
type: string
image:
type: string
cmd:
type: string
envVars:
type: object
additionalProperties:
type: string
JobSpec:
type: object
properties:
name:
type: string
namespace:
type: string
librarySpec:
$ref: '#/definitions/JobLibrarySpec'
taskSpecs:
type: object
additionalProperties:
$ref: '#/definitions/JobTaskSpec'
projects:
type: string
JobTaskSpec:
type: object
properties:
name:
type: string
image:
type: string
cmd:
type: string
envVars:
type: object
additionalProperties:
type: string
resources:
type: string
replicas:
type: integer
format: int32
cpu:
type: string
gpu:
type: string
memory:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment