hostprototype.update

    This method allows to update existing host prototypes.

    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 for more information.

    Parameters

    (object/array) Host prototype properties to be updated.

    The hostid property must be defined for each host prototype, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

    (object) Returns an object containing the IDs of the updated host prototypes under the hostids property.

    Examples

    Disabling a host prototype

    Disable a host prototype, that is, set its status to “1”.

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "hostids": [
    5. ]
    6. },
    7. "id": 1
    8. }

    Updating host prototype tags

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "hostids": [
    5. "10092"
    6. ]
    7. "id": 1
    8. }

    Updating host prototype custom interfaces

    Replace inherited interfaces with host prototype custom interfaces.

    Request:

    1. "jsonrpc": "2.0",
    2. "result": {
    3. "hostids": [
    4. "10092"
    5. ]
    6. },
    7. "id": 1

    Source

    CHostPrototype::update() in ui/include/classes/api/services/CHostPrototype.php.