Beacon/docs/swagger.json
2025-06-27 10:30:48 +08:00

502 lines
16 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "This is a sample server for a beacon.",
"title": "Beacon API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/api/v1",
"paths": {
"/composite-cases": {
"get": {
"description": "List composite cases with pagination",
"produces": [
"application/json"
],
"tags": [
"composite"
],
"summary": "List composite cases",
"parameters": [
{
"type": "integer",
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Page size",
"name": "page_size",
"in": "query"
},
{
"type": "string",
"description": "Status",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"description": "Create a new composite case",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"composite"
],
"summary": "Create a composite case",
"parameters": [
{
"description": "Create Composite Case Request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.CreateCompositeCaseRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/composite-cases/{id}": {
"get": {
"description": "Get a composite case by ID",
"produces": [
"application/json"
],
"tags": [
"composite"
],
"summary": "Get a composite case",
"parameters": [
{
"type": "integer",
"description": "Composite Case ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"description": "Update a composite case by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"composite"
],
"summary": "Update a composite case",
"parameters": [
{
"type": "integer",
"description": "Composite Case ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Composite Case Request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UpdateCompositeCaseRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"description": "Delete a composite case by ID",
"produces": [
"application/json"
],
"tags": [
"composite"
],
"summary": "Delete a composite case",
"parameters": [
{
"type": "integer",
"description": "Composite Case ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/workflows/start": {
"post": {
"description": "Start a new workflow",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "Start a workflow",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/workflows/{id}": {
"get": {
"description": "Get the status of a workflow by ID",
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "Get workflow status",
"parameters": [
{
"type": "string",
"description": "Workflow ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/workflows/{id}/results": {
"get": {
"description": "Get the results of a workflow by ID",
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "Get workflow results",
"parameters": [
{
"type": "string",
"description": "Workflow ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
},
"definitions": {
"models.CreateCompositeCaseRequest": {
"type": "object",
"required": [
"name"
],
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"steps": {
"type": "array",
"items": {
"$ref": "#/definitions/models.CreateCompositeCaseStepRequest"
}
}
}
},
"models.CreateCompositeCaseStepRequest": {
"type": "object",
"required": [
"step_name",
"step_order",
"step_type"
],
"properties": {
"activity_name": {
"type": "string"
},
"is_required": {
"type": "boolean"
},
"parameters_json": {
"type": "string"
},
"step_description": {
"type": "string"
},
"step_name": {
"type": "string"
},
"step_order": {
"type": "integer"
},
"step_type": {
"type": "string"
}
}
},
"models.UpdateCompositeCaseRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"steps": {
"type": "array",
"items": {
"$ref": "#/definitions/models.UpdateCompositeCaseStepRequest"
}
}
}
},
"models.UpdateCompositeCaseStepRequest": {
"type": "object",
"properties": {
"activity_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_required": {
"type": "boolean"
},
"parameters_json": {
"type": "string"
},
"step_description": {
"type": "string"
},
"step_name": {
"type": "string"
},
"step_order": {
"type": "integer"
},
"step_type": {
"type": "string"
}
}
}
}
}