Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Retrieves a list of all node id's/names (limited to 25 use use the limit param to requst more), returns them as an an array with the key nodes.  Accepts all modifiers.  If property modifier is set, the results will be an array of objects (hashes) with the properties requested found inside the object (hash).  This request will always return the uuid, along with any other info listed in properties.

...

Code Block
# no properties or query requested, limited to 25 nodes
# GET /omk/opCharts/v2/nodes/
{
    "nodes": [
        {
            "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
}

#Filtered nodes by group and current status
# GET/omk/opCharts/{{version}}v2/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: ["name","configuration.active","configuration.customer", "configuration.group"]
# GET /omk/opCharts/v2/nodes/?properties=["name","configuration.active","configuration.customer", "configuration.group"]
{
    "nodes": [
        {
            "configuration": {
                "active": 1,
                "customer": "Opmantek",
                "group": "NMIS9"
            },
            "name": "master-nine-local",
            "uuid": "44406ddf-8424-4f01-8314-9606911e5a05"
        },

# query and properties: query=["node_name","asgard"]&properties=["config.group"]
# GET /omk/opCharts/v1v2/nodes?filter={"configuration.group" : "DataCentre", "catchall.data.nodestatus": "degraded" }&properties=["name","configuration.active","configuration.customer", "configuration.group"]
{
    "nodes": [
        {
            "configuration": {
                "active": 1,
                "customer": "",
                "group": "DataCentre"
            },
            "name": "eris",
            "uuid": "a18b705c-db8e-4aa6-b5d4-ff637d2adbbe"
        },

Show (Get)

GET /nodes/#node_id#uuid

Retrieves the specified node object (hash) and returns all known info about it (so it may be large), accepts properties request modifier.  It is recommended to use the properties query modifier to narrow down the data returned to only the data required.

...

Code Block
# no properties specified, all data is returned, this will have some common data structures and some specific to the node / model
# GET /omk/opCharts/v1v2/nodes/UUID1
{
	"node_iduuid": "$UUID1",
	"name": "node1"
	"configconfiguration": { ... data from this nodes Nodes.nmisconfiguration section ... },
	"infosummary": { ... data from this nodes "name-node.json" file summary ... },
	"statuscluster_id" : { ... datauuid of fromwhich thisopHA nodes nmis-nodesum.json section ... },server the node belongs to}
	...
}
# properties=["node_id"configuration.services", "uuid", "config.groupcatchall.data.last_poll",  "infocatchall.systemdata.sysDescrnodestatus"]
# GET /omk/opCharts/v1v2/nodes/UUID1?properties=["node_id"configuration.services", "uuid", "config.groupcatchall.data.last_poll",  "infocatchall.systemdata.sysDescrnodestatus"]
{
	"node_id": "$UUID1",
	"config": {
		group: "group1"
	},
	info: {
		system: {
			sysDescr: "something really long and full of great info"
		}
	}    "catchall": {
        "data": {
            "last_poll": 1572835884.17908,
            "nodestatus": "degraded"
        }
    },
    "configuration": {
        "services": [
            "http_server",
            "nmis cgi",
            "port80"
        ]
    },
    "uuid": "44406ddf-8424-4f01-8314-9606911e5a05"
}