Review Sagger config. Delete Job endpoints

This commit is contained in:
Jan Eitzinger
2022-11-11 15:26:27 +01:00
parent c4072ff4c7
commit 948da8f10b
6 changed files with 1096 additions and 221 deletions

View File

@@ -1,7 +1,39 @@
basePath: /api
definitions:
api.ApiTag:
properties:
name:
description: Tag Name
example: Testjob
type: string
type:
description: Tag Type
example: Debug
type: string
type: object
api.DeleteJobApiRequest:
properties:
cluster:
description: Cluster of job
example: fritz
type: string
jobId:
description: Cluster Job ID of job
example: 123000
type: integer
startTime:
description: Start Time of job as epoch
example: 1649723812
type: integer
required:
- jobId
type: object
api.DeleteJobApiResponse:
properties:
msg:
type: string
type: object
api.ErrorResponse:
description: Error message as returned from backend.
properties:
error:
description: Error Message
@@ -11,15 +43,12 @@ definitions:
type: string
type: object
api.StartJobApiResponse:
description: Successful job start response with database id of new job.
properties:
id:
description: Database ID of new job
type: integer
type: object
api.StopJobApiRequest:
description: Request to stop running job using stoptime and final state. They
are only required if no database id was provided with endpoint.
properties:
cluster:
description: Cluster of job
@@ -51,18 +80,6 @@ definitions:
- jobState
- stopTime
type: object
api.Tag:
description: Defines a tag using name and type.
properties:
name:
description: Tag Name
example: Testjob
type: string
type:
description: Tag Type
example: Debug
type: string
type: object
schema.Job:
description: Information of a HPC job.
properties:
@@ -330,7 +347,7 @@ definitions:
type: array
type: object
schema.Tag:
description: Defines a tag using name and type.
description: Defines B tag using name and type.
properties:
id:
description: The unique DB identifier of a tag
@@ -344,24 +361,21 @@ definitions:
example: Debug
type: string
type: object
host: clustercockpit.localhost:8082
host: localhost:8080
info:
contact:
email: support@clustercockpit.org
name: ClusterCockpit Project
url: https://github.com/ClusterCockpit
description: Defines a tag using name and type.
description: API for batch job control.
license:
name: MIT License
url: https://opensource.org/licenses/MIT
termsOfService: https://monitoring.nhr.fau.de/imprint
title: ClusterCockpit REST API
version: 0.1.0
version: 0.2.0
paths:
/jobs/:
get:
consumes:
- application/json
description: |-
Get a list of all jobs. Filters can be applied using query parameters.
Number of results can be limited by page. Results are sorted by descending startTime.
@@ -385,11 +399,11 @@ paths:
in: query
name: start-time
type: string
- description: 'Items per page (If empty: No Limit)'
- description: 'Items per page (Default: 25)'
in: query
name: items-per-page
type: integer
- description: 'Page Number (If empty: No Paging)'
- description: 'Page Number (Default: 1)'
in: query
name: page
type: integer
@@ -421,6 +435,152 @@ paths:
security:
- ApiKeyAuth: []
summary: Lists all jobs
tags:
- query
/jobs/delete_job/:
delete:
consumes:
- application/json
description: Job to delete is specified by request body. All fields are required
in this case.
parameters:
- description: All fields required
in: body
name: request
required: true
schema:
$ref: '#/definitions/api.DeleteJobApiRequest'
produces:
- application/json
responses:
"200":
description: Success message
schema:
$ref: '#/definitions/api.DeleteJobApiResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/api.ErrorResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/api.ErrorResponse'
"404":
description: Resource not found
schema:
$ref: '#/definitions/api.ErrorResponse'
"422":
description: 'Unprocessable Entity: finding job failed: sql: no rows in
result set'
schema:
$ref: '#/definitions/api.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/api.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Remove a job from the sql database
tags:
- remove
/jobs/delete_job/{id}:
delete:
description: Job to remove is specified by database ID. This will not remove
the job from the job archive.
parameters:
- description: Database ID of Job
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Success message
schema:
$ref: '#/definitions/api.DeleteJobApiResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/api.ErrorResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/api.ErrorResponse'
"404":
description: Resource not found
schema:
$ref: '#/definitions/api.ErrorResponse'
"422":
description: 'Unprocessable Entity: finding job failed: sql: no rows in
result set'
schema:
$ref: '#/definitions/api.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/api.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Remove a job from the sql database
tags:
- remove
/jobs/delete_job_before/{ts}:
delete:
description: Job to stop is specified by database ID. This will not remove the
job from the job archive.
parameters:
- description: Unix epoch timestamp
in: path
name: ts
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Success message
schema:
$ref: '#/definitions/api.DeleteJobApiResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/api.ErrorResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/api.ErrorResponse'
"404":
description: Resource not found
schema:
$ref: '#/definitions/api.ErrorResponse'
"422":
description: 'Unprocessable Entity: finding job failed: sql: no rows in
result set'
schema:
$ref: '#/definitions/api.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/api.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Remove a job from the sql database
tags:
- remove
/jobs/start_job/:
post:
consumes:
@@ -466,6 +626,8 @@ paths:
security:
- ApiKeyAuth: []
summary: Adds a new job as "running"
tags:
- add and modify
/jobs/stop_job/:
post:
description: |-
@@ -482,7 +644,7 @@ paths:
- application/json
responses:
"200":
description: Job resource
description: Success message
schema:
$ref: '#/definitions/schema.JobMeta'
"400":
@@ -513,6 +675,8 @@ paths:
security:
- ApiKeyAuth: []
summary: Marks job as completed and triggers archiving
tags:
- add and modify
/jobs/stop_job/{id}:
post:
consumes:
@@ -567,6 +731,8 @@ paths:
security:
- ApiKeyAuth: []
summary: Marks job as completed and triggers archiving
tags:
- add and modify
/jobs/tag_job/{id}:
post:
consumes:
@@ -586,7 +752,7 @@ paths:
required: true
schema:
items:
$ref: '#/definitions/api.Tag'
$ref: '#/definitions/api.ApiTag'
type: array
produces:
- application/json
@@ -614,10 +780,13 @@ paths:
security:
- ApiKeyAuth: []
summary: Adds one or more tags to a job
tags:
- add and modify
securityDefinitions:
ApiKeyAuth:
description: JWT based authentification for general API endpoint use.
in: header
name: X-Auth-Token
type: apiKey
swagger: "2.0"
tags:
- name: Job API