Table of Contents |
---|
...
We can also manage nodes using the API.
Operation | Method | URL | Response | Example | ||
---|---|---|---|---|---|---|
Get Nodes | GET | http://host/en/omk/admin/api/v2/nodes.json | http://uburnto.opmantek.net/en/omk/admin/api/v2/nodes.json?requestData=undefined&page=1&per_page=25&sort_by=name&order=asc | |||
Get Node | GET | http://host/en/omk/admin/api/v2/nodes/{node_uuid} | http://uburnto.opmantek.net/en/omk/admin/api/v2/nodes/86a82b4c-6ef6-4691-8c8c-1fc8da334d6f.json | |||
Create Node | POST | http://host/en/omk/admin/api/v2/nodes | The node in json from the recently node created, including the UUID | http://uburnto.opmantek.net/en/omk/admin/api/v2/nodes
| ||
Update Node | PUT | http://host/en/omk/admin/api/v2/nodes/{node_uuid} | http://uburnto.opmantek.net/en/omk/admin/api/v2/nodes/b56ba595-69e7-4702-9fe5-49512e1340b0
| |||
Delete Node | DELETE | http://host/en/omk/admin/api/v2/nodes/{node_uuid} | http://uburnto.opmantek.net/en/omk/admin/api/v2/nodes/b56ba595-69e7-4702-9fe5-49512e1340b0 |
...
Operation | Method | URL | Example | ||
---|---|---|---|---|---|
Authenticate | POST | http://host/en/omk/admin/login | http://uburnto.opmantek.net/en/omk/opHA/login
|
We should receive a 200 response and a cookie, that we can reuse for next API calls.
API For remote Nodes
If we want to create or update a node in a remove cluster, we should indicate the remote cluster id in configuration.pollers: Cluster_id.
E.x.
Create Remote | POST | http://host/en/omk/admin/api/v2/nodes | http://uburnto.opmantek.net/en/omk/admin/api/v2/nodes
|
It will return:
Code Block |
---|
{
"activated": {
"NMIS": 1,
"opConfig": "0",
"opEvents": "1"
},
"cluster_id": "a515c63a-0d11-4bcb-a402-39a4600aebb9",
"configuration": {
"active": 1,
"aliases": [],
"authkey": "",
"authpassword": "",
"authprotocol": null,
"businessService": null,
"collect": 1,
"community": "",
"context": "",
"customer": null,
"group": "NMIS9",
"host": "asgard.opmantek.net",
"host_backup": "",
"location": null,
"max_msg_size": 65535,
"max_repetitions": 0,
"netType": "default",
"nettype": null,
"node_context_name": "",
"node_context_url": "",
"notes": "",
"ping": 1,
"pollers": "a515c63a-0d11-4bcb-a402-39a4600aebb9",
"polling_policy": "default",
"port": "161",
"privkey": "",
"privpassword": "",
"privprotocol": null,
"remote_connection_name": "",
"remote_connection_url": "",
"roleType": "default",
"roletype": null,
"serviceStatus": null,
"threshold": 1,
"username": "",
"wmipassword": "",
"wmiusername": ""
},
"friendly_addresses": "",
"friendly_aliases": "",
"name": "test",
"uuid": "6ce5fd5c-d703-4d03-b36c-b8e01439a9f2"
} |
Remote Nodes
If any operation has a remote cluster id, the API will try to edit in the remote server. If this operation is not possible, it will fail.
...