values of custom fields through APIs
Posted: Mon May 12, 2014 6:23 pm
Hi,
I created a custom field in a host definition that I wanted to be able to access through the APIs. However, using the object query for the host it merely tells me that the custom field exists, not the value of it. Am I not doing the query correctly? Or is this something that can be added?
Here is (part of) the host definition:
if I use the query:
the only reference to the custom field is at the end of this. As you can see it tells me DOMAIN exists, but not the value of it.
I removed a lot of the output because it was so long and you have to scroll to the end to see the custom variables, but if you need to see all of it, let me know.
thanks!
I created a custom field in a host definition that I wanted to be able to access through the APIs. However, using the object query for the host it merely tells me that the custom field exists, not the value of it. Am I not doing the query correctly? Or is this something that can be added?
Here is (part of) the host definition:
Code: Select all
define host {
use generic-host
host_name pleiades1
...
_domain pleiades
}
Code: Select all
cgi-bin/objectjson.cgi?query=host&hostname=pleiades1Code: Select all
{
"format_version": 0,
"result": {
"query_time": 1399936372000,
"cgi": "objectjson.cgi",
"query": "host",
"query_status": "beta",
"program_start": 1399935899000,
"last_data_update": 1399935899000,
"type_code": 0,
"type_text": "Success",
"message": ""
},
"data": {
"host": {
"name": "pleiades1",
"name": "pleiades1",
...
"custom_variables": [
"DOMAIN"
]
}
}
}thanks!