Werk #15218: time_period: response schemas updated to align with other endpoints.

Komponente REST API
Titel time_period: response schemas updated to align with other endpoints.
Datum 08.02.2023
Checkmk Edition Checkmk Raw (CRE)
Checkmk-Version 2.1.0p21 2.2.0b1
Level Kleine Änderung
Klasse Bugfix
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen

This werk introduces a fix for the time period collection and object respsonse schemas.

For example, the previous collection response looked like this

{
  "links": [
    {
      "domainType": "link",
      "rel": "self",
      "href": "http://localhost/heute/check_mk/api/1.0/domain-types/time_period/collections/all",
      "method": "GET",
      "type": "application/json"
    }
  ],
  "id": "timeperiod",
  "domainType": "time_period",
  "value": [
    {
      "domainType": "dict",
      "title": "tp1"
    },
  ]
}

It now looks like this

{
  "links": [
    {
      "domainType": "link",
      "rel": "self",
      "href": "http://localhost/heute/check_mk/api/1.0/domain-types/time_period/collections/all",
      "method": "GET",
      "type": "application/json"
    }
  ],
  "id": "time_period",
  "domainType": "time_period",
  "value": [
    {
      "links": [
        {
          "domainType": "link",
          "rel": "self",
          "href": "http://localhost/heute/check_mk/api/1.0/objects/time_period/time_period_1",
          "method": "GET",
          "type": "application/json"
        },
        {
          "domainType": "link",
          "rel": "urn:org.restfulobjects:rels/update",
          "href": "http://localhost/heute/check_mk/api/1.0/objects/time_period/time_period_1",
          "method": "PUT",
          "type": "application/json"
        },
        {
          "domainType": "link",
          "rel": "urn:org.restfulobjects:rels/delete",
          "href": "http://localhost/heute/check_mk/api/1.0/objects/time_period/time_period_1",
          "method": "DELETE",
          "type": "application/json"
        }
      ],
      "domainType": "time_period",
      "id": "time_period_1",
      "title": "tp1",
      "members": {},
      "extensions": {
        "alias": "tp1",
        "active_time_ranges": [
          {
            "day": "monday",
            "time_ranges": [
              {
                "start": "12:00",
                "end": "15:00"
              }
            ]
          }
        ],
        "exceptions": [],
        "exclude": []
      }
    },
  ],
  "extensions": {}
}

Zur Liste aller Werks