GET /api/job_templates
列出任务模板

GET /api/locations/:location_id/job_templates
列出每个位置的任务模板

GET /api/organizations/:organization_id/job_templates
列出每个机构的任务模板

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

search
选填

过滤结果

Validations:

  • Must be a String

order
选填

结果排序

Validations:

  • Must be a String

page
选填

编页结果

Validations:

  • Must be a String

per_page
选填

每个请求中的条目数

Validations:

  • Must be a String


POST /api/job_templates/import
从 ERB 导入任务模版

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

template
必填

模版 ERB

Validations:

  • Must be a String

overwrite
选填

如果已存在则覆盖模版

Validations:

  • Must be one of: true, false, 1, 0


GET /api/job_templates/:id/export
导出任务模版到 ERB

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

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
显示任务模板详情

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

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
创建任务模板

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

job_template
必填

Validations:

  • Must be a Hash

job_template[name]
必填

模板名称

Validations:

  • Must be a String

job_template[job_category]
必填

任务类别

Validations:

  • Must be a String

job_template[description_format]
选填 , 允许空值

这个模板是用来生成描述。可和使用句法 %{package} 输入参数值。还可以和使用 %{job_category} 和 %{template_name} 在其中包含任务类别及模板名称。

Validations:

  • Must be a String

job_template[template]
必填

Validations:

  • Must be a String

job_template[provider_type]
必填

提供者类型

Validations:

  • Must be one of: SSH.

job_template[snippet]
选填 , 允许空值

Validations:

  • Must be one of: true, false, 1, 0

job_template[audit_comment]
选填 , 允许空值

Validations:

  • Must be a String

job_template[locked]
选填 , 允许空值

是否已锁定该模板进行编辑

Validations:

  • Must be one of: true, false, 1, 0

job_template[ssh]
选填 , 允许空值

SSH 提供者的具体选项

Validations:

  • Must be a Hash

job_template[ssh][effective_user]
选填 , 允许空值

有效用户选项

Validations:

  • Must be a Hash

job_template[ssh][effective_user][value]
选填 , 允许空值

应由什么用户运行此脚本(使用类似 sudo 的机制)。

Validations:

  • Must be a String

job_template[ssh][effective_user][overridable]
选填 , 允许空值

是否应允许使用调用形式替代有效用户。

Validations:

  • Must be one of: true, false, 1, 0

job_template[ssh][effective_user][current_user]
选填 , 允许空值

是否应使用当前登录用户作为有效用户

Validations:

  • Must be one of: true, false, 1, 0

job_template[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

job_template[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


PUT /api/job_templates/:id
更新任务模板

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

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]
选填

模板名称

Validations:

  • Must be a String

job_template[job_category]
选填

任务类别

Validations:

  • Must be a String

job_template[description_format]
选填 , 允许空值

这个模板是用来生成描述。可和使用句法 %{package} 输入参数值。还可以和使用 %{job_category} 和 %{template_name} 在其中包含任务类别及模板名称。

Validations:

  • Must be a String

job_template[template]
选填

Validations:

  • Must be a String

job_template[provider_type]
选填

提供者类型

Validations:

  • Must be one of: SSH.

job_template[snippet]
选填 , 允许空值

Validations:

  • Must be one of: true, false, 1, 0

job_template[audit_comment]
选填 , 允许空值

Validations:

  • Must be a String

job_template[locked]
选填 , 允许空值

是否已锁定该模板进行编辑

Validations:

  • Must be one of: true, false, 1, 0

job_template[ssh]
选填 , 允许空值

SSH 提供者的具体选项

Validations:

  • Must be a Hash

job_template[ssh][effective_user]
选填 , 允许空值

有效用户选项

Validations:

  • Must be a Hash

job_template[ssh][effective_user][value]
选填 , 允许空值

应由什么用户运行此脚本(使用类似 sudo 的机制)。

Validations:

  • Must be a String

job_template[ssh][effective_user][overridable]
选填 , 允许空值

是否应允许使用调用形式替代有效用户。

Validations:

  • Must be one of: true, false, 1, 0

job_template[ssh][effective_user][current_user]
选填 , 允许空值

是否应使用当前登录用户作为有效用户

Validations:

  • Must be one of: true, false, 1, 0

job_template[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

job_template[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


GET /api/job_templates/revision

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

version
选填

模板版本

Validations:

  • Must be a String


DELETE /api/job_templates/:id
删除任务模板

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

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
克隆预配模板

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

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]
必填

模板名称

Validations:

  • Must be a String