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
Level Kleine Änderung
Klasse Bugfix
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen
Checkmk versions & editions
2.2.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.1.0p21 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

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