Update API pages with v0.26.3

This commit is contained in:
netbirddev
2024-03-12 18:32:05 +00:00
parent da6d580f6b
commit 126bc96948
13 changed files with 338 additions and 5153 deletions

View File

@@ -160,76 +160,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"ip": "10.64.0.1",
"connection_ip": "35.64.0.1",
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z",
"os": "Darwin 13.2.1",
"kernel_version": "23.2.0",
"geoname_id": 2643743,
"version": "0.14.0",
"groups": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"ssh_enabled": true,
"user_id": "google-oauth2|277474792786460067937",
"hostname": "stage-host-1",
"ui_version": "0.14.0",
"dns_label": "stage-host-1.netbird.cloud",
"login_expiration_enabled": false,
"login_expired": false,
"last_login": "2023-05-05T09:00:35.477782Z",
"approval_required": true,
"country_code": "DE",
"city_name": "Berlin",
"accessible_peers_count": 5
{
"items": {
"$ref": "#/components/schemas/PeerBatch"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"name": "string",
"ip": "string",
"connection_ip": "string",
"connected": "boolean",
"last_seen": "string",
"os": "string",
"kernel_version": "string",
"geoname_id": "integer",
"version": "string",
"groups": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"ssh_enabled": "boolean",
"user_id": "string",
"hostname": "string",
"ui_version": "string",
"dns_label": "string",
"login_expiration_enabled": "boolean",
"login_expired": "boolean",
"last_login": "string",
"approval_required": "boolean",
"country_code": "string",
"city_name": "string",
"accessible_peers_count": "integer"
{
"items": {
"$ref": "#/components/schemas/PeerBatch"
}
]
}
```
</CodeGroup>
@@ -407,86 +349,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"ip": "10.64.0.1",
"connection_ip": "35.64.0.1",
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z",
"os": "Darwin 13.2.1",
"kernel_version": "23.2.0",
"geoname_id": 2643743,
"version": "0.14.0",
"groups": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"ssh_enabled": true,
"user_id": "google-oauth2|277474792786460067937",
"hostname": "stage-host-1",
"ui_version": "0.14.0",
"dns_label": "stage-host-1.netbird.cloud",
"login_expiration_enabled": false,
"login_expired": false,
"last_login": "2023-05-05T09:00:35.477782Z",
"approval_required": true,
"country_code": "DE",
"city_name": "Berlin",
"accessible_peers": [
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"ip": "10.64.0.1",
"dns_label": "stage-host-1.netbird.cloud",
"user_id": "google-oauth2|277474792786460067937"
}
]
"$ref": "#/components/schemas/Peer"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"ip": "string",
"connection_ip": "string",
"connected": "boolean",
"last_seen": "string",
"os": "string",
"kernel_version": "string",
"geoname_id": "integer",
"version": "string",
"groups": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"ssh_enabled": "boolean",
"user_id": "string",
"hostname": "string",
"ui_version": "string",
"dns_label": "string",
"login_expiration_enabled": "boolean",
"login_expired": "boolean",
"last_login": "string",
"approval_required": "boolean",
"country_code": "string",
"city_name": "string",
"accessible_peers": [
{
"id": "string",
"name": "string",
"ip": "string",
"dns_label": "string",
"user_id": "string"
}
]
"$ref": "#/components/schemas/Peer"
}
```
</CodeGroup>
@@ -511,33 +379,7 @@ echo $response;
The unique identifier of a peer
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
</Property>
<Property name="ssh_enabled" type="boolean" required={true}>
</Property>
<Property name="login_expiration_enabled" type="boolean" required={true}>
</Property>
<Property name="approval_required" type="boolean" required={false}>
(Cloud only) Indicates whether peer needs approval
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/peers/{peerId}">
@@ -547,20 +389,14 @@ curl -X PUT https://api.netbird.io/api/peers/{peerId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
});
let config = {
method: 'put',
@@ -589,10 +425,7 @@ import json
url = "https://api.netbird.io/api/peers/{peerId}"
payload = json.dumps({
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -621,10 +454,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
}`)
client := &http.Client {
}
@@ -671,10 +501,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
})
response = https.request(request)
puts response.read_body
@@ -685,10 +512,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
@@ -715,10 +539,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false,
"approval_required": true
"$ref": "#/components/schemas/PeerRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -739,86 +560,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"ip": "10.64.0.1",
"connection_ip": "35.64.0.1",
"connected": true,
"last_seen": "2023-05-05T10:05:26.420578Z",
"os": "Darwin 13.2.1",
"kernel_version": "23.2.0",
"geoname_id": 2643743,
"version": "0.14.0",
"groups": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"ssh_enabled": true,
"user_id": "google-oauth2|277474792786460067937",
"hostname": "stage-host-1",
"ui_version": "0.14.0",
"dns_label": "stage-host-1.netbird.cloud",
"login_expiration_enabled": false,
"login_expired": false,
"last_login": "2023-05-05T09:00:35.477782Z",
"approval_required": true,
"country_code": "DE",
"city_name": "Berlin",
"accessible_peers": [
{
"id": "chacbco6lnnbn6cg5s90",
"name": "stage-host-1",
"ip": "10.64.0.1",
"dns_label": "stage-host-1.netbird.cloud",
"user_id": "google-oauth2|277474792786460067937"
}
]
"$ref": "#/components/schemas/Peer"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"ip": "string",
"connection_ip": "string",
"connected": "boolean",
"last_seen": "string",
"os": "string",
"kernel_version": "string",
"geoname_id": "integer",
"version": "string",
"groups": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"ssh_enabled": "boolean",
"user_id": "string",
"hostname": "string",
"ui_version": "string",
"dns_label": "string",
"login_expiration_enabled": "boolean",
"login_expired": "boolean",
"last_login": "string",
"approval_required": "boolean",
"country_code": "string",
"city_name": "string",
"accessible_peers": [
{
"id": "string",
"name": "string",
"ip": "string",
"dns_label": "string",
"user_id": "string"
}
]
"$ref": "#/components/schemas/Peer"
}
```
</CodeGroup>