summaryrefslogtreecommitdiffstats
path: root/openapi
diff options
context:
space:
mode:
authorputhuparambil.aditya <aditya.puthuparambil@bell.ca>2022-01-20 15:26:52 +0000
committerputhuparambil.aditya <aditya.puthuparambil@bell.ca>2022-01-20 16:56:40 +0000
commitbdcccb58d65b6d8ee0f07304e635b415041fe36f (patch)
tree2e004832dfbdfae526aa7bca497a1282bab4934a /openapi
parent527a90df79174fcbceee0e4f0d17fae200de6a2e (diff)
Align DMI Plugin REST API Specification and Implementation
Issue-ID: CPS-824 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: If4478f6afd6a36570dc2d800484cffdb40c256c9
Diffstat (limited to 'openapi')
-rw-r--r--openapi/components.yml31
-rw-r--r--openapi/openapi.yml61
2 files changed, 33 insertions, 59 deletions
diff --git a/openapi/components.yml b/openapi/components.yml
index aa0827a5..c3812669 100644
--- a/openapi/components.yml
+++ b/openapi/components.yml
@@ -118,26 +118,6 @@ components:
status: 400
message: Bad Request
details: The provided request is not valid
- Unauthorized:
- description: Unauthorized
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorMessage'
- example:
- status: 401
- message: Unauthorized request
- details: This request is unauthorized
- Forbidden:
- description: Forbidden
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorMessage'
- example:
- status: 403
- message: Request Forbidden
- details: This request is forbidden
NotFound:
description: The specified resource was not found
content:
@@ -148,17 +128,16 @@ components:
status: 404
message: Resource Not Found
details: The requested resource is not found
- Conflict:
- description: Conflict
+ ServerError:
+ description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
example:
- status: 409
- message: Conflicting request
- details: The request cannot be processed as the resource is in use.
-
+ status: 500
+ message: Internal Server Error
+ details: Internal Server Error occured
parameters:
cmHandleInPath:
name: cmHandle
diff --git a/openapi/openapi.yml b/openapi/openapi.yml
index 6605a2df..e9772620 100644
--- a/openapi/openapi.yml
+++ b/openapi/openapi.yml
@@ -53,12 +53,11 @@ paths:
application/json:
schema:
$ref: 'components.yml#/components/schemas/ModuleSet'
- '400':
- $ref: 'components.yml#/components/responses/BadRequest'
- '401':
- $ref: 'components.yml#/components/responses/Unauthorized'
- '403':
- $ref: 'components.yml#/components/responses/Forbidden'
+ '404':
+ $ref: 'components.yml#/components/responses/NotFound'
+ '500':
+ $ref: 'components.yml#/components/responses/ServerError'
+
/v1/ch/{cmHandle}/moduleResources:
post:
@@ -82,12 +81,10 @@ paths:
application/json:
schema:
$ref: 'components.yml#/components/schemas/YangResources'
- '400':
- $ref: 'components.yml#/components/responses/BadRequest'
- '401':
- $ref: 'components.yml#/components/responses/Unauthorized'
- '403':
- $ref: 'components.yml#/components/responses/Forbidden'
+ '404':
+ $ref: 'components.yml#/components/responses/NotFound'
+ '500':
+ $ref: 'components.yml#/components/responses/ServerError'
/v1/inventory/cmHandles:
post:
@@ -114,10 +111,8 @@ paths:
example: cm-handle registered successfully
'400':
$ref: 'components.yml#/components/responses/BadRequest'
- '401':
- $ref: 'components.yml#/components/responses/Unauthorized'
- '403':
- $ref: 'components.yml#/components/responses/Forbidden'
+ '500':
+ $ref: 'components.yml#/components/responses/ServerError'
/v1/ch/{cmHandle}/data/ds/ncmp-datastore:passthrough-operational:
post:
@@ -150,10 +145,8 @@ paths:
revision: my-revision
'400':
$ref: 'components.yml#/components/responses/BadRequest'
- '401':
- $ref: 'components.yml#/components/responses/Unauthorized'
- '403':
- $ref: 'components.yml#/components/responses/Forbidden'
+ '500':
+ $ref: 'components.yml#/components/responses/ServerError'
/v1/ch/{cmHandle}/data/ds/ncmp-datastore:passthrough-running:
post:
@@ -173,24 +166,26 @@ paths:
schema:
$ref: 'components.yml#/components/schemas/DataAccessRequest'
responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ example:
+ - yangSource: my-yang-source
+ moduleName: my-module-name
+ revision: my-revision
'201':
description: Created
content:
text/plain:
schema:
type: string
- examples:
- Read:
- value:
- - yangSource: my-yang-source
- moduleName: my-module-name
- revision: my-revision
- Write:
- value: "Created Resource Name"
-
+ example: my-resource
+ '204':
+ $ref: 'components.yml#/components/responses/NoContent'
'400':
$ref: 'components.yml#/components/responses/BadRequest'
- '401':
- $ref: 'components.yml#/components/responses/Unauthorized'
- '403':
- $ref: 'components.yml#/components/responses/Forbidden'
+ '500':
+ $ref: 'components.yml#/components/responses/ServerError'