openapi: 3.0.3
info:
description: RESTFul APIs provided by ecli-server
license:
name: MIT
title: ecli API
version: 1.0.0
servers:
- url: http://localhost:8527
paths:
/task:
get:
operationId: getTaskList
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/task_list_response'
description: List of running tasks
summary: Get list of running tasks
post:
operationId: startTask
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StartTaskRequest'
description: Task data
required: true
responses:
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Invalid arguments
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/startTask_200_response'
description: List of running tasks
summary: Start a new task
summary: Endpoints for tasks
/stop:
description: Stop a task by id or name
post:
operationId: stopTaskByID
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/simple_id_request'
description: Task id
required: true
responses:
"200":
content:
application/json:
schema:
properties: {}
type: object
description: Status of stopping the task
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Invalid handle
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Failed to terminate
summary: Stop a task by id
/log:
post:
description: get log from server
operationId: getTaskLogByID
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GetTaskLogRequest'
required: true
responses:
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Invalid handle
"200":
content:
application/json:
schema:
items:
$ref: '#/components/schemas/GetTaskLogResponse_inner'
title: GetTaskLogResponse
type: array
description: The log fetched
summary: get log
/pause:
description: Pause a task by id
post:
operationId: pauseTaskByID
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/simple_id_request'
description: Task id
required: true
responses:
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Failed to pause
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Invalid handle
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/task_status'
description: Status of pausing the task
summary: Pause a task by id
/resume:
description: Resume a task by id
post:
operationId: resumeTaskByID
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/simple_id_request'
description: Task id
required: true
responses:
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Failed to resume
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/general_error'
description: Invalid handle
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/task_status'
description: Status of the task
summary: Resume a task by id
components:
schemas:
general_error:
properties:
message:
description: description of the unexpected situation
type: string
required:
- message
type: object
simple_id_request:
properties:
id:
format: uint64
type: integer
required:
- id
type: object
task_status:
description: The status of the task
enum:
- running
- paused
type: string
program_type:
enum:
- wasm
- json
- tar
type: string
log_type:
enum:
- stderr
- stdout
- plain
type: string
task_list_response:
example:
tasks:
- name: name
id: 0
status: null
- name: name
id: 0
status: null
properties:
tasks:
items:
$ref: '#/components/schemas/task_list_response_tasks_inner'
type: array
required:
- tasks
type: object
StartTaskRequest:
example:
program_type: null
btf_archive_path: btf_archive_path
program_data_buf: program_data_buf
extra_args:
- extra_args
- extra_args
program_name: program_name
export_json: true
properties:
program_data_buf:
description: Base64-encoded program data
type: string
program_type:
$ref: '#/components/schemas/program_type'
program_name:
description: "The name of the program. If not provided, will generate a\
\ random one"
type: string
btf_archive_path:
description: Btf archive path in the server.
type: string
extra_args:
description: Command line arguments to the eBPF program
items:
type: string
type: array
export_json:
description: Whether to let the bpf-loader program dumps json. Only works
for json & tar program
type: boolean
required:
- program_data_buf
- program_type
title: StartTaskRequest
type: object
startTask_200_response:
example:
id: 0
task_list:
tasks:
- name: name
id: 0
status: null
- name: name
id: 0
status: null
properties:
id:
format: uint64
type: integer
task_list:
$ref: '#/components/schemas/task_list_response'
required:
- id
- task_list
type: object
GetTaskLogRequest:
example:
maximum_count: 1
log_cursor: 6
id: 0
properties:
id:
description: The program ID
format: uint64
type: integer
log_cursor:
description: "Only fetch logs after this cursor (included). If not provided,\
\ return logs stored with minimum cursor"
format: uint64
type: integer
maximum_count:
description: "Fetch at most such number of logs. If not provided, use a\
\ default value that server specified"
format: uint64
type: integer
required:
- id
title: GetTaskLogRequest
type: object
GetTaskLogResponse_inner_log:
example:
log_type: null
log: log
timestamp: 6
properties:
log:
type: string
timestamp:
format: uint64
type: integer
log_type:
$ref: '#/components/schemas/log_type'
required:
- log
- log_type
- timestamp
type: object
GetTaskLogResponse_inner:
example:
cursor: 0
log:
log_type: null
log: log
timestamp: 6
properties:
cursor:
format: uint64
type: integer
log:
$ref: '#/components/schemas/GetTaskLogResponse_inner_log'
required:
- cursor
- log
type: object
task_list_response_tasks_inner:
example:
name: name
id: 0
status: null
properties:
status:
$ref: '#/components/schemas/task_status'
id:
description: The ID of the task
format: uint64
type: integer
name:
description: The name of the task
type: string
required:
- id
- name
- status
type: object