Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a gateways groups endpoint to the managament API #2055

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 109 additions & 6 deletions site/documentation/content/api/management/device-registry-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,85 @@ paths:
412:
$ref: '#/components/responses/ResourceVersionMismatch'

# Gateway groups API

/gateway-groups/{tenantId}:

parameters:
- $ref: '#/components/parameters/tenantId'

get:
tags:
- gateway groups
summary: Retrieve the list of existing gateway groups for the tenant.
operationId: getGatewayGroupsForTenant

responses:
200:
description: Operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/gatewayGroupsSet'
400:
$ref: '#/components/responses/MalformedRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'

/gateway-groups/{tenantId}/{groupId}/via:

parameters:
- $ref: '#/components/parameters/tenantId'
- $ref: '#/components/parameters/groupId'

get:
tags:
- gateway groups
summary: Retrieve the list of devices that can use this group as a gateway.
operationId: getDevicesUsingGatewayGroup

responses:
200:
description: Operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/deviceIDsSet'
400:
$ref: '#/components/responses/MalformedRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'

/gateway-groups/{tenantId}/{groupId}/members:

parameters:
- $ref: '#/components/parameters/tenantId'
- $ref: '#/components/parameters/groupId'

get:
tags:
- gateway groups
summary: Retrieve the list of devices in that gateway group.
operationId: getDevicesInGatewayGroup

responses:
200:
description: Operation successful
content:
application/json:
schema:
$ref: '#/components/schemas/deviceIDsSet'
400:
$ref: '#/components/responses/MalformedRequest'
401:
$ref: '#/components/responses/Unauthorized'
404:
$ref: '#/components/responses/NotFound'

components:

schemas:
Expand Down Expand Up @@ -863,10 +942,10 @@ components:
properties:
"type":
type: string
pattern: [a-z0-9-]
pattern: "[a-z0-9-]"
"auth-id":
type: string
pattern: [a-zA-Z0-9-_=.]
pattern: "[a-zA-Z0-9-_=.]"
"enabled":
type: boolean
default: true
Expand Down Expand Up @@ -983,6 +1062,20 @@ components:
type: string
format: byte

# Groups of gateways

gatewayGroupsSet:
type: array
description: A set of gateways group IDs. This matches the "memberOf" property on the device payload.
items:
type: string

deviceIDsSet:
type: array
description: A setof devices IDs. All the devices belongs in the same gateway group.
items:
type: string

parameters:

resourceVersion:
Expand All @@ -1000,7 +1093,7 @@ components:
required: true
schema:
type: string
pattern: [a-zA-Z0-9-_\\.]
pattern: "[a-zA-Z0-9-_\\.]"
example: DEFAULT_TENANT

deviceId:
Expand All @@ -1010,7 +1103,7 @@ components:
required: true
schema:
type: string
pattern: [a-zA-Z0-9-_\\.]
pattern: "[a-zA-Z0-9-_\\.]"
example: 4711

authId:
Expand All @@ -1020,7 +1113,7 @@ components:
required: true
schema:
type: string
pattern: [a-zA-Z0-9-_=.]
pattern: "[a-zA-Z0-9-_=.]"
example: sensor1

type:
Expand All @@ -1030,9 +1123,19 @@ components:
required: true
schema:
type: string
pattern: [a-z0-9-]
pattern: "[a-z0-9-]"
example: sha-256

groupId:
name: groupId
in: path
description: The ID of the group of gateways
required: true
schema:
type: string
pattern: "[a-zA-Z0-9-_\\.]"
example: buildingA

responses:

Unauthorized:
Expand Down