Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten



VALUEDescriptionTypeExample

$ID
ID of the time periodinteger1

$CONTAINER_ID
The container ID, 1 for default root containerinteger1

$NAMEThe name of the time periodstring"my period 1"

$DESCRIPTION
The description of the time periodstring"my description"

$DAY

Day of the time range:

Monday => 1,

Tuesday => 2,

Wednesday => 3,

Thursday => 4,

Friday => 5,

Saturday => 6,

Sunday => 7

integer1

$START_TIMEStart time of the time rangestring08:45

$END_TIMEEnd time of the time rangestring10:50


1. Query a time period by id

URL: https://123.123.123.123/timeperiods/$ID.json

Methode: GET

Response: JSON


Response on successful API call
{
    "timeperiod": {
        "Timeperiod": {
            "id": "1",
            "uuid": "41012866-6114-4853-9caf-6ffd19954e50",
            "container_id": "1",
            "name": "24x7",
            "description": "24x7",
            "created": "2015-01-05 15:11:46",
            "modified": "2015-01-05 15:11:46"
        },
        "Timerange": [
            {
                "id": "1",
                "timeperiod_id": "1",
                "day": "1",
                "start": "00:00",
                "end": "24:00"
            },
            {
                "id": "2",
                "timeperiod_id": "1",
                "day": "2",
                "start": "00:00",
                "end": "24:00"
            },
            {
                "id": "3",
                "timeperiod_id": "1",
                "day": "3",
                "start": "00:00",
                "end": "24:00"
            },
            {
                "id": "4",
                "timeperiod_id": "1",
                "day": "4",
                "start": "00:00",
                "end": "24:00"
            },
            {
                "id": "5",
                "timeperiod_id": "1",
                "day": "5",
                "start": "00:00",
                "end": "24:00"
            },
            {
                "id": "6",
                "timeperiod_id": "1",
                "day": "6",
                "start": "00:00",
                "end": "24:00"
            },
            {
                "id": "7",
                "timeperiod_id": "1",
                "day": "7",
                "start": "00:00",
                "end": "24:00"
            }
        ]
    }
}


2. Query all existing time periods

URL: https://123.123.123.123/timeperiods/index.json

Methode: GET

Response: JSON


Response on successful API call
{
    "all_timeperiods": [
        {
            "Timeperiod": {
                "id": "1",
                "uuid": "41012866-6114-4853-9caf-6ffd19954e50",
                "container_id": "1",
                "name": "24x7",
                "description": "24x7",
                "created": "2015-01-05 15:11:46",
                "modified": "2015-01-05 15:11:46"
            }
        },
        {
            "Timeperiod": {
                "id": "2",
                "uuid": "c5251a5e-37f1-4841-b0bd-f801ee8969d4",
                "container_id": "1",
                "name": "none",
                "description": "none",
                "created": "2015-01-05 15:11:56",
                "modified": "2015-01-05 15:11:56"
            }
        },
    ]
}
  • Keine Stichwörter