From 7c34f2cdcd7c5af210380fdda92bd06bd2ce8e2d Mon Sep 17 00:00:00 2001 From: Jonathan <3713684+gsmlg@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:42:42 +0800 Subject: [PATCH] fix: Update api-docs.yml Add login_password and ssh for AccessKey --- .dredd/hooks/main.go | 1 + api-docs.yml | 94 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/.dredd/hooks/main.go b/.dredd/hooks/main.go index 5977350ef..30e17b994 100644 --- a/.dredd/hooks/main.go +++ b/.dredd/hooks/main.go @@ -81,6 +81,7 @@ func main() { h.Before("project > /api/project/{project_id}/keys/{key_id} > Removes access key > 204 > application/json", capabilityWrapper("access_key")) h.Before("project > /api/project/{project_id}/repositories > Add repository > 204 > application/json", capabilityWrapper("access_key")) + h.Before("project > /api/project/{project_id}/repositories/{repository_id} > Updates repository > 204 > application/json", capabilityWrapper("repository")) h.Before("project > /api/project/{project_id}/repositories/{repository_id} > Removes repository > 204 > application/json", capabilityWrapper("repository")) h.Before("project > /api/project/{project_id}/inventory > create inventory > 201 > application/json", capabilityWrapper("inventory")) diff --git a/api-docs.yml b/api-docs.yml index 95e25e33f..6d9b844d5 100644 --- a/api-docs.yml +++ b/api-docs.yml @@ -186,6 +186,28 @@ definitions: type: integer minimum: 1 x-example: 2 + login_password: + type: object + properties: + password: + type: string + x-example: password + example: password + login: + type: string + x-example: username + example: username + ssh: + type: object + properties: + login: + type: string + x-example: user + example: user + private_key: + type: string + x-example: private key + example: private key AccessKey: type: object @@ -200,6 +222,28 @@ definitions: enum: [none,ssh,login_password] project_id: type: integer + login_password: + type: object + properties: + password: + type: string + x-example: password + example: password + login: + type: string + x-example: username + example: username + ssh: + type: object + properties: + login: + type: string + x-example: user + example: user + private_key: + type: string + x-example: private key + example: private key EnvironmentRequest: type: object @@ -383,6 +427,12 @@ definitions: limit: type: string example: '' + suppress_success_alerts: + type: boolean + survey_vars: + type: array + items: + $ref: "#/definitions/TemplateSurveyVar" Template: type: object properties: @@ -418,6 +468,22 @@ definitions: allow_override_args_in_task: type: boolean example: false + suppress_success_alerts: + type: boolean + TemplateSurveyVar: + type: object + properties: + name: + type: string + title: + type: string + description: + type: string + type: + type: string + example: String => "", Integer => "int" + required: + type: boolean ScheduleRequest: type: object @@ -1011,6 +1077,7 @@ paths: minimum: 2 role: type: string + enum: [owner,manager,task_runner,guest] example: owner responses: 204: @@ -1036,6 +1103,7 @@ paths: properties: role: type: string + enum: [owner,manager,task_runner,guest] example: owner summary: Update user role responses: @@ -1168,6 +1236,21 @@ paths: parameters: - $ref: "#/parameters/project_id" - $ref: "#/parameters/repository_id" + put: + tags: + - project + summary: Updates repository + parameters: + - name: Repository + in: body + required: true + schema: + $ref: "#/definitions/RepositoryRequest" + responses: + 204: + description: Repository updated + 400: + description: Bad request delete: tags: - project @@ -1340,12 +1423,19 @@ paths: type: array items: $ref: "#/definitions/Template" + properties: + survey_vars: + type: array + items: + $ref: "#/definitions/TemplateSurveyVar" + last_task: + $ref: "#/definitions/Task" post: tags: - project summary: create template parameters: - - name: template + - name: templateyes in: body required: true schema: @@ -1354,7 +1444,7 @@ paths: 201: description: template created schema: - $ref: "#/definitions/Template" + $ref: "#/definitions/TemplateRequest" /project/{project_id}/templates/{template_id}: parameters: - $ref: "#/parameters/project_id"