Update templates API docs.

This commit is contained in:
Brian Zoetewey 2024-11-20 15:32:13 -05:00
parent 3b156a59b9
commit c4548b017a
2 changed files with 58 additions and 3 deletions

View File

@ -154,6 +154,7 @@ func resolveCapability(caps []string, resolved []string, uid string) {
ViewID: &view.ID, ViewID: &view.ID,
App: db.AppAnsible, App: db.AppAnsible,
GitBranch: &branch, GitBranch: &branch,
SurveyVars: []db.SurveyVar{},
}) })
printError(err) printError(err)

View File

@ -732,6 +732,8 @@ definitions:
TemplateRequest: TemplateRequest:
type: object type: object
properties: properties:
id:
type: integer
project_id: project_id:
type: integer type: integer
minimum: 1 minimum: 1
@ -781,6 +783,16 @@ definitions:
type: array type: array
items: items:
$ref: "#/definitions/TemplateSurveyVar" $ref: "#/definitions/TemplateSurveyVar"
type:
type: string
enum: ["", build, deploy]
start_version:
type: string
build_template_id:
type: integer
autorun:
type: boolean
Template: Template:
type: object type: object
properties: properties:
@ -823,6 +835,28 @@ definitions:
git_branch: git_branch:
type: string type: string
example: main example: main
type:
type: string
enum: ["", build, deploy]
start_version:
type:
- string
- 'null'
build_template_id:
type:
- integer
- 'null'
autorun:
type: boolean
survey_vars:
type: array
items:
$ref: "#/definitions/TemplateSurveyVar"
vaults:
type: array
items:
$ref: "#/definitions/TemplateVault"
TemplateSurveyVar: TemplateSurveyVar:
type: object type: object
properties: properties:
@ -834,12 +868,32 @@ definitions:
type: string type: string
type: type:
type: string type: string
example: String => "", Integer => "int" enum: ["", int, enum, secret] # String => "", Integer => "int"
example: int
required: required:
type: boolean type: boolean
values:
type: array
items:
$ref: "#/definitions/TemplateSurveyVarValue"
TemplateSurveyVarValue:
type: object
properties:
name:
type: string
value:
type: string
TemplateVault: TemplateVault:
type: object type: object
properties: properties:
id:
type: integer
template_id:
type: integer
project_id:
type: integer
name: name:
type: string type: string
example: default example: default
@ -2078,7 +2132,7 @@ paths:
- project - project
summary: create template summary: create template
parameters: parameters:
- name: templateyes - name: template
in: body in: body
required: true required: true
schema: schema:
@ -2087,7 +2141,7 @@ paths:
201: 201:
description: template created description: template created
schema: schema:
$ref: "#/definitions/TemplateRequest" $ref: "#/definitions/Template"
/project/{project_id}/templates/{template_id}: /project/{project_id}/templates/{template_id}:
parameters: parameters:
- $ref: "#/parameters/project_id" - $ref: "#/parameters/project_id"