Hello @PedroSantos
My view here is that these changes of APIS to schemas seems to be not very useful to meet a variety of extracts with conditions. In my case it doesn’t allow to have the several filters or conditions based on the parent API which I intended.
Example the host monitoring API referred here - I couldn’t ( use multiple conditions) example to use my hosts in iteration mode - Condition to check monitoring mode and monitoring state 2 conditions, to make this logic effective I need to call 2 schemas which i found making the logic extensive. So I moved ahead with 1 condition to check only monitoring state from the API -hosts_url = f"https://{environmentid}.live.dynatrace.com/api/v2/entities?pageSize=1000&entitySelector=type(HOST)mzID()&from=now-1h&fields=properties.STATE
Take those hosts based on that condition then iterate it, there was the problem i found it complicated as the schemas with GET and POST on have different values expected to be passed in the JSON.
This was my GET API - https://environment/api/v2/settings/objects?schemaIds=builtin%3Ahost.monitoring&fields=objectId%2Cvalue%2Csummary%2Cscope&filter=value.enabled%20%3D%20true&pageSize=500
$payload= @{schemaId=$builtinmonitoring
scope=$host_id
value=@{enabled=$enabled}
}|ConvertTo-Json
Write-host $payload
$response = Invoke-RestMethod -Uri $settings_url -Headers $headers -Method Post -Body $payload
And my POST API as $response with JSON body of the request as below. Which means the results of GET Schema with the value.enabled cannot be passed to Stop the monitoring using POST or PUT
settings/objects
<span>[</span> {
<span class="">"externalId"</span><span>: </span><span>"string"</span><span>,</span> <span class="">"insertAfter"</span><span>: </span><span>"Y2ktaGd="</span><span>,</span> <span class="">"objectId"</span><span>: </span><span>"Y2ktaGd"</span><span>,</span> <span class="">"schemaId"</span><span>: </span><span>"builtin:container.built-in-monitoring-rule"</span><span>,</span> <span class="">"schemaVersion"</span><span>: </span><span>"1.0.0"</span><span>,</span> <span class="">"scope"</span><span>: </span><span>"HOST-D"</span><span>,</span> <span class="">"value"</span><span>: {</span> <span class="">"autoMonitoring"</span><span>: </span><span>true</span>
}
}
]
There is no object called value.enabled = false like in GET to be passed to POST/PUT as there it is referred as
<span>"value": {</span><span> "autoMonitoring": true</span>
It seems to be more complicated for simple logics. Can you guide how to use schema with GET and POST in stopping monitoring of the hosts ?