Skip to content

Commit

Permalink
docs: Add common API /secret to all Swagger filesi
Browse files Browse the repository at this point in the history
close edgexfoundry#4649

Signed-off-by: Ginny Guan <[email protected]>
  • Loading branch information
jinlinGuan committed Aug 24, 2023
1 parent 23e3a0f commit f6c100a
Show file tree
Hide file tree
Showing 5 changed files with 350 additions and 6 deletions.
97 changes: 97 additions & 0 deletions openapi/v3/core-command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,54 @@ components:
serviceName:
description: "Outputs the name of the service the response is from"
type: string
BaseRequest:
description: "Defines basic properties which all use-case specific request DTO instances should support."
type: object
properties:
requestId:
description: "Uniquely identifies this request. For implementation, recommend this value be generated by the type's constructor."
type: string
format: uuid
example: "e6e8a2f4-eb14-4649-9e2b-175247911369"
apiVersion:
description: "A version number shows the API version in DTOs."
type: string
example: v3
required:
- apiVersion
SecretRequest:
allOf:
- $ref: '#/components/schemas/BaseRequest'
description: Defines the secret data to be stored
type: object
properties:
secretName:
description: Specifies the name of the secret
type: string
example: "credentials"
secretData:
description: A list of the key/value pairs of secret data to store
type: array
items:
$ref: '#/components/schemas/SecretDataKeyValue'
required:
- secretName
- secretData
SecretDataKeyValue:
description: Defines a key/value pair of secret data
type: object
properties:
key:
description: The key to identify the secret data
type: string
example: "secret-key"
value:
description: The value of the secret data
type: string
example: "secret-value"
required:
- key
- value
parameters:
offsetParam:
in: query
Expand Down Expand Up @@ -845,3 +893,52 @@ paths:
examples:
500Example:
$ref: '#/components/examples/500Example'
/secret:
parameters:
- $ref: '#/components/parameters/correlatedRequestHeader'
post:
summary: Adds EdgeX Service exclusive secret to the Secret Store
requestBody:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SecretRequest'
required: true
responses:
'201':
description: "Created"
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
example:
apiVersion: "v3"
statusCode: 201
'400':
description: "Invalid request."
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
400Example:
$ref: '#/components/examples/400Example'
'500':
description: "An unexpected error happened on the server."
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
500Example:
$ref: '#/components/examples/500Example'
84 changes: 83 additions & 1 deletion openapi/v3/core-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,39 @@ components:
serviceName:
description: "Outputs the name of the service the response is from"
type: string
SecretRequest:
allOf:
- $ref: '#/components/schemas/BaseRequest'
description: Defines the secret data to be stored
type: object
properties:
secretName:
description: Specifies the name of the secret
type: string
example: "credentials"
secretData:
description: A list of the key/value pairs of secret data to store
type: array
items:
$ref: '#/components/schemas/SecretDataKeyValue'
required:
- secretName
- secretData
SecretDataKeyValue:
description: Defines a key/value pair of secret data
type: object
properties:
key:
description: The key to identify the secret data
type: string
example: "secret-key"
value:
description: The value of the secret data
type: string
example: "secret-value"
required:
- key
- value
parameters:
offsetParam:
in: query
Expand Down Expand Up @@ -1930,4 +1963,53 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
examples:
500Example:
$ref: '#/components/examples/500Example'
$ref: '#/components/examples/500Example'
/secret:
parameters:
- $ref: '#/components/parameters/correlatedRequestHeader'
post:
summary: Adds EdgeX Service exclusive secret to the Secret Store
requestBody:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SecretRequest'
required: true
responses:
'201':
description: "Created"
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
example:
apiVersion: "v3"
statusCode: 201
'400':
description: "Invalid request."
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
400Example:
$ref: '#/components/examples/400Example'
'500':
description: "An unexpected error happened on the server."
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
500Example:
$ref: '#/components/examples/500Example'
82 changes: 82 additions & 0 deletions openapi/v3/core-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,39 @@ components:
properties:
uom:
$ref: '#/components/schemas/UnitsOfMeasure'
SecretRequest:
allOf:
- $ref: '#/components/schemas/BaseRequest'
description: Defines the secret data to be stored
type: object
properties:
secretName:
description: Specifies the name of the secret
type: string
example: "credentials"
secretData:
description: A list of the key/value pairs of secret data to store
type: array
items:
$ref: '#/components/schemas/SecretDataKeyValue'
required:
- secretName
- secretData
SecretDataKeyValue:
description: Defines a key/value pair of secret data
type: object
properties:
key:
description: The key to identify the secret data
type: string
example: "secret-key"
value:
description: The value of the secret data
type: string
example: "secret-value"
required:
- key
- value
parameters:
offsetParam:
in: query
Expand Down Expand Up @@ -3998,3 +4031,52 @@ paths:
examples:
500Example:
$ref: '#/components/examples/500Example'
/secret:
parameters:
- $ref: '#/components/parameters/correlatedRequestHeader'
post:
summary: Adds EdgeX Service exclusive secret to the Secret Store
requestBody:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SecretRequest'
required: true
responses:
'201':
description: "Created"
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
example:
apiVersion: "v3"
statusCode: 201
'400':
description: "Invalid request."
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
400Example:
$ref: '#/components/examples/400Example'
'500':
description: "An unexpected error happened on the server."
headers:
X-Correlation-ID:
$ref: '#/components/headers/correlatedResponseHeader'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
500Example:
$ref: '#/components/examples/500Example'
9 changes: 5 additions & 4 deletions openapi/v3/support-notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -540,29 +540,30 @@ components:
secretName:
description: Specifies the name of the secret
type: string
example: "credentials"
secretData:
description: A list of the key/value pairs of secret data to store
type: array
items:
$ref: '#/components/schemas/SecretDataKeyValue'
required:
- secretName
- secrets
- secretData
SecretDataKeyValue:
description: Defines a key/value pair of secret data
type: object
properties:
key:
description: The key to identify the secret data
type: string
example: "appsecret"
example: "secret-key"
value:
description: The value of the secret data
type: string
example: "appsecret-value"
example: "secret-value"
required:
- key
- value
- value
parameters:
offsetParam:
in: query
Expand Down
Loading

0 comments on commit f6c100a

Please sign in to comment.