Áú»¢¶Ä²©

This is the documentation page for an unsupported version of Áú»¢¶Ä²©.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

usermacro.update

?????

object usermacro.update(object/array hostMacros)

???? ?? ?????? ????? ?????? ????? ???? ??????.

???? ?? ????? ?? ?-Admin ?-Super Admin ???? ???????. ???? ???? ?????? ????? ????? ?????? ????? ??????. ??? ????? ??????? ????? ????.

???????

(object/array) ??????? ????? ???? ????? ??????????.

?? ?????? ?? ??????? hostmacroid ???? ?? ????? ????, ??? ????? ????? ?? ???????????. ?? ?????? ????? ???? ?????, ?? ???? ?????? ??? ?????.

???? ?????

(object) ?????? ??????? ????? ?? ?????? ?? ????? ??????? ?????? ????? ??? ??????? hostmacroids.

???????

????? ???? ?? ????? ????

??? ?? ???? ?? ????? ???? ?"??????".

?????????:

{
            "jsonrpc": "2.0",
            "method": "usermacro.update",
            "params": {
                "hostmacroid": "1",
                "value": "??????"
            },
            "auth": "038e1d7b1735c6a5436ee9eae095879e",
            "????": 1
       }

????????:

{
            "jsonrpc": "2.0",
            "?????": {
                "hostmacroids": [
                    "1"
                ]
            },
            "????": 1
       }

Change macro value that was created by discovery rule

Convert discovery rule created "automatic" macro to "manual" and change its value to "new-value".

Request:

{
           "jsonrpc": "2.0",
           "method": "usermacro.update",
           "params": {
               "hostmacroid": "1",
               "value": "new-value",
               "automatic": "0"
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "hostmacroids": [
                   "1"
               ]
           },
           "id": 1
       }

????

CUserMacro::update()? ???? ui/include/classes/api/services/CUserMacro.php.