-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(COR-683): add api to create, update, delete and list variable en…
…dpoint
- Loading branch information
Showing
7 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
get: | ||
summary: 'List variables' | ||
operationId: listVariables | ||
parameters: | ||
- in: query | ||
name: parent_id | ||
schema: | ||
type: string | ||
format: uuid | ||
description: the id where the variable will be added | ||
- in: query | ||
name: scope | ||
schema: | ||
$ref: '../../schemas/enums/APIVariableScope.yaml' | ||
description: the scope of the parent where the variable will be added | ||
- in: query | ||
name: is_secret | ||
schema: | ||
type: boolean | ||
nullable: true | ||
description: true if the variable is a secret | ||
tags: | ||
- Variable Main Calls | ||
responses: | ||
'200': | ||
description: 'List variables' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../schemas/variable/VariableResponseList.yaml' | ||
'401': | ||
$ref: '../../responses/NotAuthorized.yaml' | ||
'403': | ||
$ref: '../../responses/Forbidden.yaml' | ||
'404': | ||
$ref: '../../responses/NotFound.yaml' | ||
post: | ||
summary: 'Create a variable' | ||
description: | | ||
- Create a variable at the level defined in the request body. | ||
operationId: createVariable | ||
|
||
tags: | ||
- Variable Main Calls | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../schemas/variable/VariableRequest.yaml' | ||
responses: | ||
'201': | ||
description: 'Create a variable' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../schemas/variable/VariableResponse.yaml' | ||
'400': | ||
$ref: '../../responses/BadRequest.yaml' | ||
'401': | ||
$ref: '../../responses/NotAuthorized.yaml' | ||
'403': | ||
$ref: '../../responses/Forbidden.yaml' | ||
'404': | ||
$ref: '../../responses/NotFound.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
delete: | ||
Check failure on line 1 in src/resources/variable/VariableRef.yaml GitHub Actions / Lint (pull_request)path-params
|
||
summary: 'Delete a variable' | ||
description: | | ||
- To delete a variable | ||
- You can't delete a BUILT_IN variable | ||
- If you delete a variable having override or alias, the associated override/alias will be deleted as well | ||
operationId: deleteVariable | ||
parameters: | ||
- $ref: '../../parameters/path/VariableId.yaml' | ||
|
||
tags: | ||
- Variable Main Calls | ||
responses: | ||
'204': | ||
$ref: '../../responses/Deleted.yaml' | ||
'401': | ||
$ref: '../../responses/NotAuthorized.yaml' | ||
'403': | ||
$ref: '../../responses/Forbidden.yaml' | ||
'404': | ||
$ref: '../../responses/NotFound.yaml' | ||
|
||
put: | ||
summary: 'Edit a variable' | ||
description: | | ||
- You can't edit a BUILT_IN variable | ||
- For an override, you can't edit the key | ||
- For an alias, you can't edit the value | ||
operationId: editVariable | ||
parameters: | ||
- $ref: '../../parameters/path/applicationId.yaml' | ||
|
||
tags: | ||
- Variable Main Calls | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../schemas/variable/VariableEditRequest.yaml' | ||
responses: | ||
'200': | ||
description: 'Edited variable value' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../schemas/variable/VariableResponse.yaml' | ||
'400': | ||
$ref: '../../responses/BadRequest.yaml' | ||
'401': | ||
$ref: '../../responses/NotAuthorized.yaml' | ||
'403': | ||
$ref: '../../responses/Forbidden.yaml' | ||
'404': | ||
$ref: '../../responses/NotFound.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
type: object | ||
required: | ||
- key | ||
- value | ||
properties: | ||
key: | ||
type: string | ||
value: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
type: object | ||
required: | ||
- key | ||
- value | ||
- is_secret | ||
- variable_scope | ||
- variable_parent_id | ||
properties: | ||
key: | ||
type: string | ||
value: | ||
type: string | ||
mount_path: | ||
type: string | ||
nullable: true | ||
is_secret: | ||
type: boolean | ||
variable_scope: | ||
$ref: '../enums/APIVariableScope.yaml' | ||
variable_parent_id: | ||
type: string | ||
format: uuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: object | ||
properties: | ||
results: | ||
type: array | ||
items: | ||
$ref: './VariableResponse.yaml' |