mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-17 16:06:36 +00:00
fix the api and disable the automation (#172)
This commit is contained in:
@@ -160,229 +160,44 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Account"
|
||||
[
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Account"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Update an Account {{ tag: 'PUT' , label: '/api/accounts/{accountId}' }}
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
Update information about an account
|
||||
|
||||
#### 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="PUT" label="/api/accounts/{accountId}">
|
||||
```bash {{ title: 'cURL' }}
|
||||
curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
maxBodyLength: Infinity,
|
||||
url: '/api/accounts/{accountId}',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
},
|
||||
data : data
|
||||
};
|
||||
|
||||
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}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
}
|
||||
|
||||
response = requests.request("PUT", url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
url := "https://api.netbird.io/api/accounts/{accountId}"
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
req, err := http.NewRequest(method, url, payload)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
{
|
||||
|
||||
req.Header.Add("Content-Type", "application/json")
|
||||
req.Header.Add("Accept", "application/json")
|
||||
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::Put.new(url)
|
||||
request["Content-Type"] = "application/json"
|
||||
request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
```
|
||||
|
||||
```java
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/accounts/{accountId}")
|
||||
.method("PUT", body)
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.addHeader("Accept", "application/json")
|
||||
.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 => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/AccountRequest"
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Accept: application/json',
|
||||
'Authorization: Token <TOKEN>'
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
echo $response;
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Account"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Account"
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -555,3 +370,389 @@ echo $response;
|
||||
</Row>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Update an Account {{ tag: 'PUT' , label: '/api/accounts/{accountId}' }}
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
Update information about an account
|
||||
|
||||
#### Path Parameters
|
||||
<Properties>
|
||||
|
||||
<Property name="accountId" type="string" required={true}>
|
||||
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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/accounts/{accountId}">
|
||||
```bash {{ title: 'cURL' }}
|
||||
curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
|
||||
-H 'Accept: application/json' \
|
||||
-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
|
||||
}
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
```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
|
||||
}
|
||||
}
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
maxBodyLength: Infinity,
|
||||
url: '/api/accounts/{accountId}',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
},
|
||||
data : data
|
||||
};
|
||||
|
||||
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}"
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
}
|
||||
|
||||
response = requests.request("PUT", url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
url := "https://api.netbird.io/api/accounts/{accountId}"
|
||||
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
|
||||
}
|
||||
}
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
req, err := http.NewRequest(method, url, payload)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
{
|
||||
|
||||
req.Header.Add("Content-Type", "application/json")
|
||||
req.Header.Add("Accept", "application/json")
|
||||
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::Put.new(url)
|
||||
request["Content-Type"] = "application/json"
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
```
|
||||
|
||||
```java
|
||||
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
|
||||
}
|
||||
}
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/accounts/{accountId}")
|
||||
.method("PUT", body)
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.addHeader("Accept", "application/json")
|
||||
.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 => '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
|
||||
}
|
||||
}
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Accept: application/json',
|
||||
'Authorization: Token <TOKEN>'
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
echo $response;
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
<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
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```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"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
---
|
||||
|
||||
@@ -160,18 +160,54 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
[
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -187,7 +223,75 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a Nameserver Group
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/dns/nameservers">
|
||||
@@ -197,14 +301,48 @@ curl -X POST https://api.netbird.io/api/dns/nameservers \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -233,7 +371,24 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/dns/nameservers"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -262,7 +417,24 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -309,7 +481,24 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -320,7 +509,24 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/dns/nameservers")
|
||||
@@ -347,7 +553,24 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -368,12 +591,48 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
"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
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -552,12 +811,48 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
"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
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -582,7 +877,75 @@ echo $response;
|
||||
The unique identifier of a Nameserver Group
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/dns/nameservers/{nsgroupId}">
|
||||
@@ -592,14 +955,48 @@ curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -628,7 +1025,24 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/dns/nameservers/{nsgroupId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -657,7 +1071,24 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -704,7 +1135,24 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -715,7 +1163,24 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
|
||||
@@ -742,7 +1207,24 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/NameserverGroupRequest"
|
||||
"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
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -763,12 +1245,48 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
"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
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/NameserverGroup"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -1104,14 +1622,18 @@ echo $response;
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1129,7 +1651,18 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Updates a DNS settings object
|
||||
</Col>
|
||||
|
||||
#### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="disabled_management_groups" type="string[]" required={true}>
|
||||
|
||||
Groups whose DNS management is disabled
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/dns/settings">
|
||||
@@ -1139,14 +1672,18 @@ curl -X PUT https://api.netbird.io/api/dns/settings \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -1175,7 +1712,9 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/dns/settings"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -1204,7 +1743,9 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -1251,7 +1792,9 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -1262,7 +1805,9 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/dns/settings")
|
||||
@@ -1289,7 +1834,9 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -1310,12 +1857,16 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/DNSSettings"
|
||||
"disabled_management_groups": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -160,18 +160,47 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
@@ -160,16 +160,14 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": "DE"
|
||||
}
|
||||
[
|
||||
"DE"
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"example": "DE"
|
||||
}
|
||||
}
|
||||
[
|
||||
"string"
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -347,12 +345,14 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/City"
|
||||
"geoname_id": 2950158,
|
||||
"city_name": "Berlin"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/City"
|
||||
"geoname_id": "integer",
|
||||
"city_name": "string"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -160,18 +160,36 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Group"
|
||||
[
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Group"
|
||||
[
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -187,7 +205,23 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a group
|
||||
</Col>
|
||||
|
||||
#### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Group name identifier
|
||||
|
||||
</Property>
|
||||
<Property name="peers" type="string[]" required={false}>
|
||||
|
||||
List of peers ids
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/groups">
|
||||
@@ -197,14 +231,20 @@ curl -X POST https://api.netbird.io/api/groups \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -233,7 +273,10 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/groups"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -262,7 +305,10 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -309,7 +355,10 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -320,7 +369,10 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/groups")
|
||||
@@ -347,7 +399,10 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -368,12 +423,30 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Group"
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Group"
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -552,12 +625,30 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Group"
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Group"
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -582,7 +673,23 @@ echo $response;
|
||||
The unique identifier of a group
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Group name identifier
|
||||
|
||||
</Property>
|
||||
<Property name="peers" type="string[]" required={false}>
|
||||
|
||||
List of peers ids
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/groups/{groupId}">
|
||||
@@ -592,14 +699,20 @@ curl -X PUT https://api.netbird.io/api/groups/{groupId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -628,7 +741,10 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/groups/{groupId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -657,7 +773,10 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -704,7 +823,10 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -715,7 +837,10 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/groups/{groupId}")
|
||||
@@ -742,7 +867,10 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/GroupRequest"
|
||||
"name": "devs",
|
||||
"peers": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -763,12 +891,30 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Group"
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
"name": "devs",
|
||||
"peers_count": 2,
|
||||
"issued": "api",
|
||||
"peers": [
|
||||
{
|
||||
"id": "chacbco6lnnbn6cg5s90",
|
||||
"name": "stage-host-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Group"
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"peers_count": "integer",
|
||||
"issued": "string",
|
||||
"peers": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -160,18 +160,76 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/PeerBatch"
|
||||
[
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/PeerBatch"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -349,12 +407,86 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Peer"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Peer"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -379,7 +511,33 @@ echo $response;
|
||||
The unique identifier of a peer
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/peers/{peerId}">
|
||||
@@ -389,14 +547,20 @@ curl -X PUT https://api.netbird.io/api/peers/{peerId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -425,7 +589,10 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/peers/{peerId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -454,7 +621,10 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -501,7 +671,10 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -512,7 +685,10 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/peers/{peerId}")
|
||||
@@ -539,7 +715,10 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/PeerRequest"
|
||||
"name": "stage-host-1",
|
||||
"ssh_enabled": true,
|
||||
"login_expiration_enabled": false,
|
||||
"approval_required": true
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -560,12 +739,86 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Peer"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Peer"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -160,18 +160,46 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Route"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Route"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -187,7 +215,58 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a Route
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/routes">
|
||||
@@ -197,14 +276,38 @@ curl -X POST https://api.netbird.io/api/routes \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -233,7 +336,19 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/routes"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -262,7 +377,19 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -309,7 +436,19 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -320,7 +459,19 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/routes")
|
||||
@@ -347,7 +498,19 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -368,12 +531,40 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Route"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Route"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -552,12 +743,40 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Route"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Route"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -582,7 +801,58 @@ echo $response;
|
||||
The unique identifier of a route
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/routes/{routeId}">
|
||||
@@ -592,14 +862,38 @@ curl -X PUT https://api.netbird.io/api/routes/{routeId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -628,7 +922,19 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/routes/{routeId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -657,7 +963,19 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -704,7 +1022,19 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -715,7 +1045,19 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/routes/{routeId}")
|
||||
@@ -742,7 +1084,19 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/RouteRequest"
|
||||
"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"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -763,12 +1117,40 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Route"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Route"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -160,18 +160,58 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -187,7 +227,43 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a rule. This will be deprecated in favour of `/api/policies`.
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/rules">
|
||||
@@ -197,14 +273,32 @@ curl -X POST https://api.netbird.io/api/rules \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -233,7 +327,16 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/rules"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -262,7 +365,16 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -309,7 +421,16 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -320,7 +441,16 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/rules")
|
||||
@@ -347,7 +477,16 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -368,12 +507,52 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -552,12 +731,52 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -582,7 +801,43 @@ echo $response;
|
||||
The unique identifier of a rule
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/rules/{ruleId}">
|
||||
@@ -592,14 +847,32 @@ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -628,7 +901,16 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/rules/{ruleId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -657,7 +939,16 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -704,7 +995,16 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -715,7 +1015,16 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/rules/{ruleId}")
|
||||
@@ -742,7 +1051,16 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/RuleRequest"
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -763,12 +1081,52 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/Rule"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -160,18 +160,48 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
[
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -187,7 +217,48 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a setup key
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/setup-keys">
|
||||
@@ -197,14 +268,30 @@ curl -X POST https://api.netbird.io/api/setup-keys \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -233,7 +320,15 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/setup-keys"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -262,7 +357,15 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -309,7 +412,15 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -320,7 +431,15 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/setup-keys")
|
||||
@@ -347,7 +466,15 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -368,12 +495,42 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
"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
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -552,12 +709,42 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
"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
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -582,7 +769,48 @@ echo $response;
|
||||
The unique identifier of a setup key
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/setup-keys/{keyId}">
|
||||
@@ -592,14 +820,30 @@ curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -628,7 +872,15 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/setup-keys/{keyId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -657,7 +909,15 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -704,7 +964,15 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -715,7 +983,15 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/setup-keys/{keyId}")
|
||||
@@ -742,7 +1018,15 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/SetupKeyRequest"
|
||||
"name": "Default key",
|
||||
"type": "reusable",
|
||||
"expires_in": 86400,
|
||||
"revoked": false,
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"usage_limit": 0,
|
||||
"ephemeral": true
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -763,12 +1047,42 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
"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
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/SetupKey"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -168,18 +168,28 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/PersonalAccessToken"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/PersonalAccessToken"
|
||||
[
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"expiration_date": "string",
|
||||
"created_by": "string",
|
||||
"created_at": "string",
|
||||
"last_used": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -203,7 +213,23 @@ echo $response;
|
||||
The unique identifier of a user
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/users/{userId}/tokens">
|
||||
@@ -213,14 +239,16 @@ curl -X POST https://api.netbird.io/api/users/{userId}/tokens \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -249,7 +277,8 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/users/{userId}/tokens"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -278,7 +307,8 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -325,7 +355,8 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -336,7 +367,8 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/users/{userId}/tokens")
|
||||
@@ -363,7 +395,8 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenRequest"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -384,12 +417,28 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenGenerated"
|
||||
"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"
|
||||
}
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/PersonalAccessTokenGenerated"
|
||||
"plain_token": "string",
|
||||
"personal_access_token": {
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"expiration_date": "string",
|
||||
"created_by": "string",
|
||||
"created_at": "string",
|
||||
"last_used": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -572,12 +621,22 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/PersonalAccessToken"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/PersonalAccessToken"
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"expiration_date": "string",
|
||||
"created_by": "string",
|
||||
"created_at": "string",
|
||||
"last_used": "string"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const title = 'Users'
|
||||
#### Query Parameters
|
||||
<Properties>
|
||||
|
||||
<Property name="service_user" type="" required={false}>
|
||||
<Property name="service_user" type="boolean" required={false}>
|
||||
Filters users and returns either regular users or service users
|
||||
</Property>
|
||||
</Properties>
|
||||
@@ -168,18 +168,42 @@ echo $response;
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/User"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/User"
|
||||
[
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -195,7 +219,38 @@ echo $response;
|
||||
<Row>
|
||||
<Col>
|
||||
Creates a new service user or sends an invite to a regular user
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/users">
|
||||
@@ -205,14 +260,26 @@ curl -X POST https://api.netbird.io/api/users \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -241,7 +308,13 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/users"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -270,7 +343,13 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -317,7 +396,13 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -328,7 +413,13 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/users")
|
||||
@@ -355,7 +446,13 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/UserCreateRequest"
|
||||
"email": "demo@netbird.io",
|
||||
"name": "Tom Schulz",
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_service_user": false
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -376,12 +473,36 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/User"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/User"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
@@ -406,7 +527,28 @@ echo $response;
|
||||
The unique identifier of a user
|
||||
</Property>
|
||||
</Properties>
|
||||
</Col>
|
||||
|
||||
#### 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 sticky>
|
||||
<CodeGroup title="Request" tag="PUT" label="/api/users/{userId}">
|
||||
@@ -416,14 +558,22 @@ curl -X PUT https://api.netbird.io/api/users/{userId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -452,7 +602,11 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/users/{userId}"
|
||||
payload = json.dumps({
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
})
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -481,7 +635,11 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -528,7 +686,11 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -539,7 +701,11 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/users/{userId}")
|
||||
@@ -566,7 +732,11 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"$ref": "#/components/schemas/UserRequest"
|
||||
"role": "admin",
|
||||
"auto_groups": [
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
],
|
||||
"is_blocked": false
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
@@ -587,12 +757,36 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/User"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"$ref": "#/components/schemas/User"
|
||||
"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"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
Reference in New Issue
Block a user