[comment]: # translation:outdated

[comment]: # ({49f9e765-49f9e765})
# triggerprototype.create

[comment]: # ({/49f9e765-49f9e765})

[comment]: # ({d56d61d9-c66bc66b})
### 説明

`object triggerprototype.create(object/array triggerPrototypes)`

このメソッドを使用すると、新しいトリガー プロトタイプを作成できます。

::: noteclassic
このメソッドは*Admin*および*Super admin*ユーザータイプでのみ使用できます。 メソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。 詳細については[ユーザーの役割](/manual/web_interface/frontend_sections/administration/user_roles)を参照してください。
:::

[comment]: # ({/d56d61d9-c66bc66b})

[comment]: # ({2a1e778b-e93145a6})
### パラメータ

`(object/array)` 作成されるトリガープロトタイプ「

このメソッドは[標準のトリガー プロトタイプ プロパティ](object#trigger_prototype) に加えて、次のパラメーターを受け入れます。

|パラメータ|[タイプ](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|dependencies|array|トリガーおよびトリガー プロトタイプが依存するトリガー プロトタイプ。<br><br>トリガーには `triggerid` プロパティが定義されている必要があります。|
|tags|array|トリガー プロトタイプ [タグ](/manual/api/reference/triggerprototype/object#trigger_prototype_tag)|

::: noteimportant
トリガー式は展開された状態で指定する必要があり、少なくとも 1 つのアイテム プロトタイプを含める必要があります。
:::

[comment]: # ({/2a1e778b-e93145a6})

[comment]: # ({8d1f4c4d-8d1f4c4d})
### 戻り値

`(object)` `triggerids` プロパティの下に作成されたトリガー プロトタイプの ID を含むオブジェクトを返します。 返される ID の順序は、渡されたトリガー プロトタイプの順序と一致します。

[comment]: # ({/8d1f4c4d-8d1f4c4d})

[comment]: # ({b41637d2-b41637d2})
### 例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({682e61d1-87a61295})
#### トリガー プロトタイプの作成

ファイル システムの空きディスク容量が 20% 未満になったことを検出するトリガー プロトタイプを作成します。

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "triggerprototype.create",
    "params": {
        "description": "Free disk space is less than 20% on volume {#FSNAME}",
        "expression": "last(/Zabbix server/vfs.fs.size[{#FSNAME},pfree])<20",
        "tags": [
            {
                "tag": "volume",
                "value": "{#FSNAME}"
            },
            {
                "tag": "type",
                "value": "{#FSTYPE}"
            }
        ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "triggerids": [
            "17372"
        ]
    },
    "id": 1
}
```

[comment]: # ({/682e61d1-87a61295})

[comment]: # ({43cf23db-43cf23db})
### ソース

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

[comment]: # ({/43cf23db-43cf23db})
