Last active
May 19, 2017 08:44
-
-
Save hitsumabushi/5c0bcb8842f789cb9dbe2c4335fa2a8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.0-RC1", | |
"servers": [ | |
{ | |
"url": "https://api.sakura.io/" | |
} | |
], | |
"info": { | |
"version": "1.0.3", | |
"title": "sakura.io API", | |
"description": "コントロールパネルから変更できる操作をAPI経由で行うことができます。\n\n## APIキー\n\nコントロールパネルの[APIキーメニュー](https://secure.sakura.ad.jp/iot/apikeys/)よりAPIキーを発行することができます。\n\n発行されたキーの以下の2項目をBASIC認証のユーザー名とパスワードとして扱うことにより、認証が行われます。\n\n* Token\n* Secret\n" | |
}, | |
"paths": { | |
"/v1/auth/": { | |
"get": { | |
"tags": [ | |
"Auth" | |
], | |
"summary": "Authentication", | |
"description": "Returns information about authentication", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Authenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Auth" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/projects/": { | |
"get": { | |
"tags": [ | |
"Project" | |
], | |
"summary": "Projects List", | |
"description": "Returns projects list.", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "query", | |
"name": "name", | |
"description": "Keyword in name", | |
"required": false, | |
"x-example": "project_1", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"in": "query", | |
"name": "sort", | |
"description": "Sort fields", | |
"required": false, | |
"x-example": "-name", | |
"schema": { | |
"type": "string", | |
"enum": [ | |
"name", | |
"id", | |
"-name", | |
"-id" | |
] | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Projects", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/Project" | |
} | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"post": { | |
"tags": [ | |
"Project" | |
], | |
"summary": "Create Project", | |
"description": "Creates a new project", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [], | |
"responses": { | |
"201": { | |
"description": "Created project", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Project" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"$ref": "#/components/requestBodies/ProjectUpdate" | |
} | |
} | |
}, | |
"/v1/projects/{projectId}/": { | |
"get": { | |
"tags": [ | |
"Project" | |
], | |
"summary": "Get Project", | |
"description": "Returns a project based on a single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project to fetch", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Project", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Project" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"put": { | |
"tags": [ | |
"Project" | |
], | |
"summary": "Update Project", | |
"description": "Update a project based on a single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Updated project", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Project" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"$ref": "#/components/requestBodies/ProjectUpdate" | |
} | |
}, | |
"delete": { | |
"tags": [ | |
"Project" | |
], | |
"summary": "Delete Project", | |
"description": "Delete a project based on single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"204": { | |
"description": "Successful" | |
}, | |
"401": { | |
"description": "Unauthenticated" | |
}, | |
"403": { | |
"description": "Forbidden" | |
}, | |
"404": { | |
"description": "Not found" | |
}, | |
"409": { | |
"description": "Conflict error" | |
} | |
} | |
} | |
}, | |
"/v1/projects/{projectId}/files/": { | |
"get": { | |
"tags": [ | |
"Project", | |
"File" | |
], | |
"summary": "File Config List", | |
"description": "Returns file configs list.", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project to fetch", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Files", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/File" | |
} | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"post": { | |
"tags": [ | |
"Project", | |
"File" | |
], | |
"summary": "Create File Config", | |
"description": "Creates a new file config", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project to create", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"201": { | |
"description": "Created file", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/File" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"description": "File to create", | |
"schema": { | |
"$ref": "#/components/schemas/FileCreate" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/projects/{projectId}/files/{fileNumber}/": { | |
"get": { | |
"tags": [ | |
"Project", | |
"File" | |
], | |
"summary": "Get File Config", | |
"description": "Returns a file based on a project ID and number", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project to fetch", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
}, | |
{ | |
"in": "path", | |
"name": "fileNumber", | |
"description": "Number of file config to fetch", | |
"required": true, | |
"x-example": 1, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "File", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/File" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"put": { | |
"tags": [ | |
"Project", | |
"File" | |
], | |
"summary": "Update File Config", | |
"description": "Update a file config based on a project ID and number", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
}, | |
{ | |
"in": "path", | |
"name": "fileNumber", | |
"description": "Number of file", | |
"required": true, | |
"x-example": 1, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Updated file config", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/File" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"description": "File config to update", | |
"schema": { | |
"$ref": "#/components/schemas/FileUpdate" | |
} | |
} | |
} | |
} | |
}, | |
"delete": { | |
"tags": [ | |
"Project", | |
"File" | |
], | |
"summary": "Delete File Config", | |
"description": "Delete a file config based on project ID and number", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "projectId", | |
"description": "ID of project", | |
"required": true, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
}, | |
{ | |
"in": "path", | |
"name": "fileNumber", | |
"description": "Number of file", | |
"required": true, | |
"x-example": 1, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"204": { | |
"description": "Successful" | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/modules/": { | |
"get": { | |
"tags": [ | |
"Module" | |
], | |
"summary": "Modules List", | |
"description": "Returns modules list", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "query", | |
"name": "project", | |
"description": "ID of project", | |
"required": false, | |
"x-example": 10042, | |
"schema": { | |
"type": "integer" | |
} | |
}, | |
{ | |
"in": "query", | |
"name": "serial_number", | |
"description": "Serial number", | |
"required": false, | |
"x-example": "example_module_serial", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"in": "query", | |
"name": "model", | |
"description": "Model", | |
"required": false, | |
"x-example": "SCM-LTE-01", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"in": "query", | |
"name": "sort", | |
"description": "Sort fields", | |
"required": false, | |
"x-example": "-name", | |
"schema": { | |
"type": "string", | |
"enum": [ | |
"project", | |
"name", | |
"id", | |
"serial_number", | |
"model", | |
"-project", | |
"-name", | |
"-id", | |
"-serial_number", | |
"-model" | |
] | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Modules", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/Module" | |
} | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"post": { | |
"tags": [ | |
"Module" | |
], | |
"summary": "Register Module", | |
"description": "Regsiter a new module", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [], | |
"responses": { | |
"201": { | |
"description": "Registered module", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ModuleRegisterResponse" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"description": "Module information to register", | |
"schema": { | |
"$ref": "#/components/schemas/ModuleRegister" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/modules/{moduleId}/": { | |
"get": { | |
"tags": [ | |
"Module" | |
], | |
"summary": "Get Module", | |
"description": "Returns a module based on a single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "moduleId", | |
"description": "ID of module", | |
"required": true, | |
"x-example": "new_module_id", | |
"schema": { | |
"type": "string" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Module", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Module" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"put": { | |
"tags": [ | |
"Module" | |
], | |
"summary": "Update Module", | |
"description": "Update a module based on a single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "moduleId", | |
"description": "ID of module", | |
"required": true, | |
"x-example": "new_module_id", | |
"schema": { | |
"type": "string" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Updated module", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Module" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthentication", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ModuleUpdate" | |
} | |
} | |
} | |
} | |
}, | |
"delete": { | |
"tags": [ | |
"Module" | |
], | |
"summary": "Delete Module", | |
"description": "Delete a module based on single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "moduleId", | |
"description": "ID of module", | |
"required": true, | |
"x-example": "new_module_id", | |
"schema": { | |
"type": "string" | |
} | |
} | |
], | |
"responses": { | |
"204": { | |
"description": "Successful" | |
}, | |
"401": { | |
"description": "Unauthentication", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/servicetypes/": { | |
"get": { | |
"tags": [ | |
"Service" | |
], | |
"summary": "Service Type List", | |
"description": "Returns service types list", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [], | |
"responses": { | |
"200": { | |
"description": "Service Types", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/ServiceType" | |
} | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/servicetypes/{serviceTypeId}/": { | |
"get": { | |
"tags": [ | |
"Service" | |
], | |
"summary": "Get Service Types", | |
"description": "Returns a service type based on a single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "serviceTypeId", | |
"description": "ID of service type", | |
"required": true, | |
"x-example": "websocket", | |
"schema": { | |
"type": "string" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Service Type", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ServiceType" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/services/": { | |
"get": { | |
"tags": [ | |
"Service" | |
], | |
"summary": "Service List", | |
"description": "Returns services list", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "query", | |
"name": "type", | |
"description": "Type of service", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"enum": [ | |
"websocket", | |
"incoming-webhook", | |
"outgoing-webhook", | |
"mqtt", | |
"datastore", | |
"mqtt.aws-iot" | |
] | |
} | |
}, | |
{ | |
"in": "query", | |
"name": "sort", | |
"description": "Sort fields", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"enum": [ | |
"name", | |
"token", | |
"id", | |
"-name", | |
"-token", | |
"-id" | |
] | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Services", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/ServiceBase" | |
} | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/v1/services/{serviceId}/": { | |
"get": { | |
"tags": [ | |
"Service" | |
], | |
"summary": "Get Service", | |
"description": "Returns a service based on a single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "serviceId", | |
"description": "ID of service", | |
"required": true, | |
"x-example": 33312, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Service", | |
"content": { | |
"application/json": { | |
"schema": { | |
"title": "Based on service type" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"put": { | |
"tags": [ | |
"Service" | |
], | |
"summary": "Update service", | |
"description": "Update a service bsaed on single ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "serviceId", | |
"description": "ID of service", | |
"required": true, | |
"x-example": 33312, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Updated servic", | |
"content": { | |
"application/json": { | |
"schema": { | |
"title": "Based on service type" | |
} | |
} | |
} | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"title": "Based on service type", | |
"type": "object" | |
} | |
} | |
} | |
} | |
}, | |
"delete": { | |
"tags": [ | |
"Service" | |
], | |
"summary": "Delete Service", | |
"description": "Delete a service based on a singele ID", | |
"security": [ | |
{ | |
"basicAuth": [] | |
} | |
], | |
"parameters": [ | |
{ | |
"in": "path", | |
"name": "serviceId", | |
"description": "ID of service", | |
"required": true, | |
"x-example": 33312, | |
"schema": { | |
"type": "integer" | |
} | |
} | |
], | |
"responses": { | |
"204": { | |
"description": "Successful" | |
}, | |
"401": { | |
"description": "Unauthenticated", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"403": { | |
"description": "Forbidden", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"404": { | |
"description": "Not found", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
}, | |
"422": { | |
"description": "Validation error", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Error" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"Error": { | |
"properties": { | |
"message": { | |
"type": "string" | |
}, | |
"errors": { | |
"type": "object" | |
} | |
}, | |
"required": [ | |
"message", | |
"errors" | |
] | |
}, | |
"Auth": { | |
"properties": { | |
"username": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"enum": [ | |
"apikey" | |
] | |
}, | |
"level": { | |
"type": "integer", | |
"enum": [ | |
100, | |
200, | |
300 | |
] | |
}, | |
"expire_at": { | |
"type": "string", | |
"format": "date-time" | |
} | |
}, | |
"required": [ | |
"username", | |
"level" | |
] | |
}, | |
"Project": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"option": { | |
"type": "object", | |
"properties": { | |
"datastore": { | |
"type": "string", | |
"enum": [ | |
"light", | |
"standard" | |
] | |
}, | |
"location": { | |
"type": "boolean" | |
} | |
} | |
} | |
} | |
}, | |
"ProjectUpdate": { | |
"title": "Project", | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"datastore": { | |
"type": "string", | |
"enum": [ | |
"light", | |
"standard" | |
], | |
"x-example": null | |
}, | |
"location": { | |
"type": "boolean" | |
} | |
}, | |
"required": [ | |
"name" | |
], | |
"example": { | |
"name": "example_project", | |
"options": { | |
"datastore": "light", | |
"location": false | |
} | |
} | |
}, | |
"File": { | |
"title": "File Config", | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"number": { | |
"type": "integer" | |
}, | |
"project": { | |
"type": "integer" | |
}, | |
"url": { | |
"type": "string" | |
} | |
} | |
}, | |
"FileCreate": { | |
"title": "File Config", | |
"properties": { | |
"number": { | |
"type": "integer" | |
}, | |
"url": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"number", | |
"url" | |
], | |
"example": { | |
"number": 1, | |
"name": "example_url", | |
"url": "https://example.com/file" | |
} | |
}, | |
"FileUpdate": { | |
"title": "File Config", | |
"properties": { | |
"url": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"url" | |
], | |
"example": { | |
"number": 1, | |
"name": "example_url_updated", | |
"url": "https://example.com/file_updated" | |
} | |
}, | |
"Module": { | |
"properties": { | |
"id": { | |
"type": "string" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"is_online": { | |
"type": "boolean" | |
} | |
} | |
}, | |
"ModuleRegister": { | |
"title": "Module Register Information", | |
"properties": { | |
"register_id": { | |
"type": "string" | |
}, | |
"register_pass": { | |
"type": "string" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
} | |
}, | |
"required": [ | |
"register_id", | |
"register_pass", | |
"name", | |
"project" | |
], | |
"example": { | |
"register_id": "new_module_id", | |
"register_pass": "new_module_pass", | |
"name": "new_module", | |
"project": 10042 | |
} | |
}, | |
"ModuleRegisterResponse": { | |
"properties": { | |
"id": { | |
"type": "string" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"is_online": { | |
"type": "boolean" | |
}, | |
"points": { | |
"type": "integer", | |
"description": "Assigned points by register this module." | |
} | |
}, | |
"required": [ | |
"id", | |
"name" | |
] | |
}, | |
"ModuleUpdate": { | |
"title": "Module", | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
} | |
}, | |
"required": [ | |
"name", | |
"project" | |
], | |
"example": { | |
"name": "new_module_name", | |
"project": 10042 | |
} | |
}, | |
"ServiceType": { | |
"properties": { | |
"id": { | |
"type": "string" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string" | |
} | |
} | |
}, | |
"ServiceBase": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"enum": [ | |
"websocket", | |
"outgoing-webhook", | |
"incoming-webhook" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"JWT": { | |
"type": "string" | |
} | |
} | |
}, | |
"WebSocketService": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"websocket\"", | |
"enum": [ | |
"websocket" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"JWT": { | |
"type": "string" | |
}, | |
"url": { | |
"type": "string" | |
} | |
} | |
}, | |
"WebSocketServiceUpdate": { | |
"title": "WebSocketService", | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"websocket\"", | |
"enum": [ | |
"websocket" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
} | |
}, | |
"required": [ | |
"name", | |
"type", | |
"project" | |
], | |
"example": { | |
"name": "example_websocket", | |
"type": "websocket", | |
"project": 10042 | |
} | |
}, | |
"OutgoingWebhookService": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"outgoing-webhook\"", | |
"enum": [ | |
"outgoing-webhook" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"JWT": { | |
"type": "string" | |
}, | |
"url": { | |
"type": "string" | |
}, | |
"secret": { | |
"type": "string" | |
} | |
} | |
}, | |
"OutgoingWebhookServiceUpdate": { | |
"title": "OutgoingWebhookService", | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"outgoing-webhook\"", | |
"enum": [ | |
"outgoing-webhook" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"url": { | |
"type": "string" | |
}, | |
"secret": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"name", | |
"type", | |
"project", | |
"url" | |
], | |
"example": { | |
"name": "example_outgoing_webhook", | |
"type": "outgoing-webhook", | |
"project": 10042, | |
"url": "http://example.com/outgoing-webhook", | |
"secret": "example_secret" | |
} | |
}, | |
"IncomingWebhookService": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"incoming-webhook\"", | |
"enum": [ | |
"incoming-webhook" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"JWT": { | |
"type": "string" | |
}, | |
"url": { | |
"type": "string" | |
}, | |
"secret": { | |
"type": "string" | |
} | |
} | |
}, | |
"IncomingWebhookServiceUpdate": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"incoming-webhook\"", | |
"enum": [ | |
"incoming-webhook" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"secret": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"name", | |
"type", | |
"project" | |
], | |
"example": { | |
"name": "example_incoming_webhook", | |
"type": "incoming-webhook", | |
"project": 10042, | |
"secret": "example_secret" | |
} | |
}, | |
"DataStoreService": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"datastore\"", | |
"enum": [ | |
"datastore" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"token": { | |
"type": "string" | |
}, | |
"url": { | |
"type": "string" | |
} | |
} | |
}, | |
"DataStoreServiceUpdate": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"datastore\"", | |
"enum": [ | |
"datastore" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
} | |
}, | |
"required": [ | |
"name", | |
"type", | |
"project" | |
], | |
"example": { | |
"name": "example_datastore", | |
"type": "datastore", | |
"project": 10042 | |
} | |
}, | |
"MQTTClientService": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"mqtt\"", | |
"enum": [ | |
"mqtt" | |
] | |
}, | |
"project": { | |
"type": "integer" | |
}, | |
"token": { | |
"type": "string" | |
}, | |
"status": { | |
"type": "string", | |
"enum": [ | |
"notconnected", | |
"reconfigured", | |
"connecting", | |
"success", | |
"error", | |
"unknown" | |
] | |
}, | |
"status_description": { | |
"type": "string" | |
}, | |
"error_description": { | |
"type": "string" | |
}, | |
"hostname": { | |
"type": "string" | |
}, | |
"port": { | |
"type": "integer" | |
}, | |
"username": { | |
"type": "string" | |
}, | |
"password": { | |
"type": "string" | |
}, | |
"publish_prefix": { | |
"type": "string" | |
}, | |
"subscribe_topic": { | |
"type": "string" | |
}, | |
"rootca_cert": { | |
"type": "string" | |
}, | |
"cert": { | |
"type": "string" | |
}, | |
"private_key": { | |
"type": "string" | |
} | |
} | |
}, | |
"MQTTClientServiceUpdate": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"mqtt\"", | |
"enum": [ | |
"mqtt" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"hostname": { | |
"type": "string" | |
}, | |
"port": { | |
"type": "integer" | |
}, | |
"username": { | |
"type": "string" | |
}, | |
"password": { | |
"type": "string" | |
}, | |
"publish_prefix": { | |
"type": "string" | |
}, | |
"subscribe_topic": { | |
"type": "string" | |
}, | |
"rootca_cert": { | |
"type": "string" | |
}, | |
"cert": { | |
"type": "string" | |
}, | |
"private_key": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"name", | |
"type", | |
"project", | |
"hostname", | |
"port", | |
"publish_prefix", | |
"subscribe_topic" | |
], | |
"example": { | |
"name": "example_mqtt", | |
"type": "mqtt", | |
"project": 10042, | |
"hostname": "example.com", | |
"port": 8883, | |
"username": "example_user", | |
"password": "example_pass", | |
"publish_prefix": "pub_prefix", | |
"subscribe_topic": "sub_topic", | |
"rootca_cert": "example_rootca_cert", | |
"cert": "example_cert", | |
"private_key": "example_private_key" | |
} | |
}, | |
"AWSIoTService": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"mqtt.aws-iot\"", | |
"enum": [ | |
"mqtt.aws-iot" | |
] | |
}, | |
"project": { | |
"type": "integer" | |
}, | |
"token": { | |
"type": "string" | |
}, | |
"status": { | |
"type": "string", | |
"enum": [ | |
"notconnected", | |
"reconfigured", | |
"connecting", | |
"success", | |
"error", | |
"unknown" | |
] | |
}, | |
"status_description": { | |
"type": "string" | |
}, | |
"error_description": { | |
"type": "string" | |
}, | |
"hostname": { | |
"type": "string" | |
}, | |
"port": { | |
"type": "integer" | |
}, | |
"publish_prefix": { | |
"type": "string" | |
}, | |
"subscribe_topic": { | |
"type": "string" | |
}, | |
"rootca_cert": { | |
"type": "string" | |
}, | |
"cert": { | |
"type": "string" | |
}, | |
"private_key": { | |
"type": "string" | |
} | |
} | |
}, | |
"AWSIoTServiceUpdate": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string", | |
"description": "\"mqtt.aws-iot\"", | |
"enum": [ | |
"mqtt.aws-iot" | |
] | |
}, | |
"project": { | |
"type": "integer", | |
"description": "Project ID" | |
}, | |
"hostname": { | |
"type": "string" | |
}, | |
"port": { | |
"type": "integer" | |
}, | |
"publish_prefix": { | |
"type": "string" | |
}, | |
"subscribe_topic": { | |
"type": "string" | |
}, | |
"rootca_cert": { | |
"type": "string" | |
}, | |
"cert": { | |
"type": "string" | |
}, | |
"private_key": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"name", | |
"type", | |
"project", | |
"hostname", | |
"port", | |
"publish_prefix", | |
"subscribe_topic", | |
"rootca_cert", | |
"cert", | |
"private_key" | |
], | |
"example": { | |
"name": "example_mqtt.aws-iot", | |
"type": "mqtt.aws-iot", | |
"project": 10042, | |
"hostname": "example.com", | |
"port": 8883, | |
"publish_prefix": "pub_prefix", | |
"subscribe_topic": "sub_topic", | |
"rootca_cert": "example_rootca_cert", | |
"cert": "example_cert", | |
"private_key": "example_private_key" | |
} | |
} | |
}, | |
"responses": {}, | |
"parameters": {}, | |
"examples": {}, | |
"requestBodies": { | |
"ProjectUpdate": { | |
"content": { | |
"application/json": { | |
"description": "Project to create", | |
"schema": { | |
"$ref": "#/components/schemas/ProjectUpdate" | |
} | |
} | |
} | |
} | |
}, | |
"securitySchemes": { | |
"basicAuth": { | |
"type": "http", | |
"description": "HTTP Basic Authentication with API Key", | |
"scheme": "basic" | |
} | |
}, | |
"headers": {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment