[comment]: # translation:outdated

[comment]: # ({70dbc2c9-70dbc2c9})
# proxy.get

[comment]: # ({/70dbc2c9-70dbc2c9})

[comment]: # ({fea54630-b91ae38b})
### Opis

`integer/array proxy.get(object parameters)`

Ta metoda umożliwia pobieranie proxy zgodnie z podanymi parametrami.

::: noteclassic
Ta metoda jest dostępna dla użytkowników dowolnego typu. Uprawnienia do wywołania tej metody mogą zostać cofnięte w ustawieniach roli użytkownika. Więcej informacji znajduje się w sekcji
[Role użytkowników](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/fea54630-b91ae38b})

[comment]: # ({eb1d0821-74f0aaac})
### Parametry

`(object)` Parametry definiujące żądane dane wyjściowe.

Metoda obsługuje następujące parametry.

|Parametr|[Typ](/manual/api/reference_commentary#data-types)|Opis|
|--|--|------|
|proxyids|ID/array|Zwracaj tylko proxy o podanych identyfikatorach.|
|proxy_groupids|ID/array|Zwracaj tylko proxy należące do podanych grup proxy.|
|selectAssignedHosts|query|Zwracaj właściwość [`assignedHosts`](/manual/api/reference/host/object) z hostami przypisanymi do proxy.<br><br>Obsługuje `count`.|
|selectHosts|query|Zwracaj właściwość [`hosts`](/manual/api/reference/host/object) z hostami monitorowanymi przez proxy.<br><br>Obsługuje `count`.|
|selectProxyGroup|query|Zwracaj właściwość [`proxyGroup`](/manual/api/reference/proxygroup/object) z obiektem grupy proxy.|
|sortfield|string/array|Sortuj wynik według podanych właściwości.<br><br>Możliwe wartości: `proxyid`, `name`, `operating_mode`.|
|countOutput|boolean|Te parametry opisano w [komentarzu referencyjnym](/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]: # ({/eb1d0821-74f0aaac})

[comment]: # ({07ca11ca-7223bab1})
### Zwracane wartości

`(integer/array)` Zwraca:

-   tablicę obiektów;
-   liczbę pobranych obiektów, jeśli został użyty parametr `countOutput`.

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

[comment]: # ({b41637d2-b41637d2})
### Przykłady

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

[comment]: # ({eace8ca8-b40fb513})
#### Pobieranie wszystkich proxy

Pobierz wszystkie skonfigurowane proxy i ich interfejsy.

[Żądanie](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "proxy.get",
    "params": {
        "output": "extend"
    },
    "id": 1
}
```

Odpowiedź:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "proxyid": "11",
            "name": "Active proxy",
            "proxy_groupid": "0",
            "local_address": "",
            "local_port": "10051",
            "operating_mode": "0",
            "description": "",
            "allowed_addresses": "",
            "address": "127.0.0.1",
            "port": "10051",
            "tls_connect": "1",
            "tls_accept": "1",
            "tls_issuer": "",
            "tls_subject": "",
            "custom_timeouts": "0",
            "timeout_zabbix_agent": "",
            "timeout_simple_check": "",
            "timeout_snmp_agent": "",
            "timeout_external_check": "",
            "timeout_db_monitor": "",
            "timeout_http_agent": "",
            "timeout_ssh_agent": "",
            "timeout_telnet_agent": "",
            "timeout_script": "",
            "last_access": "1693391880",
            "version": "70000",
            "compatibility": "1",
            "state": "1"
        },
        {
            "proxyid": "12",
            "name": "Passive proxy",
            "proxy_groupid": "1",
            "local_address": "127.0.0.1",
            "local_port": "10051",
            "operating_mode": "1",
            "description": "",
            "allowed_addresses": "",
            "address": "127.0.0.1",
            "port": "10051",
            "tls_connect": "1",
            "tls_accept": "1",
            "tls_issuer": "",
            "tls_subject": "",
            "custom_timeouts": "1",
            "timeout_zabbix_agent": "5s",
            "timeout_simple_check": "5s",
            "timeout_snmp_agent": "5s",
            "timeout_external_check": "5s",
            "timeout_db_monitor": "5s",
            "timeout_http_agent": "5s",
            "timeout_ssh_agent": "5s",
            "timeout_telnet_agent": "5s",
            "timeout_script": "5s",
            "lastaccess": "1693391875",
            "version": "60400",
            "compatibility": "2",
            "state": "2"
        }
    ],
    "id": 1
}
```

[comment]: # ({/eace8ca8-b40fb513})

[comment]: # ({ffb6ee14-273e0fd8})
### Zobacz także

-   [Host](/manual/api/reference/host/object#host)
-   [Grupa proxy](/manual/api/reference/proxygroup/object#proxy-group)

[comment]: # ({/ffb6ee14-273e0fd8})

[comment]: # ({b9a96f2c-b9a96f2c})
### Źródło

CProxy::get() w *ui/include/classes/api/services/CProxy.php*.

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