[comment]: # translation:outdated

[comment]: # ({0d3af930-0d3af930})
# maintenance.get

[comment]: # ({/0d3af930-0d3af930})

[comment]: # ({c9222501-a04dd4c9})
### Leírás

`integer/array karbantartás.get(objektumparaméterek)`

A módszer lehetővé teszi a karbantartások lekérését a megadottak szerint
paramétereket.

::: noteclassic
Ez a módszer bármilyen típusú felhasználó számára elérhető. Engedélyek
A metódus meghívása a felhasználói szerepkör beállításaiban visszavonható. Lásd: [User
roles](/manual/web_interface/frontend_sections/administration/user_roles)
további információért.
:::

[comment]: # ({/c9222501-a04dd4c9})

[comment]: # ({2ed72b89-9ca798d7})
### Parameters

`(object)` Parameters defining the desired output.

The method supports the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|--|--|------|
|groupids|string/array|Return only maintenances that are assigned to the given host groups.|
|hostids|string/array|Return only maintenances that are assigned to the given hosts.|
|maintenanceids|string/array|Return only maintenances with the given IDs.|
|selectGroups|query|Return a [groups](/manual/api/reference/hostgroup/object) property with host groups assigned to the maintenance.|
|selectHosts|query|Return a [hosts](/manual/api/reference/host/object) property with hosts assigned to the maintenance.|
|selectTags|query|Return a [tags](/manual/api/reference/maintenance/object#problem_tag) property with problem tags of the maintenance.|
|selectTimeperiods|query|Return a [timeperiods](/manual/api/reference/maintenance/object#Time_period) property with time periods of the maintenance.|
|sortfield|string/array|Sort the result by the given properties.<br><br>Possible values are: `maintenanceid`, `name` and `maintenance_type`.|
|countOutput|boolean|These parameters being common for all `get` methods are described in detail in the [reference commentary](/manual/api/reference_commentary#common_get_method_parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/2ed72b89-9ca798d7})

[comment]: # ({7223bab1-7223bab1})
### Visszatérési értékek

`(integer/array)` A következőket adja vissza:

- objektumok tömbje;
- a letöltött objektumok száma, ha a `countOutput` paramétert használták.

[comment]: # ({/7223bab1-7223bab1})

[comment]: # ({b41637d2-b41637d2})
### Példák

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({f6631496-0b1cb387})
#### Retrieving maintenances

Retrieve all configured maintenances, and the data about the assigned
host groups, defined time periods and problem tags.

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "maintenance.get",
    "params": {
        "output": "extend",
        "selectGroups": "extend",
        "selectTimeperiods": "extend",
        "selectTags": "extend"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "maintenanceid": "3",
            "name": "Sunday maintenance",
            "maintenance_type": "0",
            "description": "",
            "active_since": "1358844540",
            "active_till": "1390466940",
            "tags_evaltype": "0",
            "groups": [
                {
                    "groupid": "4",
                    "name": "Zabbix servers",
                    "internal": "0"
                }
            ],
            "timeperiods": [
                {
                    "timeperiod_type": "3",
                    "every": "1",
                    "month": "0",
                    "dayofweek": "1",
                    "day": "0",
                    "start_time": "64800",
                    "period": "3600",
                    "start_date": "2147483647"
                }
            ],
            "tags": [
                {
                    "tag": "service",
                    "operator": "0",
                    "value": "mysqld",
                },
                {
                    "tag": "error",
                    "operator": "2",
                    "value": ""
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/f6631496-0b1cb387})

[comment]: # ({dbcf678a-dbcf678a})
### Lásd még

- [Host](/manual/api/reference/host/object#host)
- [Gazdagépcsoport](/manual/api/reference/hostgroup/object#host_group)
- [Időszak](objektum#időszak)

[comment]: # ({/dbcf678a-dbcf678a})

[comment]: # ({50ed5be3-50ed5be3})
### Forrás

CMaintenance::get() in
*ui/include/classes/api/services/CMaintenance.php*.

[comment]: # ({/50ed5be3-50ed5be3})
