25 Nov 2024 10:26 PM
I am trying to run a POST command to enable the Elasticsearch extension. I have looked through all of the documentation. I am able to get a list of the monitoring configurations in my account as well as the details for the one I want to copy. I have a working monitoring configuration that I configured in the Dynatrace UI. I want to copy that configuration and enable a new one using it via CURL. I copied the JSON snippet from the Dynatrace UI but get errors when putting it in the CURL command.
26 Nov 2024 12:23 AM
@mk_dynatrace_13 Could you please share the errors that you are receiving when running the CURL command ?
26 Nov 2024 02:48 PM
I tried
curl -X POST "URL../api/v2/extensions/extension_name/monitoringConfigurations" -H "Authorization: Api-Token XXX"
and received this error:
{"error":{"code":400,"message":"Constraints violated.","constraintViolations":[{"path":"","message":"Configuration payload is required","parameterLocation":"PAYLOAD_BODY","location":null}]}}%
I then added the payload and
-H "Content-Type: application/json"
and got this error:
{"error":{"code":400,"message":"Could not map JSON at '[0]' near line 3 column 6"}}
29 Nov 2024 06:54 AM
@mk_dynatrace_13 there is some issue with the content that you are posting , but will be tricky to guess what the issue is unless we look at that config