mirror of https://github.com/portainer/portainer
docs(swagger): document the endpoint job execution (#2392)
parent
14d2bf4ebb
commit
4f9a8180f9
|
@ -495,6 +495,71 @@ paths:
|
||||||
description: "Server error"
|
description: "Server error"
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/GenericError"
|
$ref: "#/definitions/GenericError"
|
||||||
|
/endpoints/{id}/job:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- "endpoints"
|
||||||
|
summary: "Execute a job on the endpoint host"
|
||||||
|
description: |
|
||||||
|
Execute a job (script) on the underlying host of the endpoint.
|
||||||
|
**Access policy**: administrator
|
||||||
|
operationId: "EndpointJob"
|
||||||
|
consumes:
|
||||||
|
- "application/json"
|
||||||
|
produces:
|
||||||
|
- "application/json"
|
||||||
|
parameters:
|
||||||
|
- name: "id"
|
||||||
|
in: "path"
|
||||||
|
description: "Endpoint identifier"
|
||||||
|
required: true
|
||||||
|
type: "integer"
|
||||||
|
- name: "method"
|
||||||
|
in: "query"
|
||||||
|
description: "Job execution method. Possible values: file or string."
|
||||||
|
required: true
|
||||||
|
type: "string"
|
||||||
|
- in: "body"
|
||||||
|
name: "body"
|
||||||
|
description: "Job details. Required when method equals string."
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/EndpointJobRequest"
|
||||||
|
- name: "Image"
|
||||||
|
in: "formData"
|
||||||
|
type: "string"
|
||||||
|
description: "Container image which will be used to execute the job. Required when method equals file."
|
||||||
|
- name: "file"
|
||||||
|
in: "formData"
|
||||||
|
type: "file"
|
||||||
|
description: "Job script file. Required when method equals file."
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "Success"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/Endpoint"
|
||||||
|
400:
|
||||||
|
description: "Invalid request"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/GenericError"
|
||||||
|
examples:
|
||||||
|
application/json:
|
||||||
|
err: "Invalid request data format"
|
||||||
|
403:
|
||||||
|
description: "Unauthorized"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/GenericError"
|
||||||
|
404:
|
||||||
|
description: "Endpoint not found"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/GenericError"
|
||||||
|
examples:
|
||||||
|
application/json:
|
||||||
|
err: "Endpoint not found"
|
||||||
|
500:
|
||||||
|
description: "Server error"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/GenericError"
|
||||||
/endpoint_groups:
|
/endpoint_groups:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
|
@ -4164,6 +4229,20 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
example: "new-stack"
|
example: "new-stack"
|
||||||
description: "If provided will rename the migrated stack"
|
description: "If provided will rename the migrated stack"
|
||||||
|
EndpointJobRequest:
|
||||||
|
type: "object"
|
||||||
|
required:
|
||||||
|
- "Image"
|
||||||
|
- "FileContent"
|
||||||
|
properties:
|
||||||
|
Image:
|
||||||
|
type: "string"
|
||||||
|
example: "ubuntu:latest"
|
||||||
|
description: "Container image which will be used to execute the job"
|
||||||
|
FileContent:
|
||||||
|
type: "string"
|
||||||
|
example: "ls -lah /host/tmp"
|
||||||
|
description: "Content of the job script"
|
||||||
StackCreateRequest:
|
StackCreateRequest:
|
||||||
type: "object"
|
type: "object"
|
||||||
required:
|
required:
|
||||||
|
|
Loading…
Reference in New Issue