2020-10-09 21:25:09 +08:00
|
|
|
openapi: 3.0.1
|
|
|
|
info:
|
|
|
|
title: Mainflux Provision service
|
2023-08-01 23:20:51 +08:00
|
|
|
description: |
|
|
|
|
HTTP API for Provision service
|
|
|
|
Some useful links:
|
|
|
|
- [The Mainflux repository](https://github.com/mainflux/mainflux)
|
|
|
|
contact:
|
|
|
|
email: info@mainflux.com
|
|
|
|
license:
|
|
|
|
name: Apache 2.0
|
|
|
|
url: https://github.com/mainflux/mainflux/blob/master/LICENSE
|
|
|
|
version: 0.14.0
|
|
|
|
|
|
|
|
servers:
|
|
|
|
- url: http://localhost:9016
|
|
|
|
- url: https://localhost:9016
|
|
|
|
|
|
|
|
tags:
|
|
|
|
- name: provision
|
|
|
|
description: Everything about your Provision
|
|
|
|
externalDocs:
|
|
|
|
description: Find out more about provision
|
|
|
|
url: http://docs.mainflux.io/
|
2020-10-09 21:25:09 +08:00
|
|
|
|
|
|
|
paths:
|
|
|
|
/mapping:
|
|
|
|
post:
|
|
|
|
summary: Adds new device to proxy
|
|
|
|
description: Adds new device to proxy
|
|
|
|
tags:
|
|
|
|
- provision
|
|
|
|
requestBody:
|
|
|
|
$ref: "#/components/requestBodies/ProvisionReq"
|
|
|
|
responses:
|
2020-12-15 07:20:42 +08:00
|
|
|
'201':
|
2020-10-09 21:25:09 +08:00
|
|
|
description: Created
|
2020-12-15 07:20:42 +08:00
|
|
|
'400':
|
2020-10-09 21:25:09 +08:00
|
|
|
description: Failed due to malformed JSON.
|
2022-02-02 00:33:23 +08:00
|
|
|
"401":
|
|
|
|
description: Missing or invalid access token provided.
|
2020-12-15 07:20:42 +08:00
|
|
|
'500':
|
2022-02-02 00:33:23 +08:00
|
|
|
$ref: "#/components/responses/ServiceError"
|
2020-10-09 21:25:09 +08:00
|
|
|
get:
|
|
|
|
summary: Gets current mapping.
|
|
|
|
description: Gets current mapping. This can be used in UI
|
|
|
|
so that when bootstrap config is created from UI matches
|
|
|
|
configuration created with provision service.
|
|
|
|
tags:
|
|
|
|
- provision
|
|
|
|
responses:
|
2020-12-15 07:20:42 +08:00
|
|
|
'200':
|
2020-10-09 21:25:09 +08:00
|
|
|
$ref: "#/components/responses/ProvisionRes"
|
2022-02-02 00:33:23 +08:00
|
|
|
"401":
|
|
|
|
description: Missing or invalid access token provided.
|
2020-12-15 07:20:42 +08:00
|
|
|
'500':
|
2022-02-02 00:33:23 +08:00
|
|
|
$ref: "#/components/responses/ServiceError"
|
2022-01-25 04:18:53 +08:00
|
|
|
/health:
|
|
|
|
get:
|
|
|
|
summary: Retrieves service health check info.
|
|
|
|
tags:
|
|
|
|
- health
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
$ref: "#/components/responses/HealthRes"
|
|
|
|
'500':
|
|
|
|
$ref: "#/components/responses/ServiceError"
|
2020-10-09 21:25:09 +08:00
|
|
|
|
|
|
|
components:
|
|
|
|
requestBodies:
|
|
|
|
ProvisionReq:
|
|
|
|
description: MAC address of device or other identifier
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- external_id
|
|
|
|
- external_key
|
|
|
|
properties:
|
|
|
|
external_id:
|
|
|
|
type: string
|
|
|
|
external_key:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
responses:
|
2022-02-02 00:33:23 +08:00
|
|
|
ServiceError:
|
|
|
|
description: Unexpected server-side error occurred.
|
2020-10-09 21:25:09 +08:00
|
|
|
ProvisionRes:
|
|
|
|
description: Current mapping JSON representation.
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: object
|
2022-01-25 04:18:53 +08:00
|
|
|
HealthRes:
|
|
|
|
description: Service Health Check.
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "./schemas/HealthInfo.yml"
|
2022-03-06 08:58:47 +08:00
|
|
|
|
|
|
|
securitySchemes:
|
|
|
|
bearerAuth:
|
|
|
|
type: http
|
|
|
|
scheme: bearer
|
|
|
|
bearerFormat: JWT
|
|
|
|
description: |
|
|
|
|
* Users access: "Authorization: Bearer <user_token>"
|
|
|
|
|
|
|
|
security:
|
|
|
|
- bearerAuth: []
|