hostinterface.update
Description
object hostinterface.update(object/array hostInterfaces)
This method allows to update existing host interfaces.
This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.
Parameters
(object/array) Host interface properties to
be updated.
The interfaceid property must be defined for each host interface, all
other properties are optional. Only the given properties will be
updated, all others will remain unchanged.
Return values
(object) Returns an object containing the IDs of the updated host
interfaces under the interfaceids property.
Examples
Changing a host interface port
Change the port of a host interface.
{
"jsonrpc": "2.0",
"method": "hostinterface.update",
"params": {
"interfaceid": "30048",
"port": "10055"
},
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"interfaceids": [
"30048"
]
},
"id": 1
}
Changing multiple host interface ports
Change the port of multiple host interfaces.
{
"jsonrpc": "2.0",
"method": "hostinterface.update",
"params": [
{
"interfaceid": "30049",
"port": "10055"
},
{
"interfaceid": "30050",
"port": "10055"
},
{
"interfaceid": "30051",
"port": "10055"
}
],
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"interfaceids": [
"30049",
"30050",
"30051"
]
},
"id": 1
}
Source
CHostInterface::update() in ui/include/classes/api/services/CHostInterface.php.