mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-18 08:26:35 +00:00
Update API pages with v0.26.3
This commit is contained in:
@@ -160,36 +160,18 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
[
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
[
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -205,23 +187,7 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a group
|
||||
|
||||
#### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Group name identifier
|
||||
|
||||
</Property>
|
||||
<Property name="peers" type="string[]" required={false}>
|
||||
|
||||
List of peers ids
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
|
||||
</Col>
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/groups">
|
||||
@@ -231,20 +197,14 @@ curl -X POST https://api.netbird.io/api/groups \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -273,10 +233,7 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/groups"
|
||||
payload = json.dumps({
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -305,10 +262,7 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -355,10 +309,7 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -369,10 +320,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/groups")
|
||||
@@ -399,10 +347,7 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -423,30 +368,12 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -625,30 +552,12 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -673,23 +582,7 @@ echo $response;
|
||||
The unique identifier of a group
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
#### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Group name identifier
|
||||
|
||||
</Property>
|
||||
<Property name="peers" type="string[]" required={false}>
|
||||
|
||||
List of peers ids
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
|
||||
</Col>
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/groups/{groupId}">
|
||||
@@ -699,20 +592,14 @@ curl -X PUT https://api.netbird.io/api/groups/{groupId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -741,10 +628,7 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/groups/{groupId}"
|
||||
payload = json.dumps({
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -773,10 +657,7 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -823,10 +704,7 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -837,10 +715,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/groups/{groupId}")
|
||||
@@ -867,10 +742,7 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -891,30 +763,12 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
"$ref": "#/components/schemas/Group"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
Reference in New Issue
Block a user