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