[comment]: # ({0ae84d72-ecea3b29})
# discoveryruleprototype.create

[comment]: # ({/0ae84d72-ecea3b29})

[comment]: # ({36f3c2f8-00b2cce0})
### Apraksts

`object discoveryruleprototype.create(object/array lldRules)`

Šī metode ļauj izveidot jaunus LLD noteikumu prototipus.

::: noteclassic
Šī metode ir pieejama tikai *Admin* un *Super admin*
lietotāju tipiem. Atļaujas izsaukt šo metodi var tikt atsauktas lietotāja lomas
iestatījumos. Plašāku informāciju skatiet sadaļā [Lietotāju
lomas](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/36f3c2f8-00b2cce0})

[comment]: # ({ed2edd1b-8c04f31d})
### Parametri

`(object/array)` Izveidojamie LLD noteikumu prototipi.

Papildus [standarta LLD noteikumu prototipu īpašībām](object#lld-rule-prototype)
metode pieņem šādus parametrus.

|Parametrs|[Tips](/manual/api/reference_commentary#data-types)|Apraksts|
|--|--|------|
|filter|object|LLD noteikuma prototipa [filtrs](/manual/api/reference/discoveryruleprototype/object#lld-rule-filter) LLD noteikumam.|
|preprocessing|object/array|LLD noteikuma prototipa [priekšapstrādes](/manual/api/reference/discoveryruleprototype/object#lld-rule-preprocessing) opcijas.|
|lld\_macro\_paths|object/array|LLD noteikuma prototipa [lld\_macro\_path](/manual/api/reference/discoveryruleprototype/object#lld-macro-path) opcijas.|
|overrides|object/array|LLD noteikuma prototipa [aizstāšanas](/manual/api/reference/discoveryruleprototype/object#lld-rule-overrides) opcijas.|

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

[comment]: # ({42d06e60-e0c3122b})
### Atgrieztās vērtības

`(object)` Atgriež objektu, kas satur izveidoto LLD noteikumu prototipu ID
īpašībā `itemids`. Atgriezto ID secība atbilst
nodoto LLD noteikumu prototipu secībai.

[comment]: # ({/42d06e60-e0c3122b})

[comment]: # ({b41637d2-51839ea7})
### Piemēri

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

[comment]: # ({2f248d04-26450b92})
#### LLD noteikuma prototipa izveide

Izveidojiet LLD noteikuma prototipu (Tips: Nested), lai atklātu tablespace datubāzes instancē.

[Pieprasījums](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "discoveryruleprototype.create",
    "params": {
        "name": "Discover tablespaces for {#DB}",
        "key_": "db.tablespace.discovery[{#DB}]",
        "hostid": "10084",
        "ruleid": "47251",
        "type": 23
    },
    "id": 1
}
```

Atbilde:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "47252"
        ]
    },
    "id": 1
}
```

[comment]: # ({/2f248d04-26450b92})

[comment]: # ({72853784-4dc2b1ef})
### Skatiet arī

-   [LLD noteikuma prototipa filtrs](object#lld-rule-prototype-filter)
-   [LLD makro ceļi](object#lld-macro-path)
-   [LLD noteikuma prototipa priekšapstrāde](object#lld-rule-prototype-preprocessing)

[comment]: # ({/72853784-4dc2b1ef})

[comment]: # ({91cce031-612c1fea})
### Avots

CDiscoveryRulePrototype::create() failā
*ui/include/classes/api/services/CDiscoveryRulePrototype.php*.

[comment]: # ({/91cce031-612c1fea})
