22 Sep 2023 06:20 PM - edited 22 Sep 2023 06:21 PM
So, I can turn OneAgent on or off on a particular host with a POST call to /api/v2/settings/objects as follows:
[
{
"schemaId": "builtin:host.monitoring",
"value": {
"enabled": true,
"fullStack": false,
"autoInjection": true
},
"schemaVersion": "1.2.0",
"scope": "HOST-29200A0CBEF971B4"
}
]
But, if I try a GET to confirm my change went through, via:
/api/v2/settings/objects?schemaIds=builtin:host.monitoring&scope=HOST-29200A0CBEF971B4
I get an array with 24 items:
{
"items": [
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQMDgyNzAwQTIxMzNCRTNGQwAkOTUxYjNiYjUtMmM3ZS0zZDYwLTk5NjEtM2IxY2ExOGJhN2Njvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQMDg5QjE1OTVFQzkwOEQzNAAkZDhhMTEyOWUtYmEzZC0zZGVkLWFjMmYtYTlhMzc5NDA1NGU1vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQMTZCRjBDNzIwRUZDMjQ0MQAkNGNiZTc4NDAtMDBmZi0zMDM2LTk2MjctNTRhMjQ0ODRkZWM1vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQMjkyMDBBMENCRUY5NzFCNAAkYzEwMTM3YzEtNDgxNS0zZTE1LTgwZDEtNDIyYzQyNTE4NTllvu9U3hXa3q0",
"value": {
"enabled": true,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQMzMwNkM1MDQ2RkEwOTVERAAkMmFmYmE2NGYtNDY0Ni0zODdjLWJkOTktMmZiMjRlNGFhOWVhvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQNDEwNUVCQzUyMERCNkU3OAAkZmY0YjA4ZmEtYTgzZS0zNDIyLThkNmYtY2NkYzJmYjdlMGE4vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQNEMzQUE4RTJBMkFDMDg4MAAkOWY0YWJjN2MtNjNmMy0zYzFmLWI5OWItM2UxYzIxOWVmZDhivu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQNUUyNDc5Q0E4OTg2NUE1NgAkY2UwY2VjMjYtNGJiNi0zNDg0LTkwYjYtZjc4OWYyYmY2MjU5vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQNjFGQUE5Q0NCNjk4QkY5QgAkY2RjODg3NzMtNDFmYi0zYjZmLWFjYjUtYzJiMDVjODk1NjUwvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQNzREQzU2Qzc5QjhFNzA2RAAkNWViNDg5YmItZDM0OC0zY2JlLWFkOGEtMzU1Y2UxZDI0ZjE0vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQN0I3MkMyQjVGRENBNzQ1MAAkZGNlY2E5NTItNGJjYi0zYTNmLThmMWUtYzZmYjM3N2JkNmYzvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQN0QxOTZFMTg3NjQ2MkFBNQAkMDU1ODZhMWYtYzIwZi0zZTNmLWFlZTctMTllMTVmNGQ3OGE5vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQOERFRjg2MjgxMDBGNDlERgAkNmE2MWNkNDItYTdjYS0zMTQwLWEzM2UtZjg0MjI2NmY1MjZlvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQOTQ2QzQ5Qzc0ODcwM0M1MgAkMjJlNGQzNzEtOTY4Ni0zMGQ5LTg2MWYtZGZlZjVmZWYyNWJhvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQQTAzRUUzQjJGMjQ4QjRCRQAkNzIyNDFlNGEtMjdkNS0zMzlkLTg2ODktZTUwZWYyOGZhN2Q0vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQQUNBRkIwOUU4OUMyNTFCMQAkZjJlZGJiODctOTk3NC0zNGEzLWExMjMtMzZmMThlZTMxNWZkvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQQUUwRTU2OUU1NjM3NTFEMAAkZWMxNWM4NjItNDU2Ny0zZTdiLWE1NmItNTUzMmQ0MzJmMTE3vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQQUU3ODI0QTZGREJGODY0QgAkMzFlOGE2M2ItNWU0MC0zMzFmLThjNmQtMThkNjA3OGMzOWE0vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQREEwMDJCODFDNkMxRkQ2QgAkMzg1ZDQyNzMtOTAyMi0zMmU0LTlhYWQtMWVmNDNiZjU5MWFhvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQREFDNkU1RjcxNUE3QUI2MgAkYzI0NmZjODEtY2U2Zi0zMzRjLTg5OWMtOGY4NzUzZmI4MmU4vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQRTEzMjBDNEY5RTE3MEI5NgAkNjFhYzY1NTQtY2U4OS0zODAxLWFiOWItODUwMzYwNDg2YWVmvu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQRTMwRjM1OEEzOEI0MjZEQwAkZWRkNDMyMTMtNjU4Mi0zOWZlLWFiNTAtZjZhMjI3OWM1ODE1vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQRjY2RUZFOUI4MkZDODgwOAAkOGM3ZjRhNGUtZGIyYi0zMzY1LTg2NzktMTA2NGM4MDQ4YTQ5vu9U3hXa3q0",
"value": {
"enabled": true,
"autoInjection": true
}
},
{
"objectId": "vu9U3hXa3q0AAAABABdidWlsdGluOmhvc3QubW9uaXRvcmluZwAESE9TVAAQRjg2MjVEOUNCMDQ3MDk1NwAkMGRlMDY5ZmUtMDU4Yy0zZDA0LTgwYTMtYjdjNjVhY2I4MWE2vu9U3hXa3q0",
"value": {
"enabled": false,
"autoInjection": true
}
}
],
"totalCount": 24,
"pageSize": 100
}
How can a POST to a hostid and scope correctly target the host I want when a GET from the same host and scope returns 24 hits?
How do I query the OneAgent status to confirm enabled/disabled?
Solved! Go to Solution.
22 Sep 2023 08:21 PM
@DuaneRoelands, seems like a typo in your scopes param, try this:
/api/v2/settings/objects?schemaIds=builtin:host.monitoring&scopes=HOST-29200A0CBEF971B4
25 Sep 2023 02:28 PM
Sometimes the answers are simple. Thank you!