VPN Organizations
Scheme: vpn_organizations.
Запрос
Параметры запроса:
Name |
In |
Type |
Description |
|---|---|---|---|
where (Optional) |
url parameters |
JSON object |
Фильтр элементов. Используется синтаксис mongo запросов. |
sort (Optional) |
url parameters |
string |
Сортировка элементов. |
projection (Optional) |
url parameters |
JSON object |
Скрытие полей. |
embedded (Optional) |
url parameters |
JSON object |
Встраивание элементов в поля. |
page (Optional) |
url parameters |
integer |
Номер страницы элементов. |
max_results (Optional) |
url parameters |
integer |
Максимальное число элементов на одной странице. |
Пример запроса:
curl -X GET http://tkcontrol/api/vpn_organizations?sort=name&page=1&max_results=10&embedded={"vpn_manager":1}
Ответ
Пример ответа:
{
"_items": [
{
"_id": "5fa10a25ccb8d1bdb79feeeb",
"name": "rsa-org-test",
"vpn_manager": {
"_id": "5fa10a15ccb8d1bdb79feee9",
"name": "skupov-dev-pritunl",
"server_address": "10.10.56.124",
"dashboard_address": "https://10.10.56.124",
"username": "pritunl",
"password": "******",
"_updated": "Tue, 03 Nov 2020 07:43:17 GMT",
"_created": "Tue, 03 Nov 2020 07:43:17 GMT"
},
"pritunl_representation": {
"auth_api": false,
"name": "rsa-org-test",
"auth_token": null,
"user_count": 0,
"auth_secret": null,
"id": "5fa001d043e2108e8ffb7a6d"
},
"type": 6,
"_updated": "Tue, 03 Nov 2020 07:43:32 GMT",
"_created": "Tue, 03 Nov 2020 07:43:32 GMT",
"_links": {
"self": {
"title": "Vpn_organization",
"href": "vpn_organizations/5fa10a25ccb8d1bdb79feeeb"
},
"related": {
"vpn_manager": {
"title": "Vpn_manager",
"href": "vpn_managers/5fa10a15ccb8d1bdb79feee9"
}
}
}
}
],
"_links": {
"parent": {
"title": "home",
"href": "/"
},
"self": {
"title": "vpn_organizations",
"href": "vpn_organizations?max_results=10&sort=name"
}
},
"_meta": {
"page": 1,
"max_results": 10,
"total": 1
}
}
Запрос
Параметры запроса:
Name |
In |
Type |
Description |
|---|---|---|---|
projection (Optional) |
url parameters |
JSON object |
Скрытие полей. |
embedded (Optional) |
url parameters |
JSON object |
Встраивание элементов в поля. |
Пример запроса:
curl -X GET http://tkcontrol/api/vpn_organizations/5fa10a25ccb8d1bdb79feeeb
Ответ
Пример ответа:
{
"_id": "5fa10a25ccb8d1bdb79feeeb",
"name": "rsa-org-test",
"vpn_manager": "5fa10a15ccb8d1bdb79feee9",
"pritunl_representation": {
"auth_api": false,
"name": "rsa-org-test",
"auth_token": null,
"user_count": 0,
"auth_secret": null,
"id": "5fa001d043e2108e8ffb7a6d"
},
"type": 6,
"_updated": "Tue, 03 Nov 2020 07:43:32 GMT",
"_created": "Tue, 03 Nov 2020 07:43:32 GMT",
"_links": {
"self": {
"title": "Vpn_organization",
"href": "vpn_organizations/5fa10a25ccb8d1bdb79feeeb"
},
"related": {
"vpn_manager": {
"title": "Vpn_manager",
"href": "vpn_managers/5fa10a15ccb8d1bdb79feee9"
}
},
"parent": {
"title": "home",
"href": "/"
},
"collection": {
"title": "vpn_organizations",
"href": "vpn_organizations"
}
}
}
Запрос
Пример запроса:
curl -X POST http://tkcontrol/api/vpn_organizations -H "Content-Type: application/json" -d '{ \
{ \
"name": "example_organization", \
"pritunl_representation": { \
"name": "example_organization", \
"cipher_type": "rsa" \
}, \
"cipher_type": "rsa", \
"name": "example_organization", \
"vpn_manager": "5fdc6b8998305492eb558cd4" \
}'
Ответ
Пример ответа:
{
"_updated": "Fri, 18 Dec 2020 08:57:33 GMT",
"_created": "Fri, 18 Dec 2020 08:57:33 GMT",
"_id": "5fdc6efd98305492eb558cd6",
"_links": {
"self": {
"title": "Vpn_organization",
"href": "vpn_organizations/5fdc6efd98305492eb558cd6"
},
"related": {
"vpn_manager": {
"title": "Vpn_manager",
"href": "vpn_managers/5fdc6b8998305492eb558cd4"
}
}
},
"_status": "OK"
}
Запрос
Пример запроса:
curl -X DELETE http://tkcontrol/api/vpn_organizations/5fdc6efd98305492eb558cd6