hostinterface.massadd
Leírás
objektum hostinterface.massadd(objektumparaméterek)
Ez a módszer lehetővé teszi, hogy egyidejűleg több gazdagép interfészt adjunk hozzá otthont ad.
Ez a módszer csak az Admin és a Kiemelt rendszergazda számára érhető el felhasználói típusok. A metódus meghívására vonatkozó engedélyek felhasználói szerepkörben visszavonhatók beállítások. Lásd: User roles további információért.
Parameters
(object) Parameters containing the host interfaces to be created on
the given hosts.
The method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| hosts (required) |
object/array | Hosts to be updated. The hosts must have the hostid property defined. |
| interfaces (required) |
object/array | Host interfaces to create on the given hosts. |
Visszatérési értékek
(object) Egy objektumot ad vissza, amely tartalmazza a létrehozott gazdagép azonosítóit
interfészeket az interfaceids tulajdonság alatt.
Példák
Creating interfaces
Create an interface on two hosts.
Request:
{
"jsonrpc": "2.0",
"method": "hostinterface.massadd",
"params": {
"hosts": [
{
"hostid": "30050"
},
{
"hostid": "30052"
}
],
"interfaces": {
"dns": "",
"ip": "127.0.0.1",
"main": 0,
"port": "10050",
"type": 1,
"useip": 1
}
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"interfaceids": [
"30069",
"30070"
]
},
"id": 1
}
Lásd még
Forrás
CHostInterface::massAdd() in ui/include/classes/api/services/CHostInterface.php.