GET /api/job_templates
List job templates

GET /api/locations/:location_id/job_templates
List job templates per location

GET /api/organizations/:organization_id/job_templates
List job templates per organization

參數

參數名字 描述
location_id
選填

Scope by locations

Validations:

  • Must be Integer

organization_id
選填

Scope by organizations

Validations:

  • Must be Integer

search
選填

篩選結果

Validations:

  • Must be String

order
選填

排序結果

Validations:

  • Must be String

page
選填

編頁結果

Validations:

  • Must be String

per_page
選填

每個請求的項目數量

Validations:

  • Must be String


POST /api/job_templates/import
Import a job template from ERB

參數

參數名字 描述
template
必填

Template ERB

Validations:

  • Must be String

overwrite
選填

Overwrite template if it already exists

Validations:

  • Must be 'true' or 'false' or '1' or '0'


GET /api/job_templates/:id/export
Export a job template to ERB

參數

參數名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


GET /api/job_templates/:id
Show job template details

參數

參數名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/job_templates
Create a job template

參數

參數名字 描述
job_template
必填

Validations:

  • Must be a Hash

job_template[name]
必填

Template name

Validations:

  • Must be String

job_template[job_category]
必填

Job category

Validations:

  • Must be String

job_template[description_format]
選填 , 允許空值

This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}.

Validations:

  • Must be String

job_template[template]
必填

Validations:

  • Must be String

job_template[provider_type]
必填

Provider type

Validations:

  • Must be one of: SSH.

job_template[snippet]
選填 , 允許空值

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[audit_comment]
選填 , 允許空值

Validations:

  • Must be String

job_template[locked]
選填 , 允許空值

Whether or not the template is locked for editing

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[ssh]
選填 , 允許空值

SSH provider specific options

Validations:

  • Must be a Hash

job_template[ssh][effective_user]
選填 , 允許空值

Effective user options

Validations:

  • Must be a Hash

job_template[ssh][effective_user][value]
選填 , 允許空值

What user should be used to run the script (using sudo-like mechanisms)

Validations:

  • Must be String

job_template[ssh][effective_user][overridable]
選填 , 允許空值

Whether it should be allowed to override the effective user from the invocation form.

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[ssh][effective_user][current_user]
選填 , 允許空值

Whether the current user login should be used as the effective user

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[location_ids]
選填 , 允許空值

REPLACE locations with given ids

Validations:

  • Must be an array of any type

job_template[organization_ids]
選填 , 允許空值

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/job_templates/:id
Update a job template

參數

參數名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

job_template
必填

Validations:

  • Must be a Hash

job_template[name]
選填

Template name

Validations:

  • Must be String

job_template[job_category]
選填

Job category

Validations:

  • Must be String

job_template[description_format]
選填 , 允許空值

This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}.

Validations:

  • Must be String

job_template[template]
選填

Validations:

  • Must be String

job_template[provider_type]
選填

Provider type

Validations:

  • Must be one of: SSH.

job_template[snippet]
選填 , 允許空值

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[audit_comment]
選填 , 允許空值

Validations:

  • Must be String

job_template[locked]
選填 , 允許空值

Whether or not the template is locked for editing

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[ssh]
選填 , 允許空值

SSH provider specific options

Validations:

  • Must be a Hash

job_template[ssh][effective_user]
選填 , 允許空值

Effective user options

Validations:

  • Must be a Hash

job_template[ssh][effective_user][value]
選填 , 允許空值

What user should be used to run the script (using sudo-like mechanisms)

Validations:

  • Must be String

job_template[ssh][effective_user][overridable]
選填 , 允許空值

Whether it should be allowed to override the effective user from the invocation form.

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[ssh][effective_user][current_user]
選填 , 允許空值

Whether the current user login should be used as the effective user

Validations:

  • Must be 'true' or 'false' or '1' or '0'

job_template[location_ids]
選填 , 允許空值

REPLACE locations with given ids

Validations:

  • Must be an array of any type

job_template[organization_ids]
選填 , 允許空值

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


GET /api/job_templates/revision

參數

參數名字 描述
version
選填

Template version

Validations:

  • Must be String


DELETE /api/job_templates/:id
Delete a job template

參數

參數名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/job_templates/:id/clone
Clone a provision template

參數

參數名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

job_template
必填

Validations:

  • Must be a Hash

job_template[name]
必填

Template name

Validations:

  • Must be String