...
Code Block |
---|
http[s]://server/omk/opCharts/v1v2/ |
Request Modifiers (query parameters)
...
Not all requests will use all request modifiers. Arrays / KVP's are url encoded JSON. E.G. javascript: urlencode(JSON.stringify(array)); perl: URI::Escape::uri_escape(encode_json($array));
Query Parameter | Possible Values |
---|---|
properties | Array of property names. If provided only the properties specified will be returned (instead of the whole document |
. eg: properties=[" |
configuration. |
customer", " |
configuration. |
group"] |
filter | Array of key=value pairs, but coded in an array. Applied to the list of results in the order they are given. If an application key is provided that will be applied first. eg: |
filter=[" |
configuration.group","NMIS8"," |
catchall.data.nodestatus" |
: "reachable"] (which is " |
configuration.group"="NMIS8" AND " |
catchall.data.nodestatus"="reachable" ) |
Examples of how to use the request modifiers can be found in the response blocks below. In general, the queries will look something like this:
Code Block |
---|
GET HTTP://server/omk/opCharts/v1v2/nodes?query=["config.group","NMIS8"]limit=25&count=1&filter={"configuration.group" : "DataCentre", "catchall.data.nodestatus": "reachable" }&page=1&properties=["status.nodestatus"configuration.customer", "configuration.group"] |
This will query all nodes that are in the group NMIS8 and return their nodestatus':
Code Block |
---|
{ "nodes": [ { "node_id "configuration": { "customer": "C1135FBE-9AE1-11E4-A17D-1794FCA8A343Opmantek", "status": { "group": "DataCentre" }, "nodestatusuuid": "reachable"3f49619e-b8ae-4e96-b56a-a7331baf71d3" } } ], ... ] "total": 1 } |
Nodes (Config/Status/Info)
opCore provides access to all known nodes in the system. Nodes can be listed or viewed individually.
node_id
...
uuid
Is assigned by NMIS, it will be in this form:
"node_iduuid": "C1135FBE-9AE1-11E4-A17D-1794FCA8A343"
...
Code Block |
---|
# no properties or query requested, limited to 25 nodes # GET /omk/opCharts/v1v2/nodes/ { "nodes": [ "$UUID1", # node1 "$UUID2", # node2, ... "$UUIDn" ] # query only: query=["config.group","group_1","summary.roleType","core"] # GET /omk/opCharts/v1/nodes/?query=["config.group","group_1","summary.roleType","core"] [ "$UUID2", "$UUD142" ] { "uuid": "44406ddf-8424-4f01-8314-9606911e5a05" }, { "uuid": "7949befd-c70e-4921-ad52-ced66489783b" }, { "uuid": "882d09cf-e0da-4153-a652-4ad1ea506d61" }, { "uuid": "d89b4ade-8b6f-4df8-a7f9-e37132c64c85" }, { "uuid": "fe09452b-5646-4638-acf3-aa2e4a54d277" }, .... # Pagination page size set to 5 start at page 2 # GET /omk/opCharts/v2/nodes?limit=5&count=1&page=2 { "@nextLink": "/omk/opCharts/v2/nodes?limit=5&count=1&page=2&page=3", "nodes": [ { "uuid": "4c52b0f9-2144-49c9-8d4d-11ab7c9dd814" }, { "uuid": "9c8ed1a9-b88a-4a53-9cd3-bf26c14d8322" }, { "uuid": "bdf1706a-7694-466c-9773-70327a117af4" }, { "uuid": "6c1ba844-b7c1-4854-bef1-88b0b77c6385" }, { "uuid": "3f0af422-6100-4c8a-a7f4-4634c116d499" } ], "total": 536 } # GET/omk/opCharts/{{version}}/nodes?filter={"configuration.group" : "DataCentre", "catchall.data.nodestatus": "degraded" } { "nodes": [ { "uuid": "a18b705c-db8e-4aa6-b5d4-ff637d2adbbe" }, { "uuid": "1ef5e314-76ec-4f3a-84ab-f6d6f6460f86" }, { "uuid": "058ef0de-e6b8-4475-8c0b-c13712242919" }, { "uuid": "a97ae784-fdb1-4fcf-a516-d844dc744846" }, { "uuid": "1465e2fc-d781-4c70-a9e6-52fc714b4950" }, { "uuid": "987cc9cb-4c42-45db-b267-b6511003308a" }, { "uuid": "3224427c-f06d-4915-ab08-902ce620aef8" }, { "uuid": "3d994eb5-dcba-46de-bb90-914b5dde822f" } ] } # properties only: properties=["name","server_name"] # GET /omk/opCharts/v1/nodes/?properties=["name","server_name"] [ { "node_id": "$UUID1", "name": "node_name_1", "server_name": "server_name" }, ... ] # query and properties: query=["node_name","asgard"]&properties=["config.group"] # GET /omk/opCharts/v1/nodes/?query=["node_name","asgard"]&properties=["config.group"] [ { "node_id": "C1135780-9AE1-11E4-A17D-1794FCA8A343", "config": { "group": "Branches" } } ] |
...