January 2019
Intermediate to advanced
798 pages
20h 33m
English
Hosts may be enabled or disabled by setting a single value. Let's disable our IPMI host and re-enable it a moment later. To do this, we'll need the host ID. Usually, when using the API, we'd query the API itself for the ID. In this case, let's keep things simple and look up the ID in the host properties—as with the item before, open the host properties and copy the value for the hostid parameter from the URL. Also, don't forget to replace your correct authorization ID. With that number available, let's set our JSON variable:
$ json='{"jsonrpc":"2.0","method":"host.update","params":{"hostid":"10132","status":1},"auth":"df83119ab78bbeb2065049412309f9b4","id":1}'
Read now
Unlock full access