27 Jul 2023 07:21 PM - last edited on 31 Jul 2023 03:00 PM by Ana_Kuzmenchuk
I want to turn OneAgent ON or OFF on a specific host via the REST API, but I can't find the specific endpoint to do this. The OneAgent API seems to be read-only.
I am able to get a list of OneAgents from the API, and by searching the response for my server name, I can find the entityID. What endpoint in the REST API can I use to turn OneAgent off on that server?
This is for DynaTrace SaaS.
Solved! Go to Solution.
27 Jul 2023 07:44 PM
Once upon a time we used OneAgent monitoring configuration API - PUT configuration but this API is deprecated.
In order to use the current v2 setting api please go to the setting page of your host under setting --> host monitoring , use the ... on the right corner
in order to open the menu
and choose api
just copy the update api call and you are all set!
HTH
Yos
28 Jul 2023 05:18 PM
This does not work.
Submitted this payload (taken from the API section of the settings as you instructed:
28 Jul 2023 06:30 PM
Hi @DuaneRoelands. Please add [] in the payload.
31 Jul 2023 03:26 PM
This doesn't work, either.
Payload:
31 Jul 2023 05:02 PM
Use POST method in the following API:
{{baseUrl}}/settings/objects?validateOnly=true
and change baseUrl placeholder for your tenant/api/v2
then your payload
[
{
"schemaId": "builtin:host.monitoring",
"value": {
"enabled": true,
"fullStack": false,
"autoInjection": true
},
"schemaVersion": "1.2.1",
"scope": "HOST-29200A0CBEF971B4"
}
]
if everything goes right you should receive a
[
{
"code": 200
}
]
31 Jul 2023 08:22 PM
Still not working.
Endpoint:
/api/v2/settings/objects?validateOnly=true
Body:
01 Aug 2023 02:37 PM
Hi @DuaneRoelands set schema to:
"schemaVersion": "1.2.0",
this should work. Could be a bug on the API.
I query the schema and it is correct:
{
"schemaId": "builtin:host.monitoring",
"displayName": "Monitoring",
"latestSchemaVersion": "1.2.1"
}
02 Aug 2023 03:03 PM
Changing the schema version to 1.2.0 worked. Thank you for your assistance!