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
Import a job template from ERB

參數

參數名字 描述
location_id
選填

位置範圍

Validations:

  • Must be a Integer

organization_id
選填

組織範圍

Validations:

  • Must be a Integer

template
必填

Template ERB

Validations:

  • Must be a String

overwrite
選填

Overwrite template if it already exists

Validations:

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


GET /api/job_templates/:id/export
Export a job template to 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]
選填 , 允許空值

哪位使用者該用來執行此 script(使用類似 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]
選填 , 允許空值

哪位使用者該用來執行此 script(使用類似 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