Skip to content

Dashboard update fails with constraint violations #119

@nicr9

Description

@nicr9

Describe the bug
dt.dashboards.put(...) fails with errors claiming that the tiles and dashboardMetadata fields can't be null

To Reproduce

for dashboard in dt.dashboards.list():
    body = dashboard.get_full_dashboard().json()
    body['dashboardMetadata']['owner'] = new_owner

    resp = dt.dashboards.put(dashboard.id, body)

See error:

Traceback (most recent call last):
  File "dashboard-demo.py", line 38, in <module>
    resp = dt.dashboards.put(dashboard.id, body)
  File "/usr/lib/python3.6/site-packages/dynatrace/configuration_v1/dashboard.py", line 53, in put
    return self.__http_client.make_request(f"/api/config/v1/dashboards/{dashboard_id}", params=params, method="PUT")
  File "/usr/lib/python3.6/site-packages/dynatrace/http_client.py", line 146, in make_request
    raise Exception(f"Error making request to {url}: {r}. Response: {r.text}")
Exception: Error making request to https://abc123.live.dynatrace.com/api/config/v1/dashboards/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx: <Response [400]>. Response: {"error":{"code":400,"message":"Constraints violated.","constraintViolations":[{"path":"dashboardMetadata","message":"may not be null","parameterLocation":"PAYLOAD_BODY","location":null},{"path":"tiles","message":"Tiles configuration is invalid.","parameterLocation":"PAYLOAD_BODY","location":null},{"path":"tiles","message":"may not be null","parameterLocation":"PAYLOAD_BODY","location":null}]}}

Expected behavior

Response should be a 204

Desktop (please complete the following information):

  • OS: RHEL 7
  • python: 3.6.8
  • dt: 1.1.73 (installed via pip)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions