mirror of
https://github.com/netbirdio/docs.git
synced 2026-10-29 07:59:05 +01:00
Update API pages with v0.45.2
This commit is contained in:
@@ -181,7 +181,8 @@ echo $response;
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
},
|
},
|
||||||
"domain": "netbird.io",
|
"domain": "netbird.io",
|
||||||
"domain_category": "private",
|
"domain_category": "private",
|
||||||
@@ -212,7 +213,8 @@ echo $response;
|
|||||||
"peer_approval_enabled": "boolean",
|
"peer_approval_enabled": "boolean",
|
||||||
"network_traffic_logs_enabled": "boolean",
|
"network_traffic_logs_enabled": "boolean",
|
||||||
"network_traffic_packet_counter_enabled": "boolean"
|
"network_traffic_packet_counter_enabled": "boolean"
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": "boolean"
|
||||||
},
|
},
|
||||||
"domain": "string",
|
"domain": "string",
|
||||||
"domain_category": "string",
|
"domain_category": "string",
|
||||||
@@ -497,6 +499,11 @@ echo $response;
|
|||||||
</Properties>
|
</Properties>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
</Property>
|
||||||
|
<Property name="lazy_connection_enabled" type="boolean" required={false}>
|
||||||
|
|
||||||
|
Enables or disables experimental lazy connection
|
||||||
|
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
@@ -535,7 +542,8 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
@@ -561,7 +569,8 @@ let data = JSON.stringify({
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let config = {
|
let config = {
|
||||||
@@ -609,7 +618,8 @@ payload = json.dumps({
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
headers = {
|
headers = {
|
||||||
@@ -657,7 +667,8 @@ func main() {
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
}`)
|
}`)
|
||||||
client := &http.Client {
|
client := &http.Client {
|
||||||
@@ -723,7 +734,8 @@ request.body = JSON.dump({
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
response = https.request(request)
|
response = https.request(request)
|
||||||
@@ -753,7 +765,8 @@ RequestBody body = RequestBody.create(mediaType, '{
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
}');
|
}');
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
@@ -799,7 +812,8 @@ curl_setopt_array($curl, array(
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
}
|
}
|
||||||
}',
|
}',
|
||||||
CURLOPT_HTTPHEADER => array(
|
CURLOPT_HTTPHEADER => array(
|
||||||
@@ -840,7 +854,8 @@ echo $response;
|
|||||||
"peer_approval_enabled": true,
|
"peer_approval_enabled": true,
|
||||||
"network_traffic_logs_enabled": true,
|
"network_traffic_logs_enabled": true,
|
||||||
"network_traffic_packet_counter_enabled": true
|
"network_traffic_packet_counter_enabled": true
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": true
|
||||||
},
|
},
|
||||||
"domain": "netbird.io",
|
"domain": "netbird.io",
|
||||||
"domain_category": "private",
|
"domain_category": "private",
|
||||||
@@ -869,7 +884,8 @@ echo $response;
|
|||||||
"peer_approval_enabled": "boolean",
|
"peer_approval_enabled": "boolean",
|
||||||
"network_traffic_logs_enabled": "boolean",
|
"network_traffic_logs_enabled": "boolean",
|
||||||
"network_traffic_packet_counter_enabled": "boolean"
|
"network_traffic_packet_counter_enabled": "boolean"
|
||||||
}
|
},
|
||||||
|
"lazy_connection_enabled": "boolean"
|
||||||
},
|
},
|
||||||
"domain": "string",
|
"domain": "string",
|
||||||
"domain_category": "string",
|
"domain_category": "string",
|
||||||
|
|||||||
@@ -232,6 +232,10 @@ echo $response;
|
|||||||
Filter by user ID
|
Filter by user ID
|
||||||
</Property>
|
</Property>
|
||||||
|
|
||||||
|
<Property name="reporter_id" type="string" required={false}>
|
||||||
|
Filter by reporter ID
|
||||||
|
</Property>
|
||||||
|
|
||||||
<Property name="protocol" type="integer" required={false}>
|
<Property name="protocol" type="integer" required={false}>
|
||||||
Filter by protocol
|
Filter by protocol
|
||||||
</Property>
|
</Property>
|
||||||
@@ -249,7 +253,7 @@ echo $response;
|
|||||||
</Property>
|
</Property>
|
||||||
|
|
||||||
<Property name="search" type="string" required={false}>
|
<Property name="search" type="string" required={false}>
|
||||||
Filters events with a partial match on user email, source and destination names and source and destination addresses
|
Case-insensitive partial match on user email, source/destination names, and source/destination addresses
|
||||||
</Property>
|
</Property>
|
||||||
|
|
||||||
<Property name="start_date" type="string" required={false}>
|
<Property name="start_date" type="string" required={false}>
|
||||||
@@ -416,11 +420,8 @@ echo $response;
|
|||||||
{
|
{
|
||||||
"data": [
|
"data": [
|
||||||
{
|
{
|
||||||
"id": "18e204d6-f7c6-405d-8025-70becb216add",
|
|
||||||
"flow_id": "61092452-b17c-4b14-b7cf-a2158c549826",
|
"flow_id": "61092452-b17c-4b14-b7cf-a2158c549826",
|
||||||
"reporter_id": "ch8i4ug6lnn4g9hqv7m0",
|
"reporter_id": "ch8i4ug6lnn4g9hqv7m0",
|
||||||
"timestamp": "2025-03-20T16:23:58.125397Z",
|
|
||||||
"receive_timestamp": "2025-03-20T16:23:58.125397Z",
|
|
||||||
"source": {
|
"source": {
|
||||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||||
"type": "PEER",
|
"type": "PEER",
|
||||||
@@ -433,9 +434,6 @@ echo $response;
|
|||||||
"address": "100.64.0.10:51820",
|
"address": "100.64.0.10:51820",
|
||||||
"dns_label": "*.mydomain.com"
|
"dns_label": "*.mydomain.com"
|
||||||
},
|
},
|
||||||
"user_id": "google-oauth2|123456789012345678901",
|
|
||||||
"user_email": "alice@netbird.io",
|
|
||||||
"user_name": "Alice Smith",
|
|
||||||
"destination": {
|
"destination": {
|
||||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||||
"type": "PEER",
|
"type": "PEER",
|
||||||
@@ -448,17 +446,31 @@ echo $response;
|
|||||||
"address": "100.64.0.10:51820",
|
"address": "100.64.0.10:51820",
|
||||||
"dns_label": "*.mydomain.com"
|
"dns_label": "*.mydomain.com"
|
||||||
},
|
},
|
||||||
|
"user": {
|
||||||
|
"id": "google-oauth2|123456789012345678901",
|
||||||
|
"email": "alice@netbird.io",
|
||||||
|
"name": "Alice Smith"
|
||||||
|
},
|
||||||
|
"policy": {
|
||||||
|
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||||
|
"name": "All to All"
|
||||||
|
},
|
||||||
|
"icmp": {
|
||||||
|
"type": 8,
|
||||||
|
"code": 0
|
||||||
|
},
|
||||||
"protocol": 6,
|
"protocol": 6,
|
||||||
"type": "TYPE_START",
|
|
||||||
"direction": "INGRESS",
|
"direction": "INGRESS",
|
||||||
"rx_bytes": 1234,
|
"rx_bytes": 1234,
|
||||||
"rx_packets": 5,
|
"rx_packets": 5,
|
||||||
"tx_bytes": 1234,
|
"tx_bytes": 1234,
|
||||||
"tx_packets": 5,
|
"tx_packets": 5,
|
||||||
"policy_id": "ch8i4ug6lnn4g9hqv7m0",
|
"events": [
|
||||||
"policy_name": "All to All",
|
{
|
||||||
"icmp_type": 8,
|
"type": "TYPE_START",
|
||||||
"icmp_code": 0
|
"timestamp": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"page": {
|
"page": {
|
||||||
@@ -483,11 +495,8 @@ echo $response;
|
|||||||
{
|
{
|
||||||
"data": [
|
"data": [
|
||||||
{
|
{
|
||||||
"id": "string",
|
|
||||||
"flow_id": "string",
|
"flow_id": "string",
|
||||||
"reporter_id": "string",
|
"reporter_id": "string",
|
||||||
"timestamp": "string",
|
|
||||||
"receive_timestamp": "string",
|
|
||||||
"source": {
|
"source": {
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -500,9 +509,6 @@ echo $response;
|
|||||||
"address": "string",
|
"address": "string",
|
||||||
"dns_label": "string"
|
"dns_label": "string"
|
||||||
},
|
},
|
||||||
"user_id": "string",
|
|
||||||
"user_email": "string",
|
|
||||||
"user_name": "string",
|
|
||||||
"destination": {
|
"destination": {
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -515,17 +521,31 @@ echo $response;
|
|||||||
"address": "string",
|
"address": "string",
|
||||||
"dns_label": "string"
|
"dns_label": "string"
|
||||||
},
|
},
|
||||||
|
"user": {
|
||||||
|
"id": "string",
|
||||||
|
"email": "string",
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"policy": {
|
||||||
|
"id": "string",
|
||||||
|
"name": "string"
|
||||||
|
},
|
||||||
|
"icmp": {
|
||||||
|
"type": "integer",
|
||||||
|
"code": "integer"
|
||||||
|
},
|
||||||
"protocol": "integer",
|
"protocol": "integer",
|
||||||
"type": "string",
|
|
||||||
"direction": "string",
|
"direction": "string",
|
||||||
"rx_bytes": "integer",
|
"rx_bytes": "integer",
|
||||||
"rx_packets": "integer",
|
"rx_packets": "integer",
|
||||||
"tx_bytes": "integer",
|
"tx_bytes": "integer",
|
||||||
"tx_packets": "integer",
|
"tx_packets": "integer",
|
||||||
"policy_id": "string",
|
"events": [
|
||||||
"policy_name": "string",
|
{
|
||||||
"icmp_type": "integer",
|
"type": "string",
|
||||||
"icmp_code": "integer"
|
"timestamp": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"page": "integer",
|
"page": "integer",
|
||||||
|
|||||||
@@ -3484,3 +3484,197 @@ echo $response;
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## List all Network Routers {{ tag: 'GET' , label: '/api/networks/routers' }}
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<Col>
|
||||||
|
Returns a list of all routers in a network
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col sticky>
|
||||||
|
<CodeGroup title="Request" tag="GET" label="/api/networks/routers">
|
||||||
|
```bash {{ title: 'cURL' }}
|
||||||
|
curl -X GET https://api.netbird.io/api/networks/routers \
|
||||||
|
-H 'Accept: application/json' \
|
||||||
|
-H 'Authorization: Token <TOKEN>'
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
const axios = require('axios');
|
||||||
|
|
||||||
|
let config = {
|
||||||
|
method: 'get',
|
||||||
|
maxBodyLength: Infinity,
|
||||||
|
url: '/api/networks/routers',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'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/networks/routers"
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Authorization': 'Token <TOKEN>'
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.request("GET", url, headers=headers)
|
||||||
|
|
||||||
|
print(response.text)
|
||||||
|
```
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
"net/http"
|
||||||
|
"io/ioutil"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
url := "https://api.netbird.io/api/networks/routers"
|
||||||
|
method := "GET"
|
||||||
|
|
||||||
|
client := &http.Client {
|
||||||
|
}
|
||||||
|
req, err := http.NewRequest(method, url, nil)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
{
|
||||||
|
|
||||||
|
req.Header.Add("Accept", "application/json")
|
||||||
|
req.Header.Add("Authorization", "Token <TOKEN>")
|
||||||
|
|
||||||
|
res, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer res.Body.Close()
|
||||||
|
|
||||||
|
body, err := ioutil.ReadAll(res.Body)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println(string(body))
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
require "uri"
|
||||||
|
require "json"
|
||||||
|
require "net/http"
|
||||||
|
|
||||||
|
url = URI("https://api.netbird.io/api/networks/routers")
|
||||||
|
|
||||||
|
https = Net::HTTP.new(url.host, url.port)
|
||||||
|
https.use_ssl = true
|
||||||
|
|
||||||
|
request = Net::HTTP::Get.new(url)
|
||||||
|
request["Accept"] = "application/json"
|
||||||
|
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/networks/routers")
|
||||||
|
.method("GET")
|
||||||
|
.addHeader("Accept", "application/json")
|
||||||
|
.addHeader("Authorization: Token <TOKEN>")
|
||||||
|
.build();
|
||||||
|
Response response = client.newCall(request).execute();
|
||||||
|
```
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$curl = curl_init();
|
||||||
|
|
||||||
|
curl_setopt_array($curl, array(
|
||||||
|
CURLOPT_URL => 'https://api.netbird.io/api/networks/routers',
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_ENCODING => '',
|
||||||
|
CURLOPT_MAXREDIRS => 10,
|
||||||
|
CURLOPT_TIMEOUT => 0,
|
||||||
|
CURLOPT_FOLLOWLOCATION => true,
|
||||||
|
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||||
|
CURLOPT_CUSTOMREQUEST => 'GET',
|
||||||
|
CURLOPT_HTTPHEADER => array(
|
||||||
|
'Accept: application/json',
|
||||||
|
'Authorization: Token <TOKEN>'
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
$response = curl_exec($curl);
|
||||||
|
|
||||||
|
curl_close($curl);
|
||||||
|
echo $response;
|
||||||
|
```
|
||||||
|
|
||||||
|
</CodeGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<CodeGroup title="Response">
|
||||||
|
```json {{ title: 'Example' }}
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "chacdk86lnnboviihd7g",
|
||||||
|
"peer": "chacbco6lnnbn6cg5s91",
|
||||||
|
"peer_groups": [
|
||||||
|
"chacbco6lnnbn6cg5s91"
|
||||||
|
],
|
||||||
|
"metric": 9999,
|
||||||
|
"masquerade": true,
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
```json {{ title: 'Schema' }}
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "string",
|
||||||
|
"peer": "string",
|
||||||
|
"peer_groups": [
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"metric": "integer",
|
||||||
|
"masquerade": "boolean",
|
||||||
|
"enabled": "boolean"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
</CodeGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user