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