龙虎赌博

This is the documentation page for an unsupported version of 龙虎赌博.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

template.create

説明

object template.create(object/array templates)

このメソッドで、新しいテンプレートを作成できます。

このメソッドはAdminおよびSuper adminユーザータイプでのみ使用できます。 メソッドを呼び出す権限は、ユーザーロール设定で取り消すことができます。 詳細についてはユーザーの役割を参照してください。

パラメータ

(object/array) 作成するテンプレート

このメソッドは標準のテンプレート プロパティに加えて、次のパラメーターを受け入れます。

パラメータ タイプ 説明
groups
(必须)
object/array テンプレートを追加するホストグループ

ホスト グループにはgroupid プロパティが定义されている必要があります。
tags object/array テンプレート タグ
templates object/array テンプレート をテンプレートにリンクします。

テンプレートには templateid プロパティが定义されている必要があります。
macros object/array ユーザー マクロ をテンプレート用に作成します。

戻り値

(object) templateids プロパティの下で作成されたテンプレートの ID を含むオブジェクトを返します。 返される ID の順序は、渡されたテンプレートの順序と一致します。

テンプレートの作成

タグ付きのテンプレートを作成し、2 つのテンプレートをこのテンプレートにリンクします。

Request:

{
           "jsonrpc": "2.0",
           "method": "template.create",
           "params": {
               "host": "Linux template",
               "groups": {
                   "groupid": 1
               },
               "templates": [
                   {
                       "templateid": "11115"
                   },
                   {
                       "templateid": "11116"
                   }
               ],
               "tags": [
                   {
                       "tag": "Host name",
                       "value": "{HOST.NAME}"
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "templateids": [
                   "11117"
               ]
           },
           "id": 1
       }

ソース

CTemplate::create() in ui/include/classes/api/services/CTemplate.php.