188 lines
4.6 KiB
YAML
188 lines
4.6 KiB
YAML
openapi: 3.0.1
|
|
info:
|
|
contact:
|
|
email: support@anthrove.art
|
|
name: API Support
|
|
url: http://anthrove.art/support
|
|
description: This service handles the communication between the manager and the
|
|
plugs
|
|
title: Anthrove Orchestrator API
|
|
version: "1.0"
|
|
servers:
|
|
- url: /api/v1
|
|
paths:
|
|
/plug/task/{plug_identifier}:
|
|
post:
|
|
description: Starts a task for the specified plug
|
|
parameters:
|
|
- description: Plug Identifier
|
|
in: path
|
|
name: plug_identifier
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/task.StartTask'
|
|
description: Task Details
|
|
required: true
|
|
responses:
|
|
"200":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/task.Response'
|
|
description: OK
|
|
"400":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/gin.H'
|
|
description: Bad Request
|
|
summary: Start a plug task
|
|
tags:
|
|
- UserSource
|
|
x-codegen-request-body-name: task
|
|
/plug/task/{plug_identifier}/{task_id}:
|
|
delete:
|
|
description: Stops a task for the specified plug
|
|
parameters:
|
|
- description: Plug Identifier
|
|
in: path
|
|
name: plug_identifier
|
|
required: true
|
|
schema:
|
|
type: string
|
|
- description: Task ID
|
|
in: path
|
|
name: task_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/task.Response'
|
|
description: OK
|
|
"400":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/gin.H'
|
|
description: Bad Request
|
|
summary: Stop a plug task
|
|
tags:
|
|
- UserSource
|
|
get:
|
|
description: Retrieves the status of a task for the specified plug
|
|
parameters:
|
|
- description: Plug Identifier
|
|
in: path
|
|
name: plug_identifier
|
|
required: true
|
|
schema:
|
|
type: string
|
|
- description: Task ID
|
|
in: path
|
|
name: task_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/task.Response'
|
|
description: OK
|
|
"400":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/gin.H'
|
|
description: Bad Request
|
|
summary: Gets the status of a plug task
|
|
tags:
|
|
- UserSource
|
|
/user/task:
|
|
post:
|
|
description: Starts a task to scrape all user sources
|
|
responses:
|
|
"200":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
items:
|
|
items:
|
|
$ref: '#/components/schemas/task.Response'
|
|
type: array
|
|
type: array
|
|
description: OK
|
|
"500":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/gin.H'
|
|
description: Internal Server Error
|
|
summary: Start scraping all user sources
|
|
tags:
|
|
- User
|
|
/user/task/{user_id}:
|
|
get:
|
|
description: Retrieves the status of a task for the specified plug
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
items:
|
|
$ref: '#/components/schemas/task.Response'
|
|
type: array
|
|
description: OK
|
|
"400":
|
|
content:
|
|
'*/*':
|
|
schema:
|
|
$ref: '#/components/schemas/gin.H'
|
|
description: Bad Request
|
|
summary: Gets all tasks of a user
|
|
tags:
|
|
- User
|
|
components:
|
|
schemas:
|
|
gin.H:
|
|
additionalProperties:
|
|
type: object
|
|
type: object
|
|
task.Response:
|
|
example:
|
|
plug_task_id: plug_task_id
|
|
plug_task_status: plug_task_status
|
|
properties:
|
|
plug_task_id:
|
|
type: string
|
|
plug_task_status:
|
|
type: string
|
|
type: object
|
|
task.StartTask:
|
|
properties:
|
|
user_api_key:
|
|
type: string
|
|
user_id:
|
|
type: string
|
|
user_source_id:
|
|
type: string
|
|
type: object
|
|
x-original-swagger-version: "2.0"
|