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

MG-2441 - Add domain ID to API #2442

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
19 changes: 14 additions & 5 deletions api/openapi/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tags:
url: https://docs.magistrala.abstractmachines.fr/

paths:
/things/configs:
/domains/{domainID}/things/configs:
post:
operationId: createConfig
summary: Adds new config
Expand All @@ -36,6 +36,8 @@ paths:
the provided access token.
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/ConfigCreateReq"
responses:
Expand Down Expand Up @@ -70,6 +72,7 @@ paths:
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/State"
Expand All @@ -85,13 +88,14 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/things/configs/{configId}:
/domains/{domainID}/things/configs/{configId}:
get:
operationId: getConfig
summary: Retrieves config info (with channels).
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ConfigId"
responses:
"200":
Expand All @@ -118,6 +122,7 @@ paths:
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigUpdateReq"
Expand Down Expand Up @@ -147,6 +152,7 @@ paths:
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ConfigId"
responses:
"204":
Expand All @@ -161,7 +167,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/things/configs/certs/{configId}:
/domains/{domainID}/things/configs/certs/{configId}:
patch:
operationId: updateConfigCerts
summary: Updates certs
Expand All @@ -171,6 +177,7 @@ paths:
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigCertUpdateReq"
Expand All @@ -192,7 +199,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/things/configs/connections/{configId}:
/domains/{domainID}/things/configs/connections/{configId}:
put:
operationId: updateConfigConnections
summary: Updates channels the thing is connected to
Expand All @@ -202,6 +209,7 @@ paths:
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigConnUpdateReq"
Expand Down Expand Up @@ -273,7 +281,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/things/state/{configId}:
/domains/{domainID}/things/state/{configId}:
put:
operationId: updateConfigState
summary: Updates Config state.
Expand All @@ -283,6 +291,7 @@ paths:
tags:
- configs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigStateUpdateReq"
Expand Down
11 changes: 8 additions & 3 deletions api/openapi/certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ tags:
url: https://docs.magistrala.abstractmachines.fr/

paths:
/certs:
/domains/{domainID}/certs:
post:
operationId: createCert
summary: Creates a certificate for thing
description: Creates a certificate for thing
tags:
- certs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/CertReq"
responses:
Expand All @@ -51,7 +53,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/certs/{certID}:
/domains/{domainID}/certs/{certID}:
get:
operationId: getCert
summary: Retrieves a certificate
Expand All @@ -60,6 +62,7 @@ paths:
tags:
- certs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/CertID"
responses:
"200":
Expand All @@ -85,6 +88,7 @@ paths:
tags:
- certs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/CertID"
responses:
"200":
Expand All @@ -100,7 +104,7 @@ paths:
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/serials/{thingID}:
/domains/{domainID}/serials/{thingID}:
get:
operationId: getSerials
summary: Retrieves certificates' serial IDs
Expand All @@ -109,6 +113,7 @@ paths:
tags:
- certs
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/ThingID"
responses:
"200":
Expand Down
66 changes: 13 additions & 53 deletions api/openapi/invitations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ tags:
url: https://docs.magistrala.abstractmachines.fr/

paths:
/invitations:
/domains/{domainID}/invitations:
post:
operationId: sendInvitation
tags:
- Invitations
summary: Send invitation
description: |
Send invitation to user to join domain.
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/SendInvitationReq"
security:
Expand Down Expand Up @@ -70,7 +72,7 @@ paths:
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/UserID"
- $ref: "#/components/parameters/InvitedBy"
- $ref: "#/components/parameters/DomainID"
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/Relation"
- $ref: "#/components/parameters/State"
security:
Expand All @@ -91,7 +93,7 @@ paths:
"500":
$ref: "#/components/responses/ServiceError"

/invitations/accept:
/domains/{domainID}/invitations/accept:
post:
operationId: acceptInvitation
summary: Accept invitation
Expand All @@ -101,8 +103,8 @@ paths:
- Invitations
security:
- bearerAuth: []
requestBody:
$ref: "#/components/requestBodies/AcceptInvitationReq"
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
responses:
"204":
description: Invitation accepted.
Expand All @@ -115,7 +117,7 @@ paths:
"500":
$ref: "#/components/responses/ServiceError"

/invitations/reject:
/domains/{domainID}/invitations/reject:
post:
operationId: rejectInvitation
summary: Reject invitation
Expand All @@ -125,8 +127,8 @@ paths:
- Invitations
security:
- bearerAuth: []
requestBody:
$ref: "#/components/requestBodies/AcceptInvitationReq"
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
responses:
"204":
description: Invitation rejected.
Expand All @@ -139,7 +141,7 @@ paths:
"500":
$ref: "#/components/responses/ServiceError"

/invitations/{user_id}/{domain_id}:
/domains/{domainID}/invitations/users/{user_id}:
get:
operationId: getInvitation
summary: Retrieves a specific invitation
Expand All @@ -149,7 +151,7 @@ paths:
- Invitations
parameters:
- $ref: "#/components/parameters/user_id"
- $ref: "#/components/parameters/domain_id"
- $ref: "auth.yml#/components/parameters/DomainID"
security:
- bearerAuth: []
responses:
Expand All @@ -175,7 +177,7 @@ paths:
- Invitations
parameters:
- $ref: "#/components/parameters/user_id"
- $ref: "#/components/parameters/domain_id"
- $ref: "auth.yml#/components/parameters/DomainID"
security:
- bearerAuth: []
responses:
Expand Down Expand Up @@ -212,11 +214,6 @@ components:
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: User unique identifier.
domain_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Domain unique identifier.
relation:
type: string
enum:
Expand All @@ -238,7 +235,6 @@ components:
description: Resend invitation.
required:
- user_id
- domain_id
- relation

Invitation:
Expand Down Expand Up @@ -394,26 +390,6 @@ components:
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

DomainID:
name: domain_id
description: Unique identifier for a domain.
in: query
schema:
type: string
format: uuid
required: false
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

domain_id:
name: domain_id
description: Unique identifier for a domain.
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

InvitedBy:
name: invited_by
description: Unique identifier for a user that invited the user.
Expand Down Expand Up @@ -466,22 +442,6 @@ components:
schema:
$ref: "#/components/schemas/SendInvitationReqObj"

AcceptInvitationReq:
description: JSON-formatted document describing request for accepting invitation
required: true
content:
application/json:
schema:
type: object
properties:
domain_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Domain unique identifier.
required:
- domain_id

responses:
InvitationRes:
description: Data retrieved.
Expand Down
6 changes: 5 additions & 1 deletion api/openapi/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ tags:
url: https://docs.magistrala.abstractmachines.fr/

paths:
/mapping:
/domains/{domainID}/mapping:
post:
summary: Adds new device to proxy
description: Adds new device to proxy
tags:
- provision
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/ProvisionReq"
responses:
Expand All @@ -55,6 +57,8 @@ paths:
configuration created with provision service.
tags:
- provision
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
responses:
"200":
$ref: "#/components/responses/ProvisionRes"
Expand Down
Loading
Loading