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,211 +160,21 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "ch8i4ug6lnn4g9hqv7l0",
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
{
"items": {
"$ref": "#/components/schemas/Account"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"settings": {
"peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer",
"groups_propagation_enabled": "boolean",
"jwt_groups_enabled": "boolean",
"jwt_groups_claim_name": "string",
"jwt_allow_groups": [
"string"
],
"extra": {
"peer_approval_enabled": "boolean"
}
}
{
"items": {
"$ref": "#/components/schemas/Account"
}
]
```
</CodeGroup>
</Col>
</Row>
---
## Delete an Account {{ tag: 'DELETE' , label: '/api/accounts/{accountId}' }}
<Row>
<Col>
Deletes an account and all its resources. Only administrators and account owners can delete accounts.
#### Path Parameters
<Properties>
<Property name="accountId" type="string" required={true}>
The unique identifier of an account
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="DELETE" label="/api/accounts/{accountId}">
```bash {{ title: 'cURL' }}
curl -X DELETE https://api.netbird.io/api/accounts/{accountId} \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'delete',
maxBodyLength: Infinity,
url: '/api/accounts/{accountId}',
headers: {
'Authorization': 'Token <TOKEN>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
```
```python
import requests
import json
url = "https://api.netbird.io/api/accounts/{accountId}"
headers: {
'Authorization': 'Token <TOKEN>'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
```
```go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.netbird.io/api/accounts/{accountId}"
method := "DELETE"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
req.Header.Add("Authorization", "Token <TOKEN>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
```
```ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.netbird.io/api/accounts/{accountId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
response = https.request(request)
puts response.read_body
```
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.netbird.io/api/accounts/{accountId}")
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
.build();
Response response = client.newCall(request).execute();
```
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.netbird.io/api/accounts/{accountId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
</Col>
</Row>
@@ -385,72 +195,7 @@ echo $response;
The unique identifier of an account
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="settings" type="object" required={true}>
<details class="custom-details" open>
<summary>More Information</summary>
<Properties>
<Properties><Property name="peer_login_expiration_enabled" type="boolean" required={true}>
Enables or disables peer login expiration globally. After peer's login has expired the user has to log in (authenticate). Applies only to peers that were added by a user (interactive SSO login).
</Property>
<Property name="peer_login_expiration" type="integer" required={true}>
Period of time after which peer login expires (seconds).
</Property>
<Property name="groups_propagation_enabled" type="boolean" required={false}>
Allows propagate the new user auto groups to peers that belongs to the user
</Property>
<Property name="jwt_groups_enabled" type="boolean" required={false}>
Allows extract groups from JWT claim and add it to account groups.
</Property>
<Property name="jwt_groups_claim_name" type="string" required={false}>
Name of the claim from which we extract groups names to add it to account groups.
</Property>
<Property name="jwt_allow_groups" type="string[]" required={false}>
List of groups to which users are allowed access
</Property>
<Property name="extra" type="object" required={false}>
<details class="custom-details" open>
<summary>More Information</summary>
<Properties>
<Properties><Property name="peer_approval_enabled" type="boolean" required={false}>
(Cloud only) Enables or disables peer approval globally. If enabled, all peers added will be in pending state until approved by an admin.
</Property>
</Properties>
</Properties>
</details>
</Property>
</Properties>
</Properties>
</details>
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/accounts/{accountId}">
@@ -460,38 +205,14 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
});
let config = {
method: 'put',
@@ -520,19 +241,7 @@ import json
url = "https://api.netbird.io/api/accounts/{accountId}"
payload = json.dumps({
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -561,19 +270,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
}`)
client := &http.Client {
}
@@ -620,19 +317,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
})
response = https.request(request)
puts response.read_body
@@ -643,19 +328,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/accounts/{accountId}")
@@ -682,19 +355,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/AccountRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -715,48 +376,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7l0",
"settings": {
"peer_login_expiration_enabled": true,
"peer_login_expiration": 43200,
"groups_propagation_enabled": true,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles",
"jwt_allow_groups": [
"Administrators"
],
"extra": {
"peer_approval_enabled": true
}
}
"$ref": "#/components/schemas/Account"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"settings": {
"peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer",
"groups_propagation_enabled": "boolean",
"jwt_groups_enabled": "boolean",
"jwt_groups_claim_name": "string",
"jwt_allow_groups": [
"string"
],
"extra": {
"peer_approval_enabled": "boolean"
}
}
"$ref": "#/components/schemas/Account"
}
```
</CodeGroup>
</Col>
</CodeGroup>
</Col>
</Row>
---
@@ -918,6 +549,7 @@ echo $response;
</CodeGroup>
</Col>
</Row>

View File

@@ -160,54 +160,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
{
"items": {
"$ref": "#/components/schemas/NameserverGroup"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"name": "string",
"description": "string",
"nameservers": [
{
"ip": "string",
"ns_type": "string",
"port": "integer"
}
],
"enabled": "boolean",
"groups": [
"string"
],
"primary": "boolean",
"domains": [
"string"
],
"search_domains_enabled": "boolean"
{
"items": {
"$ref": "#/components/schemas/NameserverGroup"
}
]
}
```
</CodeGroup>
@@ -223,75 +187,7 @@ echo $response;
<Row>
<Col>
Creates a Nameserver Group
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true} minLen={1} maxLen={40}>
Name of nameserver group name
</Property>
<Property name="description" type="string" required={true}>
Description of the nameserver group
</Property>
<Property name="nameservers" type="object[]" required={true} minLen={1} maxLen={3}>
<details class="custom-details" open>
<summary>Nameserver list</summary>
<Properties>
<Properties><Property name="ip" type="string" required={true}>
Nameserver IP
</Property>
<Property name="ns_type" type="string" required={true} enumList={["udp"]}>
Nameserver Type
</Property>
<Property name="port" type="integer" required={true}>
Nameserver Port
</Property>
</Properties>
</Properties>
</details>
</Property>
<Property name="enabled" type="boolean" required={true}>
Nameserver group status
</Property>
<Property name="groups" type="string[]" required={true}>
Distribution group IDs that defines group of peers that will use this nameserver group
</Property>
<Property name="primary" type="boolean" required={true}>
Defines if a nameserver group is primary that resolves all domains. It should be true only if domains list is empty.
</Property>
<Property name="domains" type="string[]" required={true}>
Match domain list. It should be empty only if primary is true.
</Property>
<Property name="search_domains_enabled" type="boolean" required={true}>
Search domain status for match domains. It should be true only if domains list is not empty.
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/dns/nameservers">
@@ -301,48 +197,14 @@ curl -X POST https://api.netbird.io/api/dns/nameservers \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
});
let config = {
method: 'post',
@@ -371,24 +233,7 @@ import json
url = "https://api.netbird.io/api/dns/nameservers"
payload = json.dumps({
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -417,24 +262,7 @@ func main() {
method := "POST"
payload := strings.NewReader(`{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}`)
client := &http.Client {
}
@@ -481,24 +309,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
})
response = https.request(request)
puts response.read_body
@@ -509,24 +320,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/nameservers")
@@ -553,24 +347,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -591,48 +368,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroup"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"description": "string",
"nameservers": [
{
"ip": "string",
"ns_type": "string",
"port": "integer"
}
],
"enabled": "boolean",
"groups": [
"string"
],
"primary": "boolean",
"domains": [
"string"
],
"search_domains_enabled": "boolean"
"$ref": "#/components/schemas/NameserverGroup"
}
```
</CodeGroup>
@@ -811,48 +552,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroup"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"description": "string",
"nameservers": [
{
"ip": "string",
"ns_type": "string",
"port": "integer"
}
],
"enabled": "boolean",
"groups": [
"string"
],
"primary": "boolean",
"domains": [
"string"
],
"search_domains_enabled": "boolean"
"$ref": "#/components/schemas/NameserverGroup"
}
```
</CodeGroup>
@@ -877,75 +582,7 @@ echo $response;
The unique identifier of a Nameserver Group
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true} minLen={1} maxLen={40}>
Name of nameserver group name
</Property>
<Property name="description" type="string" required={true}>
Description of the nameserver group
</Property>
<Property name="nameservers" type="object[]" required={true} minLen={1} maxLen={3}>
<details class="custom-details" open>
<summary>Nameserver list</summary>
<Properties>
<Properties><Property name="ip" type="string" required={true}>
Nameserver IP
</Property>
<Property name="ns_type" type="string" required={true} enumList={["udp"]}>
Nameserver Type
</Property>
<Property name="port" type="integer" required={true}>
Nameserver Port
</Property>
</Properties>
</Properties>
</details>
</Property>
<Property name="enabled" type="boolean" required={true}>
Nameserver group status
</Property>
<Property name="groups" type="string[]" required={true}>
Distribution group IDs that defines group of peers that will use this nameserver group
</Property>
<Property name="primary" type="boolean" required={true}>
Defines if a nameserver group is primary that resolves all domains. It should be true only if domains list is empty.
</Property>
<Property name="domains" type="string[]" required={true}>
Match domain list. It should be empty only if primary is true.
</Property>
<Property name="search_domains_enabled" type="boolean" required={true}>
Search domain status for match domains. It should be true only if domains list is not empty.
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/dns/nameservers/{nsgroupId}">
@@ -955,48 +592,14 @@ curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
});
let config = {
method: 'put',
@@ -1025,24 +628,7 @@ import json
url = "https://api.netbird.io/api/dns/nameservers/{nsgroupId}"
payload = json.dumps({
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -1071,24 +657,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}`)
client := &http.Client {
}
@@ -1135,24 +704,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
})
response = https.request(request)
puts response.read_body
@@ -1163,24 +715,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
@@ -1207,24 +742,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroupRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -1245,48 +763,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "Google DNS",
"description": "Google DNS servers",
"nameservers": [
{
"ip": "8.8.8.8",
"ns_type": "udp",
"port": 53
}
],
"enabled": true,
"groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"primary": true,
"domains": [
"example.com"
],
"search_domains_enabled": true
"$ref": "#/components/schemas/NameserverGroup"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"description": "string",
"nameservers": [
{
"ip": "string",
"ns_type": "string",
"port": "integer"
}
],
"enabled": "boolean",
"groups": [
"string"
],
"primary": "boolean",
"domains": [
"string"
],
"search_domains_enabled": "boolean"
"$ref": "#/components/schemas/NameserverGroup"
}
```
</CodeGroup>
@@ -1622,18 +1104,14 @@ echo $response;
```json {{ title: 'Example' }}
{
"items": {
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
}
}
```
```json {{ title: 'Schema' }}
{
"items": {
"disabled_management_groups": [
"string"
]
"$ref": "#/components/schemas/DNSSettings"
}
}
```
@@ -1651,18 +1129,7 @@ echo $response;
<Row>
<Col>
Updates a DNS settings object
#### Request-Body Parameters
<Properties><Property name="disabled_management_groups" type="string[]" required={true}>
Groups whose DNS management is disabled
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/dns/settings">
@@ -1672,18 +1139,14 @@ curl -X PUT https://api.netbird.io/api/dns/settings \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
});
let config = {
method: 'put',
@@ -1712,9 +1175,7 @@ import json
url = "https://api.netbird.io/api/dns/settings"
payload = json.dumps({
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
})
headers: {
'Content-Type': 'application/json',
@@ -1743,9 +1204,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
}`)
client := &http.Client {
}
@@ -1792,9 +1251,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
})
response = https.request(request)
puts response.read_body
@@ -1805,9 +1262,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/settings")
@@ -1834,9 +1289,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -1857,16 +1310,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"disabled_management_groups": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/DNSSettings"
}
```
```json {{ title: 'Schema' }}
{
"disabled_management_groups": [
"string"
]
"$ref": "#/components/schemas/DNSSettings"
}
```
</CodeGroup>

View File

@@ -160,47 +160,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": 10,
"timestamp": "2023-05-05T10:04:37.473542Z",
"activity": "Route created",
"activity_code": "route.add",
"initiator_id": "google-oauth2|123456789012345678901",
"initiator_name": "John Doe",
"initiator_email": "demo@netbird.io",
"target_id": "chad9d86lnnc59g18ou0",
"meta": {
"name": "my route",
"network_range": "10.64.0.0/24",
"peer_id": "chacbco6lnnbn6cg5s91"
}
{
"items": {
"$ref": "#/components/schemas/Event"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"timestamp": "string",
"activity": "string",
"activity_code": "string",
"initiator_id": "string",
"initiator_name": "string",
"initiator_email": "string",
"target_id": "string",
"meta": {
"description": "The metadata of the event",
"type": "object",
"additionalProperties": "string",
"example": {
"name": "my route",
"network_range": "10.64.0.0/24",
"peer_id": "chacbco6lnnbn6cg5s91"
}
}
{
"items": {
"$ref": "#/components/schemas/Event"
}
]
}
```
</CodeGroup>

View File

@@ -2,7 +2,7 @@ export const title = 'Geo Locations'
## List all country codes {{ tag: 'GET' , label: '/api/locations/countries' }}
## List all country codes {{ tag: 'GET' , label: '/api/locations/countries' }}
<Row>
<Col>
@@ -160,14 +160,16 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
"DE"
]
{
"items": "DE"
}
```
```json {{ title: 'Schema' }}
[
"string"
]
{
"items": {
"example": "DE"
}
}
```
</CodeGroup>
@@ -178,7 +180,7 @@ echo $response;
---
## List all city names by country {{ tag: 'GET' , label: '/api/locations/countries/{country}/cities' }}
## List all city names by country {{ tag: 'GET' , label: '/api/locations/countries/{country}/cities' }}
<Row>
<Col>
@@ -345,14 +347,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"geoname_id": 2950158,
"city_name": "Berlin"
"$ref": "#/components/schemas/City"
}
```
```json {{ title: 'Schema' }}
{
"geoname_id": "integer",
"city_name": "string"
"$ref": "#/components/schemas/City"
}
```
</CodeGroup>

View File

@@ -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>

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>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -160,46 +160,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "chacdk86lnnboviihd7g",
"network_type": "IPv4",
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
{
"items": {
"$ref": "#/components/schemas/Route"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"network_type": "string",
"description": "string",
"network_id": "string",
"enabled": "boolean",
"peer": "string",
"peer_groups": [
"string"
],
"network": "string",
"metric": "integer",
"masquerade": "boolean",
"groups": [
"string"
]
{
"items": {
"$ref": "#/components/schemas/Route"
}
]
}
```
</CodeGroup>
@@ -215,58 +187,7 @@ echo $response;
<Row>
<Col>
Creates a Route
#### Request-Body Parameters
<Properties><Property name="description" type="string" required={true}>
Route description
</Property>
<Property name="network_id" type="string" required={true} minLen={1} maxLen={40}>
Route network identifier, to group HA routes
</Property>
<Property name="enabled" type="boolean" required={true}>
Route status
</Property>
<Property name="peer" type="string" required={false}>
Peer Identifier associated with route. This property can not be set together with `peer_groups`
</Property>
<Property name="peer_groups" type="string[]" required={false}>
Peers Group Identifier associated with route. This property can not be set together with `peer`
</Property>
<Property name="network" type="string" required={true}>
Network range in CIDR format
</Property>
<Property name="metric" type="integer" required={true} min={1} max={9999}>
Route metric number. Lowest number has higher priority
</Property>
<Property name="masquerade" type="boolean" required={true}>
Indicate if peer should masquerade traffic to this route's prefix
</Property>
<Property name="groups" type="string[]" required={true}>
Group IDs containing routing peers
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/routes">
@@ -276,38 +197,14 @@ curl -X POST https://api.netbird.io/api/routes \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
});
let config = {
method: 'post',
@@ -336,19 +233,7 @@ import json
url = "https://api.netbird.io/api/routes"
payload = json.dumps({
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -377,19 +262,7 @@ func main() {
method := "POST"
payload := strings.NewReader(`{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}`)
client := &http.Client {
}
@@ -436,19 +309,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
})
response = https.request(request)
puts response.read_body
@@ -459,19 +320,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/routes")
@@ -498,19 +347,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -531,40 +368,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacdk86lnnboviihd7g",
"network_type": "IPv4",
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/Route"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"network_type": "string",
"description": "string",
"network_id": "string",
"enabled": "boolean",
"peer": "string",
"peer_groups": [
"string"
],
"network": "string",
"metric": "integer",
"masquerade": "boolean",
"groups": [
"string"
]
"$ref": "#/components/schemas/Route"
}
```
</CodeGroup>
@@ -743,40 +552,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacdk86lnnboviihd7g",
"network_type": "IPv4",
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/Route"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"network_type": "string",
"description": "string",
"network_id": "string",
"enabled": "boolean",
"peer": "string",
"peer_groups": [
"string"
],
"network": "string",
"metric": "integer",
"masquerade": "boolean",
"groups": [
"string"
]
"$ref": "#/components/schemas/Route"
}
```
</CodeGroup>
@@ -801,58 +582,7 @@ echo $response;
The unique identifier of a route
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="description" type="string" required={true}>
Route description
</Property>
<Property name="network_id" type="string" required={true} minLen={1} maxLen={40}>
Route network identifier, to group HA routes
</Property>
<Property name="enabled" type="boolean" required={true}>
Route status
</Property>
<Property name="peer" type="string" required={false}>
Peer Identifier associated with route. This property can not be set together with `peer_groups`
</Property>
<Property name="peer_groups" type="string[]" required={false}>
Peers Group Identifier associated with route. This property can not be set together with `peer`
</Property>
<Property name="network" type="string" required={true}>
Network range in CIDR format
</Property>
<Property name="metric" type="integer" required={true} min={1} max={9999}>
Route metric number. Lowest number has higher priority
</Property>
<Property name="masquerade" type="boolean" required={true}>
Indicate if peer should masquerade traffic to this route's prefix
</Property>
<Property name="groups" type="string[]" required={true}>
Group IDs containing routing peers
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/routes/{routeId}">
@@ -862,38 +592,14 @@ curl -X PUT https://api.netbird.io/api/routes/{routeId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
});
let config = {
method: 'put',
@@ -922,19 +628,7 @@ import json
url = "https://api.netbird.io/api/routes/{routeId}"
payload = json.dumps({
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -963,19 +657,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}`)
client := &http.Client {
}
@@ -1022,19 +704,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
})
response = https.request(request)
puts response.read_body
@@ -1045,19 +715,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/routes/{routeId}")
@@ -1084,19 +742,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/RouteRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -1117,40 +763,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "chacdk86lnnboviihd7g",
"network_type": "IPv4",
"description": "My first route",
"network_id": "Route 1",
"enabled": true,
"peer": "chacbco6lnnbn6cg5s91",
"peer_groups": [
"chacbco6lnnbn6cg5s91"
],
"network": "10.64.0.0/24",
"metric": 9999,
"masquerade": true,
"groups": [
"chacdk86lnnboviihd70"
]
"$ref": "#/components/schemas/Route"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"network_type": "string",
"description": "string",
"network_id": "string",
"enabled": "boolean",
"peer": "string",
"peer_groups": [
"string"
],
"network": "string",
"metric": "integer",
"masquerade": "boolean",
"groups": [
"string"
]
"$ref": "#/components/schemas/Route"
}
```
</CodeGroup>

View File

@@ -160,58 +160,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "ch8i4ug6lnn4g9hqv7mg",
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"destinations": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
]
{
"items": {
"$ref": "#/components/schemas/Rule"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"name": "string",
"description": "string",
"disabled": "boolean",
"flow": "string",
"sources": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"destinations": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
]
{
"items": {
"$ref": "#/components/schemas/Rule"
}
]
}
```
</CodeGroup>
@@ -227,43 +187,7 @@ echo $response;
<Row>
<Col>
Creates a rule. This will be deprecated in favour of `/api/policies`.
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Rule name identifier
</Property>
<Property name="description" type="string" required={true}>
Rule friendly description
</Property>
<Property name="disabled" type="boolean" required={true}>
Rules status
</Property>
<Property name="flow" type="string" required={true}>
Rule flow, currently, only "bidirect" for bi-directional traffic is accepted
</Property>
<Property name="sources" type="string[]" required={false}>
List of source group IDs
</Property>
<Property name="destinations" type="string[]" required={false}>
List of destination group IDs
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/rules">
@@ -273,32 +197,14 @@ curl -X POST https://api.netbird.io/api/rules \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
});
let config = {
method: 'post',
@@ -327,16 +233,7 @@ import json
url = "https://api.netbird.io/api/rules"
payload = json.dumps({
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -365,16 +262,7 @@ func main() {
method := "POST"
payload := strings.NewReader(`{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}`)
client := &http.Client {
}
@@ -421,16 +309,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
})
response = https.request(request)
puts response.read_body
@@ -441,16 +320,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/rules")
@@ -477,16 +347,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -507,52 +368,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7mg",
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"destinations": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
]
"$ref": "#/components/schemas/Rule"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"description": "string",
"disabled": "boolean",
"flow": "string",
"sources": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"destinations": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
]
"$ref": "#/components/schemas/Rule"
}
```
</CodeGroup>
@@ -731,52 +552,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7mg",
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"destinations": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
]
"$ref": "#/components/schemas/Rule"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"description": "string",
"disabled": "boolean",
"flow": "string",
"sources": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"destinations": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
]
"$ref": "#/components/schemas/Rule"
}
```
</CodeGroup>
@@ -801,43 +582,7 @@ echo $response;
The unique identifier of a rule
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Rule name identifier
</Property>
<Property name="description" type="string" required={true}>
Rule friendly description
</Property>
<Property name="disabled" type="boolean" required={true}>
Rules status
</Property>
<Property name="flow" type="string" required={true}>
Rule flow, currently, only "bidirect" for bi-directional traffic is accepted
</Property>
<Property name="sources" type="string[]" required={false}>
List of source group IDs
</Property>
<Property name="destinations" type="string[]" required={false}>
List of destination group IDs
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/rules/{ruleId}">
@@ -847,32 +592,14 @@ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
});
let config = {
method: 'put',
@@ -901,16 +628,7 @@ import json
url = "https://api.netbird.io/api/rules/{ruleId}"
payload = json.dumps({
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -939,16 +657,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}`)
client := &http.Client {
}
@@ -995,16 +704,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
})
response = https.request(request)
puts response.read_body
@@ -1015,16 +715,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/rules/{ruleId}")
@@ -1051,16 +742,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
"ch8i4ug6lnn4g9hqv7m1"
],
"destinations": [
"ch8i4ug6lnn4g9hqv7m0"
]
"$ref": "#/components/schemas/RuleRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -1081,52 +763,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i4ug6lnn4g9hqv7mg",
"name": "Default",
"description": "This is a default rule that allows connections between all the resources",
"disabled": false,
"flow": "bidirect",
"sources": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
],
"destinations": [
{
"id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs",
"peers_count": 2,
"issued": "api"
}
]
"$ref": "#/components/schemas/Rule"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"description": "string",
"disabled": "boolean",
"flow": "string",
"sources": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
],
"destinations": [
{
"id": "string",
"name": "string",
"peers_count": "integer",
"issued": "string"
}
]
"$ref": "#/components/schemas/Rule"
}
```
</CodeGroup>

View File

@@ -160,48 +160,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": 2531583362,
"key": "A616097E-FCF0-48FA-9354-CA4A61142761",
"name": "Default key",
"expires": "2023-06-01T14:47:22.291057Z",
"type": "reusable",
"valid": true,
"revoked": false,
"used_times": 2,
"last_used": "2023-05-05T09:00:35.477782Z",
"state": "valid",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"updated_at": "2023-05-05T09:00:35.477782Z",
"usage_limit": 0,
"ephemeral": true
{
"items": {
"$ref": "#/components/schemas/SetupKey"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"key": "string",
"name": "string",
"expires": "string",
"type": "string",
"valid": "boolean",
"revoked": "boolean",
"used_times": "integer",
"last_used": "string",
"state": "string",
"auto_groups": [
"string"
],
"updated_at": "string",
"usage_limit": "integer",
"ephemeral": "boolean"
{
"items": {
"$ref": "#/components/schemas/SetupKey"
}
]
}
```
</CodeGroup>
@@ -217,48 +187,7 @@ echo $response;
<Row>
<Col>
Creates a setup key
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Setup Key name
</Property>
<Property name="type" type="string" required={true}>
Setup key type, one-off for single time usage and reusable
</Property>
<Property name="expires_in" type="integer" required={true} min={86400} max={31536000}>
Expiration time in seconds
</Property>
<Property name="revoked" type="boolean" required={true}>
Setup key revocation status
</Property>
<Property name="auto_groups" type="string[]" required={true}>
List of group IDs to auto-assign to peers registered with this key
</Property>
<Property name="usage_limit" type="integer" required={true}>
A number of times this key can be used. The value of 0 indicates the unlimited usage.
</Property>
<Property name="ephemeral" type="boolean" required={false}>
Indicate that the peer will be ephemeral or not
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/setup-keys">
@@ -268,30 +197,14 @@ curl -X POST https://api.netbird.io/api/setup-keys \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
});
let config = {
method: 'post',
@@ -320,15 +233,7 @@ import json
url = "https://api.netbird.io/api/setup-keys"
payload = json.dumps({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -357,15 +262,7 @@ func main() {
method := "POST"
payload := strings.NewReader(`{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}`)
client := &http.Client {
}
@@ -412,15 +309,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
})
response = https.request(request)
puts response.read_body
@@ -431,15 +320,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/setup-keys")
@@ -466,15 +347,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -495,42 +368,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": 2531583362,
"key": "A616097E-FCF0-48FA-9354-CA4A61142761",
"name": "Default key",
"expires": "2023-06-01T14:47:22.291057Z",
"type": "reusable",
"valid": true,
"revoked": false,
"used_times": 2,
"last_used": "2023-05-05T09:00:35.477782Z",
"state": "valid",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"updated_at": "2023-05-05T09:00:35.477782Z",
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKey"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"key": "string",
"name": "string",
"expires": "string",
"type": "string",
"valid": "boolean",
"revoked": "boolean",
"used_times": "integer",
"last_used": "string",
"state": "string",
"auto_groups": [
"string"
],
"updated_at": "string",
"usage_limit": "integer",
"ephemeral": "boolean"
"$ref": "#/components/schemas/SetupKey"
}
```
</CodeGroup>
@@ -709,42 +552,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": 2531583362,
"key": "A616097E-FCF0-48FA-9354-CA4A61142761",
"name": "Default key",
"expires": "2023-06-01T14:47:22.291057Z",
"type": "reusable",
"valid": true,
"revoked": false,
"used_times": 2,
"last_used": "2023-05-05T09:00:35.477782Z",
"state": "valid",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"updated_at": "2023-05-05T09:00:35.477782Z",
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKey"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"key": "string",
"name": "string",
"expires": "string",
"type": "string",
"valid": "boolean",
"revoked": "boolean",
"used_times": "integer",
"last_used": "string",
"state": "string",
"auto_groups": [
"string"
],
"updated_at": "string",
"usage_limit": "integer",
"ephemeral": "boolean"
"$ref": "#/components/schemas/SetupKey"
}
```
</CodeGroup>
@@ -769,48 +582,7 @@ echo $response;
The unique identifier of a setup key
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Setup Key name
</Property>
<Property name="type" type="string" required={true}>
Setup key type, one-off for single time usage and reusable
</Property>
<Property name="expires_in" type="integer" required={true} min={86400} max={31536000}>
Expiration time in seconds
</Property>
<Property name="revoked" type="boolean" required={true}>
Setup key revocation status
</Property>
<Property name="auto_groups" type="string[]" required={true}>
List of group IDs to auto-assign to peers registered with this key
</Property>
<Property name="usage_limit" type="integer" required={true}>
A number of times this key can be used. The value of 0 indicates the unlimited usage.
</Property>
<Property name="ephemeral" type="boolean" required={false}>
Indicate that the peer will be ephemeral or not
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/setup-keys/{keyId}">
@@ -820,30 +592,14 @@ curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
});
let config = {
method: 'put',
@@ -872,15 +628,7 @@ import json
url = "https://api.netbird.io/api/setup-keys/{keyId}"
payload = json.dumps({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -909,15 +657,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}`)
client := &http.Client {
}
@@ -964,15 +704,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
})
response = https.request(request)
puts response.read_body
@@ -983,15 +715,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/setup-keys/{keyId}")
@@ -1018,15 +742,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKeyRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -1047,42 +763,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": 2531583362,
"key": "A616097E-FCF0-48FA-9354-CA4A61142761",
"name": "Default key",
"expires": "2023-06-01T14:47:22.291057Z",
"type": "reusable",
"valid": true,
"revoked": false,
"used_times": 2,
"last_used": "2023-05-05T09:00:35.477782Z",
"state": "valid",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"updated_at": "2023-05-05T09:00:35.477782Z",
"usage_limit": 0,
"ephemeral": true
"$ref": "#/components/schemas/SetupKey"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"key": "string",
"name": "string",
"expires": "string",
"type": "string",
"valid": "boolean",
"revoked": "boolean",
"used_times": "integer",
"last_used": "string",
"state": "string",
"auto_groups": [
"string"
],
"updated_at": "string",
"usage_limit": "integer",
"ephemeral": "boolean"
"$ref": "#/components/schemas/SetupKey"
}
```
</CodeGroup>

View File

@@ -168,28 +168,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "ch8i54g6lnn4g9hqv7n0",
"name": "My first token",
"expiration_date": "2023-05-05T14:38:28.977616Z",
"created_by": "google-oauth2|277474792786460067937",
"created_at": "2023-05-02T14:48:20.465209Z",
"last_used": "2023-05-04T12:45:25.9723616Z"
{
"items": {
"$ref": "#/components/schemas/PersonalAccessToken"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"name": "string",
"expiration_date": "string",
"created_by": "string",
"created_at": "string",
"last_used": "string"
{
"items": {
"$ref": "#/components/schemas/PersonalAccessToken"
}
]
}
```
</CodeGroup>
@@ -213,23 +203,7 @@ echo $response;
The unique identifier of a user
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Name of the token
</Property>
<Property name="expires_in" type="integer" required={true} min={1} max={365}>
Expiration in days
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/users/{userId}/tokens">
@@ -239,16 +213,14 @@ curl -X POST https://api.netbird.io/api/users/{userId}/tokens \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
});
let config = {
method: 'post',
@@ -277,8 +249,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}/tokens"
payload = json.dumps({
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -307,8 +278,7 @@ func main() {
method := "POST"
payload := strings.NewReader(`{
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
}`)
client := &http.Client {
}
@@ -355,8 +325,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
})
response = https.request(request)
puts response.read_body
@@ -367,8 +336,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users/{userId}/tokens")
@@ -395,8 +363,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"name": "My first token",
"expires_in": 30
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -417,28 +384,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"plain_token": {},
"personal_access_token": {
"id": "ch8i54g6lnn4g9hqv7n0",
"name": "My first token",
"expiration_date": "2023-05-05T14:38:28.977616Z",
"created_by": "google-oauth2|277474792786460067937",
"created_at": "2023-05-02T14:48:20.465209Z",
"last_used": "2023-05-04T12:45:25.9723616Z"
}
"$ref": "#/components/schemas/PersonalAccessTokenGenerated"
}
```
```json {{ title: 'Schema' }}
{
"plain_token": "string",
"personal_access_token": {
"id": "string",
"name": "string",
"expiration_date": "string",
"created_by": "string",
"created_at": "string",
"last_used": "string"
}
"$ref": "#/components/schemas/PersonalAccessTokenGenerated"
}
```
</CodeGroup>
@@ -621,22 +572,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "ch8i54g6lnn4g9hqv7n0",
"name": "My first token",
"expiration_date": "2023-05-05T14:38:28.977616Z",
"created_by": "google-oauth2|277474792786460067937",
"created_at": "2023-05-02T14:48:20.465209Z",
"last_used": "2023-05-04T12:45:25.9723616Z"
"$ref": "#/components/schemas/PersonalAccessToken"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"name": "string",
"expiration_date": "string",
"created_by": "string",
"created_at": "string",
"last_used": "string"
"$ref": "#/components/schemas/PersonalAccessToken"
}
```
</CodeGroup>

View File

@@ -11,7 +11,7 @@ export const title = 'Users'
#### Query Parameters
<Properties>
<Property name="service_user" type="boolean" required={false}>
<Property name="service_user" type="" required={false}>
Filters users and returns either regular users or service users
</Property>
</Properties>
@@ -168,42 +168,18 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
[
{
"id": "google-oauth2|277474792786460067937",
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"status": "active",
"last_login": "2023-05-05T09:00:35.477782Z",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_current": true,
"is_service_user": false,
"is_blocked": false,
"issued": "api"
{
"items": {
"$ref": "#/components/schemas/User"
}
]
}
```
```json {{ title: 'Schema' }}
[
{
"id": "string",
"email": "string",
"name": "string",
"role": "string",
"status": "string",
"last_login": "string",
"auto_groups": [
"string"
],
"is_current": "boolean",
"is_service_user": "boolean",
"is_blocked": "boolean",
"issued": "string"
{
"items": {
"$ref": "#/components/schemas/User"
}
]
}
```
</CodeGroup>
@@ -219,38 +195,7 @@ echo $response;
<Row>
<Col>
Creates a new service user or sends an invite to a regular user
#### Request-Body Parameters
<Properties><Property name="email" type="string" required={false}>
User's Email to send invite to
</Property>
<Property name="name" type="string" required={false}>
User's full name
</Property>
<Property name="role" type="string" required={true}>
User's NetBird account role
</Property>
<Property name="auto_groups" type="string[]" required={true}>
Group IDs to auto-assign to peers registered by this user
</Property>
<Property name="is_service_user" type="boolean" required={true}>
Is true if this user is a service user
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/users">
@@ -260,26 +205,14 @@ curl -X POST https://api.netbird.io/api/users \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
});
let config = {
method: 'post',
@@ -308,13 +241,7 @@ import json
url = "https://api.netbird.io/api/users"
payload = json.dumps({
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -343,13 +270,7 @@ func main() {
method := "POST"
payload := strings.NewReader(`{
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
}`)
client := &http.Client {
}
@@ -396,13 +317,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
})
response = https.request(request)
puts response.read_body
@@ -413,13 +328,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users")
@@ -446,13 +355,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_service_user": false
"$ref": "#/components/schemas/UserCreateRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -473,36 +376,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "google-oauth2|277474792786460067937",
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"status": "active",
"last_login": "2023-05-05T09:00:35.477782Z",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_current": true,
"is_service_user": false,
"is_blocked": false,
"issued": "api"
"$ref": "#/components/schemas/User"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"email": "string",
"name": "string",
"role": "string",
"status": "string",
"last_login": "string",
"auto_groups": [
"string"
],
"is_current": "boolean",
"is_service_user": "boolean",
"is_blocked": "boolean",
"issued": "string"
"$ref": "#/components/schemas/User"
}
```
</CodeGroup>
@@ -527,28 +406,7 @@ echo $response;
The unique identifier of a user
</Property>
</Properties>
#### Request-Body Parameters
<Properties><Property name="role" type="string" required={true}>
User's NetBird account role
</Property>
<Property name="auto_groups" type="string[]" required={true}>
Group IDs to auto-assign to peers registered by this user
</Property>
<Property name="is_blocked" type="boolean" required={true}>
If set to true then user is blocked and can't use the system
</Property>
</Properties>
</Col>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="PUT" label="/api/users/{userId}">
@@ -558,22 +416,14 @@ curl -X PUT https://api.netbird.io/api/users/{userId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
});
let config = {
method: 'put',
@@ -602,11 +452,7 @@ import json
url = "https://api.netbird.io/api/users/{userId}"
payload = json.dumps({
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
})
headers: {
'Content-Type': 'application/json',
@@ -635,11 +481,7 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
}`)
client := &http.Client {
}
@@ -686,11 +528,7 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
})
response = https.request(request)
puts response.read_body
@@ -701,11 +539,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users/{userId}")
@@ -732,11 +566,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"role": "admin",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_blocked": false
"$ref": "#/components/schemas/UserRequest"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
@@ -757,36 +587,12 @@ echo $response;
<CodeGroup title="Response">
```json {{ title: 'Example' }}
{
"id": "google-oauth2|277474792786460067937",
"email": "demo@netbird.io",
"name": "Tom Schulz",
"role": "admin",
"status": "active",
"last_login": "2023-05-05T09:00:35.477782Z",
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"is_current": true,
"is_service_user": false,
"is_blocked": false,
"issued": "api"
"$ref": "#/components/schemas/User"
}
```
```json {{ title: 'Schema' }}
{
"id": "string",
"email": "string",
"name": "string",
"role": "string",
"status": "string",
"last_login": "string",
"auto_groups": [
"string"
],
"is_current": "boolean",
"is_service_user": "boolean",
"is_blocked": "boolean",
"issued": "string"
"$ref": "#/components/schemas/User"
}
```
</CodeGroup>