page titles

This commit is contained in:
Pascal Fischer
2023-05-03 21:02:16 +02:00
parent f2b0294ea7
commit 6777c62530
20 changed files with 186 additions and 156 deletions

View File

@@ -1,13 +1,12 @@
import template from './templates/ApiTemplate'
import { slugify, toArrayWithKey, toTitle, writeToDisk } from './helpers'
import { OpenAPIV3, OpenAPIV2 } from 'openapi-types'
import * as yaml from 'yaml';
import * as fs from 'fs'
import * as ejs from 'ejs'
export default async function gen(inputFileName: string, outputDir: string, apiUrl: string) {
const specRaw = fs.readFileSync(inputFileName, 'utf8')
const spec = yaml.parse(specRaw) as any
const spec = JSON.parse(specRaw) as any
// console.log('spec', spec)
switch (spec.openapi || spec.swagger) {
@@ -167,6 +166,7 @@ async function gen_v3(spec: OpenAPIV3.Document, dest: string, { apiUrl }: { apiU
const content = ejs.render(template, {
info: spec.info,
tag: key,
sections,
operations,
schemas,

View File

@@ -3,6 +3,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = '<%- tag %>'
<% operations.forEach(function(operation){ %>
## <%- operation.summary %> {{ tag: '<%- operation.operation.toUpperCase() %>' , label: '<%- operation.path %>' }}
@@ -171,7 +173,7 @@ url = URI("<%- operation.fullPath %>")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::<% operation.operation.slice(0, 1).toUpperCase() + operation.operation.slice(1).toLowerCase() %>.new(url)
request = Net::HTTP::<%- operation.operation.slice(0,1).toUpperCase() + operation.operation.slice(1).toLowerCase()%>.new(url)
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>request["Content-Type"] = "application/json"<% }; %>
<% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ -%>request["Accept"] = "application/json"<% }; %>
request["Authorization"] = "Token <TOKEN>"
@@ -185,11 +187,12 @@ puts response.read_body
\`\`\`java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '<%- JSON.stringify(schemas.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.examples, null, 2) %>');
RequestBody body = RequestBody.create(mediaType, '<%- JSON.stringify(schemas.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.examples, null, 2) %>');<% }; %>
Request request = new Request.Builder()
.url("<%- operation.fullPath %>")
.method("<%- operation.operation.toUpperCase() %>", body)
.method("<%- operation.operation.toUpperCase() %>"<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>, body<% }; %>)
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ -%>.addHeader("Content-Type", "application/json")<% }; %>
<% if(operation.responseList[0].content && operation.responseList[0].content['application/json']){ -%>.addHeader("Accept", "application/json")<% }; %>
.addHeader("Authorization: Token <TOKEN>")
@@ -211,7 +214,8 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => '<%- operation.operation.toUpperCase() %>',
CURLOPT_POSTFIELDS =>'<%- JSON.stringify(schemas.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.examples, null, 2) %>',
<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %>
CURLOPT_POSTFIELDS =>'<%- JSON.stringify(schemas.get(operation.requestBody?.content['application/json'].schema.$ref?.split('/').pop())?.examples, null, 2) %>',<% }; %>
CURLOPT_HTTPHEADER => array(
<% 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',<% }; %>

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Accounts'
## List all Accounts {{ tag: 'GET' , label: '/api/accounts' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/accounts")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/accounts")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -347,7 +348,7 @@ url = URI("https://api.netbird.io/api/accounts/{accountId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -392,6 +393,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer"

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'DNS'
## List all Nameserver Groups {{ tag: 'GET' , label: '/api/dns/nameservers' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/dns/nameservers")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/nameservers")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -530,6 +531,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"description": "string",
@@ -720,7 +722,7 @@ url = URI("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -732,11 +734,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -758,7 +759,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -1066,7 +1067,7 @@ url = URI("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -1141,6 +1142,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"description": "string",
@@ -1331,7 +1333,7 @@ url = URI("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -1343,11 +1345,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/nameservers/{nsgroupId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -1369,7 +1370,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
@@ -1506,7 +1507,7 @@ url = URI("https://api.netbird.io/api/dns/settings")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -1518,11 +1519,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/dns/settings")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -1544,7 +1544,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -1725,7 +1725,7 @@ url = URI("https://api.netbird.io/api/dns/settings")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -1772,6 +1772,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"disabled_management_groups": [
"string"

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern";
<HeroPattern />
export const title = 'Examples'
## NetBird Client on AWS ECS (Terraform)
<p align="center">

View File

@@ -2,6 +2,8 @@ import {Note} from "@/components/mdx"; import {HeroPattern} from "@/components/H
<HeroPattern />
export const title = 'FAQ'
## What firewall ports should I open to use NetBird?
### Incoming ports

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Getting Started'
## Quickstart Guide
Step-by-step video guide on YouTube:

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'How NetBird Works'
## Architecture
### Overview

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Button, Note} from
<HeroPattern />
export const title = 'How-to Guides'
## Routing traffic to private networks
<div class="videowrapper">

View File

@@ -2,6 +2,8 @@ import {Note} from "@/components/mdx"; import {HeroPattern} from "@/components/H
<HeroPattern />
export const title = 'Other'
## Google Summer of Code Ideas - 2022
This page lists the all project ideas for [Google Summer of Code 2022](https://summerofcode.withgoogle.com/).

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern";
<HeroPattern />
export const title = 'Reference'
## NetBird commands
The NetBird client installation adds a binary called `netbird` to your system. This binary runs as a daemon service to connect

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Events'
## List all Events {{ tag: 'GET' , label: '/api/events' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/events")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/events")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Groups'
## List all Groups {{ tag: 'GET' , label: '/api/groups' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/groups")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/groups")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -400,6 +401,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"peers": [
@@ -568,7 +570,7 @@ url = URI("https://api.netbird.io/api/groups/{groupId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -580,11 +582,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/groups/{groupId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -606,7 +607,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -810,7 +811,7 @@ url = URI("https://api.netbird.io/api/groups/{groupId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -859,6 +860,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"peers": [
@@ -1027,7 +1029,7 @@ url = URI("https://api.netbird.io/api/groups/{groupId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -1039,11 +1041,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/groups/{groupId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -1065,7 +1066,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Peers'
## List all Peers {{ tag: 'GET' , label: '/api/peers' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/peers")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -331,7 +332,7 @@ url = URI("https://api.netbird.io/api/peers/{peerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -343,11 +344,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -369,7 +369,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -589,7 +589,7 @@ url = URI("https://api.netbird.io/api/peers/{peerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -636,6 +636,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"ssh_enabled": "boolean",
@@ -816,7 +817,7 @@ url = URI("https://api.netbird.io/api/peers/{peerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -828,11 +829,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -854,7 +854,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Policies'
## List all Policies {{ tag: 'GET' , label: '/api/policies' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/policies")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/policies")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -578,6 +579,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"description": "string",
@@ -784,7 +786,7 @@ url = URI("https://api.netbird.io/api/policies/{policyId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -796,11 +798,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/policies/{policyId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -822,7 +823,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -1158,7 +1159,7 @@ url = URI("https://api.netbird.io/api/policies/{policyId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -1253,6 +1254,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"description": "string",
@@ -1463,7 +1465,7 @@ url = URI("https://api.netbird.io/api/policies/{policyId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -1475,11 +1477,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/policies/{policyId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -1501,7 +1502,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Routes'
## List all Routes {{ tag: 'GET' , label: '/api/routes' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/routes")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/routes")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -489,6 +490,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"description": "string",
"network_id": "string",
@@ -666,7 +668,7 @@ url = URI("https://api.netbird.io/api/routes/{routeId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -678,11 +680,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/routes/{routeId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -704,7 +705,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -985,7 +986,7 @@ url = URI("https://api.netbird.io/api/routes/{routeId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -1046,6 +1047,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"description": "string",
"network_id": "string",
@@ -1223,7 +1225,7 @@ url = URI("https://api.netbird.io/api/routes/{routeId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -1235,11 +1237,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/routes/{routeId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -1261,7 +1262,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Rules'
## List all Rules {{ tag: 'GET' , label: '/api/rules' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/rules")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/rules")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -474,6 +475,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"description": "string",
@@ -654,7 +656,7 @@ url = URI("https://api.netbird.io/api/rules/{ruleId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -666,11 +668,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/rules/{ruleId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -692,7 +693,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -958,7 +959,7 @@ url = URI("https://api.netbird.io/api/rules/{ruleId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -1019,6 +1020,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"description": "string",
@@ -1203,7 +1205,7 @@ url = URI("https://api.netbird.io/api/rules/{ruleId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -1215,11 +1217,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/rules/{ruleId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -1241,7 +1242,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Setup Keys'
## List all Setup Keys {{ tag: 'GET' , label: '/api/setup-keys' }}
@@ -115,7 +117,7 @@ url = URI("https://api.netbird.io/api/setup-keys")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -127,11 +129,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/setup-keys")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -153,7 +154,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -458,6 +459,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"type": "string",
@@ -636,7 +638,7 @@ url = URI("https://api.netbird.io/api/setup-keys/{keyId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -648,11 +650,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/setup-keys/{keyId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -674,7 +675,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -928,7 +929,7 @@ url = URI("https://api.netbird.io/api/setup-keys/{keyId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -985,6 +986,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"type": "string",

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Tokens'
## List all Tokens {{ tag: 'GET' , label: '/api/users/{userId}/tokens' }}
@@ -123,7 +125,7 @@ url = URI("https://api.netbird.io/api/users/{userId}/tokens")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -135,11 +137,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users/{userId}/tokens")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -161,7 +162,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -405,6 +406,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"expires_in": "integer"
@@ -575,7 +577,7 @@ url = URI("https://api.netbird.io/api/users/{userId}/tokens/{tokenId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -587,11 +589,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users/{userId}/tokens/{tokenId}")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -613,7 +614,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -777,7 +778,7 @@ url = URI("https://api.netbird.io/api/users/{userId}/tokens/{tokenId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -789,11 +790,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users/{userId}/tokens/{tokenId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -815,7 +815,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(

View File

@@ -2,6 +2,8 @@ import {HeroPattern} from "@/components/HeroPattern"; import {Note} from "@/comp
<HeroPattern />
export const title = 'Users'
## Retrieve Users {{ tag: 'GET' , label: '/api/users' }}
@@ -123,7 +125,7 @@ url = URI("https://api.netbird.io/api/users")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -135,11 +137,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users")
.method("GET", body)
.method("GET")
.addHeader("Accept", "application/json")
.addHeader("Authorization: Token <TOKEN>")
@@ -161,7 +162,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
@@ -448,6 +449,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"email": "string",
"name": "string",
@@ -661,7 +663,7 @@ url = URI("https://api.netbird.io/api/users/{userId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
@@ -710,6 +712,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"role": "string",
"auto_groups": [
@@ -879,7 +882,7 @@ url = URI("https://api.netbird.io/api/users/{userId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Token <TOKEN>"
@@ -891,11 +894,10 @@ puts response.read_body
```java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/users/{userId}")
.method("DELETE", body)
.method("DELETE")
.addHeader("Authorization: Token <TOKEN>")
@@ -917,7 +919,7 @@ curl_setopt_array($curl, array(
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'',
CURLOPT_HTTPHEADER => array(