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

Fix api docs #1424

Merged
merged 4 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .dredd/hooks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
94 changes: 92 additions & 2 deletions api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1016,6 +1082,7 @@ paths:
minimum: 2
role:
type: string
enum: [owner,manager,task_runner,guest]
example: owner
responses:
204:
Expand All @@ -1041,6 +1108,7 @@ paths:
properties:
role:
type: string
enum: [owner,manager,task_runner,guest]
example: owner
summary: Update user role
responses:
Expand Down Expand Up @@ -1173,6 +1241,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
Expand Down Expand Up @@ -1345,12 +1428,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:
Expand All @@ -1359,7 +1449,7 @@ paths:
201:
description: template created
schema:
$ref: "#/definitions/Template"
$ref: "#/definitions/TemplateRequest"
/project/{project_id}/templates/{template_id}:
parameters:
- $ref: "#/parameters/project_id"
Expand Down