Files
wlan-cloud-owprov/openapi/ow_prov.yaml
2021-08-17 10:54:16 -07:00

1224 lines
29 KiB
YAML

openapi: 3.0.1
info:
title: OpenWiFi Provisioning Model
description: Definitions and APIs to manages an OpenWiFi network.
version: 2.1.0
license:
name: BSD3
servers:
- url: 'https://localhost:16005/api/v1'
security:
- bearerAuth: []
- ApiKeyAuth: []
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-KEY
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
responses:
NotFound:
description: The specified resource was not found.
content:
application/json:
schema:
properties:
ErrorCode:
type: integer
ErrorDetails:
type: string
ErrorDescription:
type: string
Unauthorized:
description: The requested does not have sufficient rights to perform the operation.
content:
application/json:
schema:
properties:
ErrorCode:
type: integer
ErrorDetails:
type: string
ErrorDescription:
type: string
Success:
description: The requested operation was performed.
content:
application/json:
schema:
properties:
Operation:
type: string
Details:
type: string
Code:
type: integer
schemas:
ObjectInfo:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
description:
type: string
notes:
type: array
items:
$ref: '#/components/schemas/NoteInfo'
created:
type: integer
format: int64
modified:
type: integer
format: int64
# uuids: mpe:<uuid>
ManagementPolicyEntry:
type: object
properties:
users:
type: array
items:
type: string
resources:
description: this is a list of UUID and UUID Patterns to control by this policy
type: array
items:
type: string
access:
type: array
items:
type: string
enum:
- NOACCESS
- READ
- MODIFY
- DELETE
- LIST
- CREATE
- FULL
policy:
description: A JSON document describing the policy
type: string
# uuids: mpp:<uuid>
ManagementPolicy:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
entries:
type: array
items:
$ref: '#/components/schemas/ManagementPolicyEntry'
# uuids: ent:<uuid>
Entity:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
parent:
description: If empty, then this is the root entity, otherwise this points to a parent entity
type: string
format: uuid
children:
type: array
items:
type: string
format: uuid
managers:
description: The list of UUID of the management groups allowed to manage this entity
type: array
items:
type: string
format: uuid
venues:
description: The list of UUID of the venues for this entity
type: array
items:
type: string
format: uuid
contacts:
description: The list of UUID of the contacts for the entity
type: array
items:
type: string
format: uuid
locations:
description: The list of UUID of the locations associated with thit entiry
type: array
items:
type: string
format: uuid
managementPolicy:
type: string
format: uuid
DiGraphEntry:
type: object
properties:
parent:
type: string
format: uuid
child:
type: string
format: uuid
DiGraph:
type: array
items:
$ref: '#/components/schemas/DiGraphEntry'
# uuids: ven:<uuid>
Venue:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
owner:
type: string
format: uuid
parent:
type: string
format: uuid
children:
type: array
items:
type: string
format: uuid
managers:
type: array
items:
type: string
format: uuid
managementPolicy:
type: string
format: uuid
devices:
type: array
items:
type: string
format: uuid
topology:
$ref: '#/components/schemas/DiGraph'
design:
type: string
# uuids: mgg:<uuid>
ManagementGroup:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
managementPolicy:
$ref: '#/components/schemas/ManagementPolicy'
managers:
type: array
items:
type: string
format: uuid
# uuids: loc:<uuid>
Location:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
type:
type: string
enum:
- SERVICE
- EQUIPMENT
- AUTO
- MANUAL
- SPECIAL
- UNKNOWN
- CORPORATE
buildingName:
type: string
addressLines:
type: array
items:
type: string
city:
type: string
state:
type: string
postal:
type: string
country:
type: string
telephones:
type: array
items:
type: string
contact:
type: string
format: uuid
# uuids: con:<uuid>
Contact:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
type:
type: string
enum:
- SUBSCRIBER
- USER
- INSTALLER
- CSR
- MANAGER
- BUSINESSOWNER
- TECHNICIAN
- CORPORATE
title:
type: string
salutation:
type: string
firstname:
type: string
lastname:
type: string
initials:
type: string
visual:
type: string
mobiles:
type: array
items:
type: string
phones:
type: array
items:
type: string
location:
type: string
format: uuid
primaryEmail:
type: string
secondaryEmail:
type: string
accessPIN:
type: string
# uuids: svc:<uuid>
ServiceConfiguration:
type: object
properties:
id:
type: string
format: uuid
managementPolicy:
$ref: '#/components/schemas/ManagementPolicy'
# uuids: cfg:<uuid>
DeviceConfiguration:
type: object
properties:
id:
type: string
format: uuid
managementPolicy:
$ref: '#/components/schemas/ManagementPolicy'
deviceTypes:
type: array
items:
type: string
configuration:
type: string
InventoryTag:
type: object
properties:
allOf:
$ref: '#/components/schemas/ObjectInfo'
serialNumber:
type: string
deviceType:
type: string
venue:
type: string
format: uuid
entity:
type: string
format: uuid
subEntity:
type: string
format: uuid
subVenue:
type: string
format: uuid
qrCode:
type: string
InventoryTagList:
type: object
properties:
tags:
type: array
items:
$ref: '#/components/schemas/InventoryTag'
SerialNumberList:
type: object
properties:
serialNumbers:
type: array
items:
type: string
#########################################################################################
##
## These are endpoints that all services in the OPenWiFI stack must provide
##
#########################################################################################
AnyPayload:
type: object
properties:
Document:
type: string
StringList:
type: object
properties:
list:
type: array
items:
type: string
TagValuePair:
type: object
properties:
tag:
type: string
value:
type: string
TagValuePairList:
type: object
properties:
tagList:
type: array
items:
$ref: '#/components/schemas/TagValuePair'
TagIntPair:
type: object
properties:
tag:
type: string
value:
type: integer
format: int64
TagIntPairList:
type: object
properties:
tagList:
type: array
items:
$ref: '#/components/schemas/TagIntPair'
SystemCommandDetails:
type: object
properties:
command:
type: string
enum:
- setloglevels
- getloglevels
- getSubSystemNames
- getLogLevelNames
- stats
parameters:
oneOf:
- $ref: '#/components/schemas/StringList'
- $ref: '#/components/schemas/TagValuePairList'
SystemCommandResults:
type: object
oneOf:
- $ref: '#/components/schemas/StringList'
- $ref: '#/components/schemas/TagValuePairList'
NoteInfo:
type: object
properties:
created:
type: integer
format: int64
createdBy:
type: string
note:
type: string
Dashboard:
type: object
properties:
snapshot:
type: integer
format: int64
tenants:
$ref: '#/components/schemas/TagIntPairList'
paths:
/entity/{uuid}:
get:
tags:
- Entities
operationId: getEntity
summary: Retrieve a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
example: When looking for the root entity, the uuid 0000-0000-0000 must be entered.
required: true
responses:
200:
$ref: '#/components/schemas/Entity'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
post:
tags:
- Entities
operationId: createEntity
summary: Create a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
example: When creating the root entity, the uuid 0000-0000-0000 must be entered. When creating a non-root entity, uuid must be 1
required: true
requestBody:
description: Information used to create the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/Entity'
responses:
200:
$ref: '#/components/schemas/Entity'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- Entities
operationId: modifyEntity
summary: Modify a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
example: When modifying the root entity, the uuid 0000-0000-0000 must be entered.
required: true
requestBody:
description: Information used to modify the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/Entity'
responses:
200:
$ref: '#/components/schemas/Entity'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- Entities
operationId: deleteEntity
summary: Retrieve the list of entities
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
example: The root entity cannot be deleted.
required: true
responses:
204:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/contact/{uuid}:
get:
tags:
- Contacts
operationId: getContact
summary: Retrieve a specific contact
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
responses:
200:
$ref: '#/components/schemas/Contact'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
post:
tags:
- Contacts
operationId: createContact
summary: Create a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to create the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/Contact'
responses:
200:
$ref: '#/components/schemas/Contact'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- Contacts
operationId: modifyContact
summary: Modify a specific contact
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to modify the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/Contact'
responses:
200:
$ref: '#/components/schemas/Contact'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- Contacts
operationId: deleteContact
summary: Delete a contact
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
responses:
204:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/location/{uuid}:
get:
tags:
- Locations
operationId: getLocation
summary: Retrieve a specific location
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
responses:
200:
$ref: '#/components/schemas/Location'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
post:
tags:
- Locations
operationId: createLocation
summary: Create a specific location
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to create the new location
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
responses:
200:
$ref: '#/components/schemas/Location'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- Locations
operationId: modifyLocation
summary: Modify a specific location
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to modify the new location
content:
application/json:
schema:
$ref: '#/components/schemas/Location'
responses:
200:
$ref: '#/components/schemas/Location'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- Locations
operationId: deleteLocation
summary: Delete a location
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
responses:
204:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/inventory:
get:
tags:
- Inventory
operationId: getInventoryTags
summary: Retrieve a specific inventory tag
parameters:
- in: query
name: entity
schema:
type: string
format: uuid
required: false
- in: query
name: venue
schema:
type: string
format: uuid
required: false
- in: query
name: unassigned
schema:
type: boolean
required: false
- in: query
name: deviceType
schema:
type: string
required: false
- in: query
description: Pagination start (starts at 1. If not specified, 1 is assumed)
name: offset
schema:
type: integer
required: false
- in: query
description: Maximum number of entries to return (if absent, no limit is assumed)
name: limit
schema:
type: integer
required: false
- in: query
description: Filter the results
name: filter
schema:
type: string
required: false
- in: query
description: Supply a list of devices comma separated
name: select
schema:
type: string
example: serial1,serial2,serial3
required: false
- in: query
description: only serial numbers of full device details
name: serialOnly
schema:
type: boolean
required: false
- in: query
description: return the number of devices
name: countOnly
schema:
type: boolean
required: false
responses:
200:
description: Return a list of elements
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/SerialNumberList'
- $ref: '#/components/schemas/InventoryTagList'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/inventory/{serialNumber}:
get:
tags:
- Inventory
operationId: getInventory
summary: Retrieve a specific inventory tag
parameters:
- in: path
name: serialNumber
schema:
type: string
format: uuid
required: true
responses:
200:
$ref: '#/components/schemas/InventoryTag'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
post:
tags:
- Inventory
operationId: createInventory
summary: Create a specific Inventory
parameters:
- in: path
name: serialNumber
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to create the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/InventoryTag'
responses:
200:
$ref: '#/components/schemas/InventoryTag'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- Inventory
operationId: modifyInventory
summary: Modify a specific Inventory
parameters:
- in: path
name: serialNumber
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to modify the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/InventoryTag'
responses:
200:
$ref: '#/components/schemas/InventoryTag'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- Inventory
operationId: deleteInventory
summary: Delete a specific Inventory
parameters:
- in: path
name: serialNumber
schema:
type: string
format: uuid
required: true
responses:
204:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/venue/{uuid}:
get:
tags:
- Venues
operationId: getVenue
summary: Retrieve a specific venue
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
responses:
200:
$ref: '#/components/schemas/Venue'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
post:
tags:
- Venues
operationId: createVenue
summary: Create a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to create the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/Venue'
responses:
200:
$ref: '#/components/schemas/Venue'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- Venues
operationId: modifyVenue
summary: Modify a specific venue
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to modify the new venue
content:
application/json:
schema:
$ref: '#/components/schemas/Venue'
responses:
200:
$ref: '#/components/schemas/Venue'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- Venues
operationId: deleteVenue
summary: Delete a venue
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
example: The root entity cannot be deleted.
required: true
responses:
204:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/managementPolicy/{uuid}:
get:
tags:
- Management Policies
operationId: getManagementPolicy
summary: Retrieve a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
responses:
200:
$ref: '#/components/schemas/ManagementPolicy'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
post:
tags:
- Management Policies
operationId: createManagementPolicy
summary: Create a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to create the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/ManagementPolicy'
responses:
200:
$ref: '#/components/schemas/ManagementPolicy'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
put:
tags:
- Management Policies
operationId: modifyManagementPolicy
summary: Modify a specific entity
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
required: true
requestBody:
description: Information used to modify the new entity
content:
application/json:
schema:
$ref: '#/components/schemas/ManagementPolicy'
responses:
200:
$ref: '#/components/schemas/ManagementPolicy'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
delete:
tags:
- Management Policies
operationId: deleteManagementPolicy
summary: Retrieve the list of entities
parameters:
- in: path
name: uuid
schema:
type: string
format: uuid
example: The root entity cannot be deleted.
required: true
responses:
204:
$ref: '#/components/responses/Success'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
#########################################################################################
##
## These are endpoints that all services in the OpenWiFi stack must provide
##
#########################################################################################
/dashboard:
get:
tags:
- Dashboards
summary: Get the last version of the dashboard
operationId: getDeviceDashboard
responses:
200:
$ref: '#/components/schemas/Dashboard'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
/system:
post:
tags:
- System Commands
summary: Perform some systeme wide commands
operationId: systemCommand
requestBody:
description: Command details
content:
application/json:
schema:
$ref: '#/components/schemas/SystemCommandDetails'
responses:
200:
description: Successfull command execution
content:
application/json:
schema:
$ref: '#/components/schemas/SystemCommandResults'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'
get:
tags:
- System Commands
summary: Retrieve different values from the running service.
operationId: getSystemCommand
parameters:
- in: query
description: Get a value
name: command
schema:
type: string
enum:
- version
- times
required: true
responses:
200:
description: Successfull command execution
content:
application/json:
schema:
$ref: '#/components/schemas/TagValuePair'
403:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'