switch requests examples to version with values

This commit is contained in:
Pascal Fischer
2023-05-05 18:04:17 +02:00
parent adf57d5294
commit 05cbda8cd8
11 changed files with 756 additions and 756 deletions

View File

@@ -68,13 +68,13 @@ curl -X <%- operation.operation.toUpperCase() %> <%- operation.fullPath %> \\
-H 'Accept: application/json' \\<% }; %> -H 'Accept: application/json' \\<% }; %>
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>
-H 'Content-Type: application/json' \\ -H 'Content-Type: application/json' \\
--data-raw '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>'<% }; %> --data-raw '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>'<% }; %>
\`\`\` \`\`\`
\`\`\`js \`\`\`js
const axios = require('axios'); const axios = require('axios');
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>
let data = JSON.stringify(<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>);<% }; -%> let data = JSON.stringify(<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>);<% }; -%>
let config = { let config = {
method: '<%- operation.operation.toLowerCase() %>', method: '<%- operation.operation.toLowerCase() %>',
@@ -104,7 +104,7 @@ import json
url = "<%- operation.fullPath %>" url = "<%- operation.fullPath %>"
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>
payload = json.dumps(<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>)<% }; -%> payload = json.dumps(<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>)<% }; -%>
headers = { headers = {
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>'Content-Type': 'application/json',<% }; %> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>'Content-Type': 'application/json',<% }; %>
@@ -132,7 +132,7 @@ func main() {
url := "<%- operation.fullPath %>" url := "<%- operation.fullPath %>"
method := "<%- operation.operation.toUpperCase() %>" method := "<%- operation.operation.toUpperCase() %>"
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>
payload := strings.NewReader(\`<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>\`)<% }; -%> payload := strings.NewReader(\`<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>\`)<% }; -%>
client := &http.Client { client := &http.Client {
} }
@@ -178,7 +178,7 @@ request = Net::HTTP::<%- operation.operation.slice(0,1).toUpperCase() + operatio
<% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ -%>request["Accept"] = "application/json"<% }; %> <% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ -%>request["Accept"] = "application/json"<% }; %>
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>
request.body = JSON.dump(<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>)<% }; -%> request.body = JSON.dump(<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>)<% }; -%>
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -189,7 +189,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build(); .build();
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>
MediaType mediaType = MediaType.parse("application/json"); MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>');<% }; %> RequestBody body = RequestBody.create(mediaType, '<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>');<% }; %>
Request request = new Request.Builder() Request request = new Request.Builder()
.url("<%- operation.fullPath %>") .url("<%- operation.fullPath %>")
.method("<%- operation.operation.toUpperCase() %>"<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>, body<% }; %>) .method("<%- operation.operation.toUpperCase() %>"<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>, body<% }; %>)
@@ -215,7 +215,7 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => '<%- operation.operation.toUpperCase() %>', CURLOPT_CUSTOMREQUEST => '<%- operation.operation.toUpperCase() %>',
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>
CURLOPT_POSTFIELDS =>'<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.schema, null, 2) %>',<% }; %> CURLOPT_POSTFIELDS =>'<%- JSON.stringify(components.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.example, null, 2) %>',<% }; %>
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>'Content-Type: application/json',<% }; %> <% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>'Content-Type: application/json',<% }; %>
<% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ -%>'Accept: application/json',<% }; %> <% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ -%>'Accept: application/json',<% }; %>

View File

@@ -248,16 +248,16 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}' }'
``` ```
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}); });
let config = { let config = {
method: 'put', method: 'put',
@@ -287,8 +287,8 @@ import json
url = "https://api.netbird.io/api/accounts/{accountId}" url = "https://api.netbird.io/api/accounts/{accountId}"
payload = json.dumps({ payload = json.dumps({
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}) })
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -317,8 +317,8 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}`) }`)
client := &http.Client { client := &http.Client {
} }
@@ -365,8 +365,8 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}) })
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -377,8 +377,8 @@ 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, '{
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}'); }');
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}")
@@ -406,8 +406,8 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": true,
"peer_login_expiration": "integer" "peer_login_expiration": 43200
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Content-Type: application/json', 'Content-Type: application/json',

View File

@@ -309,22 +309,22 @@ curl -X POST https://api.netbird.io/api/dns/nameservers \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}' }'
``` ```
@@ -332,22 +332,22 @@ curl -X POST https://api.netbird.io/api/dns/nameservers \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}); });
let config = { let config = {
@@ -378,22 +378,22 @@ 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": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}) })
headers = { headers = {
@@ -423,22 +423,22 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -486,22 +486,22 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -513,22 +513,22 @@ 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": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -557,22 +557,22 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
@@ -964,22 +964,22 @@ curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}' }'
``` ```
@@ -987,22 +987,22 @@ curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}); });
let config = { let config = {
@@ -1033,22 +1033,22 @@ 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": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}) })
headers = { headers = {
@@ -1078,22 +1078,22 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -1141,22 +1141,22 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -1168,22 +1168,22 @@ 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": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -1212,22 +1212,22 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "Google DNS",
"description": "string", "description": "Google DNS servers",
"nameservers": [ "nameservers": [
{ {
"ip": "string", "ip": "8.8.8.8",
"ns_type": "string", "ns_type": "udp",
"port": "integer" "port": 53
} }
], ],
"enabled": "boolean", "enabled": true,
"groups": [ "groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
], ],
"primary": "boolean", "primary": true,
"domains": [ "domains": [
"string" "example.com"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
@@ -1710,7 +1710,7 @@ curl -X PUT https://api.netbird.io/api/dns/settings \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"disabled_management_groups": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}' }'
``` ```
@@ -1719,7 +1719,7 @@ curl -X PUT https://api.netbird.io/api/dns/settings \
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"disabled_management_groups": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}); });
let config = { let config = {
@@ -1751,7 +1751,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": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
headers = { headers = {
@@ -1782,7 +1782,7 @@ func main() {
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"disabled_management_groups": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -1831,7 +1831,7 @@ request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"disabled_management_groups": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -1844,7 +1844,7 @@ OkHttpClient client = new OkHttpClient().newBuilder()
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": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -1874,7 +1874,7 @@ curl_setopt_array($curl, array(
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"disabled_management_groups": [ "disabled_management_groups": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(

View File

@@ -248,9 +248,9 @@ curl -X POST https://api.netbird.io/api/groups \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}' }'
``` ```
@@ -258,9 +258,9 @@ curl -X POST https://api.netbird.io/api/groups \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}); });
let config = { let config = {
@@ -291,9 +291,9 @@ import json
url = "https://api.netbird.io/api/groups" url = "https://api.netbird.io/api/groups"
payload = json.dumps({ payload = json.dumps({
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}) })
headers = { headers = {
@@ -323,9 +323,9 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -373,9 +373,9 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -387,9 +387,9 @@ 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": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -418,9 +418,9 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
@@ -733,9 +733,9 @@ curl -X PUT https://api.netbird.io/api/groups/{groupId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}' }'
``` ```
@@ -743,9 +743,9 @@ curl -X PUT https://api.netbird.io/api/groups/{groupId} \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}); });
let config = { let config = {
@@ -776,9 +776,9 @@ 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": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}) })
headers = { headers = {
@@ -808,9 +808,9 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -858,9 +858,9 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -872,9 +872,9 @@ 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": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -903,9 +903,9 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "devs",
"peers": [ "peers": [
"string" null
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(

View File

@@ -528,18 +528,18 @@ curl -X PUT https://api.netbird.io/api/peers/{peerId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}' }'
``` ```
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}); });
let config = { let config = {
method: 'put', method: 'put',
@@ -569,9 +569,9 @@ 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": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}) })
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -600,9 +600,9 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}`) }`)
client := &http.Client { client := &http.Client {
} }
@@ -649,9 +649,9 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}) })
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -662,9 +662,9 @@ 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": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}'); }');
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}")
@@ -692,9 +692,9 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "stage-host-1",
"ssh_enabled": "boolean", "ssh_enabled": true,
"login_expiration_enabled": "boolean" "login_expiration_enabled": false
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Content-Type: application/json', 'Content-Type: application/json',

View File

@@ -307,31 +307,31 @@ curl -X POST https://api.netbird.io/api/policies \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}' }'
@@ -340,31 +340,31 @@ curl -X POST https://api.netbird.io/api/policies \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}); });
@@ -396,31 +396,31 @@ import json
url = "https://api.netbird.io/api/policies" url = "https://api.netbird.io/api/policies"
payload = json.dumps({ payload = json.dumps({
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}) })
@@ -451,31 +451,31 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}`) }`)
@@ -524,31 +524,31 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}) })
@@ -561,31 +561,31 @@ 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": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}'); }');
@@ -615,31 +615,31 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}', }',
@@ -1046,31 +1046,31 @@ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}' }'
@@ -1079,31 +1079,31 @@ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}); });
@@ -1135,31 +1135,31 @@ import json
url = "https://api.netbird.io/api/policies/{policyId}" url = "https://api.netbird.io/api/policies/{policyId}"
payload = json.dumps({ payload = json.dumps({
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}) })
@@ -1190,31 +1190,31 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}`) }`)
@@ -1263,31 +1263,31 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}) })
@@ -1300,31 +1300,31 @@ 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": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}'); }');
@@ -1354,31 +1354,31 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "ch8i4ug6lnn4g9hqv7mg",
"description": "string", "description": "This is a default policy that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"query": "string", "query": "package netbird\\n\\nall[rule] {\\n is_peer_in_any_group([\\\"ch8i4ug6lnn4g9hqv7m0\\\",\\\"ch8i4ug6lnn4g9hqv7m0\\\"])\\n rule := {\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"dst\\\", \\\"accept\\\", \\\"\\\"),\\n rules_from_group(\\\"ch8i4ug6lnn4g9hqv7m0\\\", \\\"src\\\", \\\"accept\\\", \\\"\\\"),\\n }[_][_]\\n}\\n",
"rules": [ "rules": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7mg",
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"enabled": "boolean", "enabled": true,
"sources": [ "sources": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "string", "name": "devs",
"peers_count": "integer" "peers_count": 2
} }
], ],
"action": "string" "action": "accept"
} }
] ]
}', }',

View File

@@ -304,15 +304,15 @@ curl -X POST https://api.netbird.io/api/routes \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}' }'
``` ```
@@ -320,15 +320,15 @@ curl -X POST https://api.netbird.io/api/routes \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}); });
let config = { let config = {
@@ -359,15 +359,15 @@ import json
url = "https://api.netbird.io/api/routes" url = "https://api.netbird.io/api/routes"
payload = json.dumps({ payload = json.dumps({
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}) })
headers = { headers = {
@@ -397,15 +397,15 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -453,15 +453,15 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -473,15 +473,15 @@ 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": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -510,15 +510,15 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
@@ -893,15 +893,15 @@ curl -X PUT https://api.netbird.io/api/routes/{routeId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}' }'
``` ```
@@ -909,15 +909,15 @@ curl -X PUT https://api.netbird.io/api/routes/{routeId} \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}); });
let config = { let config = {
@@ -948,15 +948,15 @@ 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": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}) })
headers = { headers = {
@@ -986,15 +986,15 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -1042,15 +1042,15 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -1062,15 +1062,15 @@ 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": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -1099,15 +1099,15 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"description": "string", "description": "My first route",
"network_id": "string", "network_id": "Route 1",
"enabled": "boolean", "enabled": true,
"peer": "string", "peer": "chacbco6lnnbn6cg5s91",
"network": "string", "network": "10.64.0.0/24",
"metric": "integer", "metric": 9999,
"masquerade": "boolean", "masquerade": true,
"groups": [ "groups": [
"string" "chacdk86lnnboviihd70"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(

View File

@@ -296,15 +296,15 @@ curl -X POST https://api.netbird.io/api/rules \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}' }'
``` ```
@@ -312,15 +312,15 @@ curl -X POST https://api.netbird.io/api/rules \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}); });
let config = { let config = {
@@ -351,15 +351,15 @@ import json
url = "https://api.netbird.io/api/rules" url = "https://api.netbird.io/api/rules"
payload = json.dumps({ payload = json.dumps({
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
headers = { headers = {
@@ -389,15 +389,15 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -445,15 +445,15 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -465,15 +465,15 @@ 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": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -502,15 +502,15 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
@@ -887,15 +887,15 @@ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}' }'
``` ```
@@ -903,15 +903,15 @@ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}); });
let config = { let config = {
@@ -942,15 +942,15 @@ 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": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
headers = { headers = {
@@ -980,15 +980,15 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -1036,15 +1036,15 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -1056,15 +1056,15 @@ 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": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -1093,15 +1093,15 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "Default",
"description": "string", "description": "This is a default rule that allows connections between all the resources",
"disabled": "boolean", "disabled": false,
"flow": "string", "flow": "bidirect",
"sources": [ "sources": [
"string" "ch8i4ug6lnn4g9hqv7m1"
], ],
"destinations": [ "destinations": [
"string" "ch8i4ug6lnn4g9hqv7m0"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(

View File

@@ -288,28 +288,28 @@ curl -X POST https://api.netbird.io/api/setup-keys \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}' }'
``` ```
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}); });
let config = { let config = {
method: 'post', method: 'post',
@@ -339,14 +339,14 @@ 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": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}) })
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -375,14 +375,14 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}`) }`)
client := &http.Client { client := &http.Client {
} }
@@ -429,14 +429,14 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}) })
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -447,14 +447,14 @@ 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": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}'); }');
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")
@@ -482,14 +482,14 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Content-Type: application/json', 'Content-Type: application/json',
@@ -853,28 +853,28 @@ curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}' }'
``` ```
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}); });
let config = { let config = {
method: 'put', method: 'put',
@@ -904,14 +904,14 @@ 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": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}) })
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -940,14 +940,14 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}`) }`)
client := &http.Client { client := &http.Client {
} }
@@ -994,14 +994,14 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}) })
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -1012,14 +1012,14 @@ 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": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}'); }');
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}")
@@ -1047,14 +1047,14 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "Default key",
"type": "string", "type": "reusable",
"expires_in": "integer", "expires_in": 43200,
"revoked": "boolean", "revoked": false,
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"usage_limit": "integer" "usage_limit": 0
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Content-Type: application/json', 'Content-Type: application/json',

View File

@@ -262,16 +262,16 @@ curl -X POST https://api.netbird.io/api/users/{userId}/tokens \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"name": "string", "name": "My first token",
"expires_in": "integer" "expires_in": 30
}' }'
``` ```
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"name": "string", "name": "My first token",
"expires_in": "integer" "expires_in": 30
}); });
let config = { let config = {
method: 'post', method: 'post',
@@ -301,8 +301,8 @@ 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": "string", "name": "My first token",
"expires_in": "integer" "expires_in": 30
}) })
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -331,8 +331,8 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"name": "string", "name": "My first token",
"expires_in": "integer" "expires_in": 30
}`) }`)
client := &http.Client { client := &http.Client {
} }
@@ -379,8 +379,8 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"name": "string", "name": "My first token",
"expires_in": "integer" "expires_in": 30
}) })
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -391,8 +391,8 @@ 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": "string", "name": "My first token",
"expires_in": "integer" "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")
@@ -420,8 +420,8 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"name": "string", "name": "My first token",
"expires_in": "integer" "expires_in": 30
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Content-Type: application/json', 'Content-Type: application/json',

View File

@@ -279,26 +279,26 @@ curl -X POST https://api.netbird.io/api/users \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"email": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "is_service_user": false
}' }'
``` ```
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"email": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "is_service_user": false
}); });
let config = { let config = {
method: 'post', method: 'post',
@@ -328,13 +328,13 @@ import json
url = "https://api.netbird.io/api/users" url = "https://api.netbird.io/api/users"
payload = json.dumps({ payload = json.dumps({
"email": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "is_service_user": false
}) })
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@@ -363,13 +363,13 @@ func main() {
method := "POST" method := "POST"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"email": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "is_service_user": false
}`) }`)
client := &http.Client { client := &http.Client {
} }
@@ -416,13 +416,13 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"email": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "is_service_user": false
}) })
response = https.request(request) response = https.request(request)
puts response.read_body puts response.read_body
@@ -433,13 +433,13 @@ 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": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "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")
@@ -467,13 +467,13 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"email": "string", "email": "demo@netbird.io",
"name": "string", "name": "Tom Schulz",
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
], ],
"is_service_user": "boolean" "is_service_user": false
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Content-Type: application/json', 'Content-Type: application/json',
@@ -574,9 +574,9 @@ curl -X PUT https://api.netbird.io/api/users/{userId} \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--data-raw '{ --data-raw '{
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}' }'
``` ```
@@ -584,9 +584,9 @@ curl -X PUT https://api.netbird.io/api/users/{userId} \
```js ```js
const axios = require('axios'); const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}); });
let config = { let config = {
@@ -617,9 +617,9 @@ 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": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}) })
headers = { headers = {
@@ -649,9 +649,9 @@ func main() {
method := "PUT" method := "PUT"
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}`) }`)
client := &http.Client { client := &http.Client {
@@ -699,9 +699,9 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>" request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}) })
response = https.request(request) response = https.request(request)
@@ -713,9 +713,9 @@ 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": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -744,9 +744,9 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{ CURLOPT_POSTFIELDS =>'{
"role": "string", "role": "admin",
"auto_groups": [ "auto_groups": [
"string" "devs"
] ]
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(