diff --git a/.github/workflows/generate_api_pages.yml b/.github/workflows/generate_api_pages.yml
index 3efae213..54e4e6d9 100644
--- a/.github/workflows/generate_api_pages.yml
+++ b/.github/workflows/generate_api_pages.yml
@@ -40,6 +40,9 @@ jobs:
- name: Expand openapi.yml
run: (cd ./generator && ./expandOpenAPIRef)
+ - name: Remove old generated files
+ run: rm -rf src/pages/ipa/resources/*
+
- name: Npm install
run: npm install
diff --git a/src/pages/how-to/access-netbird-public-api.mdx b/src/pages/how-to/access-netbird-public-api.mdx
index 73ec6b2d..2f7805d9 100644
--- a/src/pages/how-to/access-netbird-public-api.mdx
+++ b/src/pages/how-to/access-netbird-public-api.mdx
@@ -65,6 +65,11 @@ Be aware that once you close the popup it is impossible to see the plain version
Once you have created an access token, you can use it to authenticate API requests to NetBird. See [NetBird API](/api/introduction) documentation for detailed usage.
-For example, if you were using the GitHub API, you might include your personal access token like this:
+For example, if you were using the API, you might include your personal access token like this:
-With this header included, the GitHub API would authenticate your request using your personal access token and grant you access to the resources that the token has been authorized to access.
+```bash {{ title: 'Example request with personal access token' }}
+curl https://api.netbird.io/api/users \
+ -H "Authorization: Token {token}"
+```
+
+With this header included, the NetBird API would authenticate your request using your personal access token and grant you access to the resources that your user has been authorized to.
diff --git a/src/pages/ipa/resources/rules.mdx b/src/pages/ipa/resources/rules.mdx
deleted file mode 100644
index 86094baa..00000000
--- a/src/pages/ipa/resources/rules.mdx
+++ /dev/null
@@ -1,1302 +0,0 @@
-export const title = 'Rules'
-
-
-
-## List all Rules {{ tag: 'GET' , label: '/api/rules' }}
-
-
-
- Returns a list of all rules. This will be deprecated in favour of `/api/policies`.
-
-
-
-
-```bash {{ title: 'cURL' }}
-curl -X GET https://api.netbird.io/api/rules \
--H 'Accept: application/json' \
--H 'Authorization: Token '
-```
-
-```js
-const axios = require('axios');
-
-let config = {
- method: 'get',
- maxBodyLength: Infinity,
- url: '/api/rules',
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Token '
- }
-};
-
-axios(config)
-.then((response) => {
- console.log(JSON.stringify(response.data));
-})
-.catch((error) => {
- console.log(error);
-});
-```
-
-```python
-import requests
-import json
-
-url = "https://api.netbird.io/api/rules"
-
-headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Token '
-}
-
-response = requests.request("GET", url, headers=headers)
-
-print(response.text)
-```
-
-```go
-package main
-
-import (
- "fmt"
- "strings"
- "net/http"
- "io/ioutil"
-)
-
-func main() {
-
- url := "https://api.netbird.io/api/rules"
- method := "GET"
-
- client := &http.Client {
- }
- req, err := http.NewRequest(method, url, nil)
-
- if err != nil {
- fmt.Println(err)
- return
- {
-
- req.Header.Add("Accept", "application/json")
- req.Header.Add("Authorization", "Token ")
-
- res, err := client.Do(req)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer res.Body.Close()
-
- body, err := ioutil.ReadAll(res.Body)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Println(string(body))
-}
-```
-
-```ruby
-require "uri"
-require "json"
-require "net/http"
-
-url = URI("https://api.netbird.io/api/rules")
-
-https = Net::HTTP.new(url.host, url.port)
-https.use_ssl = true
-
-request = Net::HTTP::Get.new(url)
-request["Accept"] = "application/json"
-request["Authorization"] = "Token "
-
-response = https.request(request)
-puts response.read_body
-```
-
-```java
-OkHttpClient client = new OkHttpClient().newBuilder()
- .build();
-
-Request request = new Request.Builder()
- .url("https://api.netbird.io/api/rules")
- .method("GET")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization: Token ")
- .build();
-Response response = client.newCall(request).execute();
-```
-
-```php
- 'https://api.netbird.io/api/rules',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'GET',
- CURLOPT_HTTPHEADER => array(
- 'Accept: application/json',
- 'Authorization: Token '
- ),
-));
-
-$response = curl_exec($curl);
-
-curl_close($curl);
-echo $response;
-```
-
-
-
-
-
-```json {{ title: 'Example' }}
-[
- {
- "id": "ch8i4ug6lnn4g9hqv7mg",
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ],
- "destinations": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ]
- }
-]
-```
-```json {{ title: 'Schema' }}
-[
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "disabled": "boolean",
- "flow": "string",
- "sources": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ],
- "destinations": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ]
- }
-]
-```
-
-
-
-
-
-
----
-
-
-## Create a Rule {{ tag: 'POST' , label: '/api/rules' }}
-
-
-
- Creates a rule. This will be deprecated in favour of `/api/policies`.
-
- #### Request-Body Parameters
-
-
-
- Rule name identifier
-
-
-
-
- Rule friendly description
-
-
-
-
- Rules status
-
-
-
-
- Rule flow, currently, only "bidirect" for bi-directional traffic is accepted
-
-
-
-
- List of source group IDs
-
-
-
-
- List of destination group IDs
-
-
-
-
-
-
-
-
-
-```bash {{ title: 'cURL' }}
-curl -X POST https://api.netbird.io/api/rules \
--H 'Accept: application/json' \
--H 'Content-Type: application/json' \
--H 'Authorization: Token ' \
---data-raw '{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}'
-```
-
-```js
-const axios = require('axios');
-let data = JSON.stringify({
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-});
-let config = {
- method: 'post',
- maxBodyLength: Infinity,
- url: '/api/rules',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- 'Authorization': 'Token '
- },
- data : data
-};
-
-axios(config)
-.then((response) => {
- console.log(JSON.stringify(response.data));
-})
-.catch((error) => {
- console.log(error);
-});
-```
-
-```python
-import requests
-import json
-
-url = "https://api.netbird.io/api/rules"
-payload = json.dumps({
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-})
-headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json',
- 'Authorization': 'Token '
-}
-
-response = requests.request("POST", url, headers=headers, data=payload)
-
-print(response.text)
-```
-
-```go
-package main
-
-import (
- "fmt"
- "strings"
- "net/http"
- "io/ioutil"
-)
-
-func main() {
-
- url := "https://api.netbird.io/api/rules"
- method := "POST"
-
- payload := strings.NewReader(`{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}`)
- client := &http.Client {
- }
- req, err := http.NewRequest(method, url, payload)
-
- if err != nil {
- fmt.Println(err)
- return
- {
-
- req.Header.Add("Content-Type", "application/json")
- req.Header.Add("Accept", "application/json")
- req.Header.Add("Authorization", "Token ")
-
- res, err := client.Do(req)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer res.Body.Close()
-
- body, err := ioutil.ReadAll(res.Body)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Println(string(body))
-}
-```
-
-```ruby
-require "uri"
-require "json"
-require "net/http"
-
-url = URI("https://api.netbird.io/api/rules")
-
-https = Net::HTTP.new(url.host, url.port)
-https.use_ssl = true
-
-request = Net::HTTP::Post.new(url)
-request["Content-Type"] = "application/json"
-request["Accept"] = "application/json"
-request["Authorization"] = "Token "
-
-request.body = JSON.dump({
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-})
-response = https.request(request)
-puts response.read_body
-```
-
-```java
-OkHttpClient client = new OkHttpClient().newBuilder()
- .build();
-MediaType mediaType = MediaType.parse("application/json");
-RequestBody body = RequestBody.create(mediaType, '{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}');
-Request request = new Request.Builder()
- .url("https://api.netbird.io/api/rules")
- .method("POST", body)
- .addHeader("Content-Type", "application/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization: Token ")
- .build();
-Response response = client.newCall(request).execute();
-```
-
-```php
- 'https://api.netbird.io/api/rules',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_POSTFIELDS => '{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}',
- CURLOPT_HTTPHEADER => array(
- 'Content-Type: application/json',
- 'Accept: application/json',
- 'Authorization: Token '
- ),
-));
-
-$response = curl_exec($curl);
-
-curl_close($curl);
-echo $response;
-```
-
-
-
-
-
-```json {{ title: 'Example' }}
-{
- "id": "ch8i4ug6lnn4g9hqv7mg",
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ],
- "destinations": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ]
-}
-```
-```json {{ title: 'Schema' }}
-{
- "id": "string",
- "name": "string",
- "description": "string",
- "disabled": "boolean",
- "flow": "string",
- "sources": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ],
- "destinations": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ]
-}
-```
-
-
-
-
-
-
----
-
-
-## Retrieve a Rule {{ tag: 'GET' , label: '/api/rules/{ruleId}' }}
-
-
-
- Get information about a rules. This will be deprecated in favour of `/api/policies/{policyID}`.
-
- #### Path Parameters
-
-
-
- The unique identifier of a rule
-
-
-
-
-
-
-```bash {{ title: 'cURL' }}
-curl -X GET https://api.netbird.io/api/rules/{ruleId} \
--H 'Accept: application/json' \
--H 'Authorization: Token '
-```
-
-```js
-const axios = require('axios');
-
-let config = {
- method: 'get',
- maxBodyLength: Infinity,
- url: '/api/rules/{ruleId}',
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Token '
- }
-};
-
-axios(config)
-.then((response) => {
- console.log(JSON.stringify(response.data));
-})
-.catch((error) => {
- console.log(error);
-});
-```
-
-```python
-import requests
-import json
-
-url = "https://api.netbird.io/api/rules/{ruleId}"
-
-headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Token '
-}
-
-response = requests.request("GET", url, headers=headers)
-
-print(response.text)
-```
-
-```go
-package main
-
-import (
- "fmt"
- "strings"
- "net/http"
- "io/ioutil"
-)
-
-func main() {
-
- url := "https://api.netbird.io/api/rules/{ruleId}"
- method := "GET"
-
- client := &http.Client {
- }
- req, err := http.NewRequest(method, url, nil)
-
- if err != nil {
- fmt.Println(err)
- return
- {
-
- req.Header.Add("Accept", "application/json")
- req.Header.Add("Authorization", "Token ")
-
- res, err := client.Do(req)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer res.Body.Close()
-
- body, err := ioutil.ReadAll(res.Body)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Println(string(body))
-}
-```
-
-```ruby
-require "uri"
-require "json"
-require "net/http"
-
-url = URI("https://api.netbird.io/api/rules/{ruleId}")
-
-https = Net::HTTP.new(url.host, url.port)
-https.use_ssl = true
-
-request = Net::HTTP::Get.new(url)
-request["Accept"] = "application/json"
-request["Authorization"] = "Token "
-
-response = https.request(request)
-puts response.read_body
-```
-
-```java
-OkHttpClient client = new OkHttpClient().newBuilder()
- .build();
-
-Request request = new Request.Builder()
- .url("https://api.netbird.io/api/rules/{ruleId}")
- .method("GET")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization: Token ")
- .build();
-Response response = client.newCall(request).execute();
-```
-
-```php
- 'https://api.netbird.io/api/rules/{ruleId}',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'GET',
- CURLOPT_HTTPHEADER => array(
- 'Accept: application/json',
- 'Authorization: Token '
- ),
-));
-
-$response = curl_exec($curl);
-
-curl_close($curl);
-echo $response;
-```
-
-
-
-
-
-```json {{ title: 'Example' }}
-{
- "id": "ch8i4ug6lnn4g9hqv7mg",
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ],
- "destinations": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ]
-}
-```
-```json {{ title: 'Schema' }}
-{
- "id": "string",
- "name": "string",
- "description": "string",
- "disabled": "boolean",
- "flow": "string",
- "sources": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ],
- "destinations": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ]
-}
-```
-
-
-
-
-
-
----
-
-
-## Update a Rule {{ tag: 'PUT' , label: '/api/rules/{ruleId}' }}
-
-
-
- Update/Replace a rule. This will be deprecated in favour of `/api/policies/{policyID}`.
-
- #### Path Parameters
-
-
-
- The unique identifier of a rule
-
-
-
- #### Request-Body Parameters
-
-
-
- Rule name identifier
-
-
-
-
- Rule friendly description
-
-
-
-
- Rules status
-
-
-
-
- Rule flow, currently, only "bidirect" for bi-directional traffic is accepted
-
-
-
-
- List of source group IDs
-
-
-
-
- List of destination group IDs
-
-
-
-
-
-
-
-
-
-```bash {{ title: 'cURL' }}
-curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
--H 'Accept: application/json' \
--H 'Content-Type: application/json' \
--H 'Authorization: Token ' \
---data-raw '{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}'
-```
-
-```js
-const axios = require('axios');
-let data = JSON.stringify({
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-});
-let config = {
- method: 'put',
- maxBodyLength: Infinity,
- url: '/api/rules/{ruleId}',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- 'Authorization': 'Token '
- },
- data : data
-};
-
-axios(config)
-.then((response) => {
- console.log(JSON.stringify(response.data));
-})
-.catch((error) => {
- console.log(error);
-});
-```
-
-```python
-import requests
-import json
-
-url = "https://api.netbird.io/api/rules/{ruleId}"
-payload = json.dumps({
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-})
-headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json',
- 'Authorization': 'Token '
-}
-
-response = requests.request("PUT", url, headers=headers, data=payload)
-
-print(response.text)
-```
-
-```go
-package main
-
-import (
- "fmt"
- "strings"
- "net/http"
- "io/ioutil"
-)
-
-func main() {
-
- url := "https://api.netbird.io/api/rules/{ruleId}"
- method := "PUT"
-
- payload := strings.NewReader(`{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}`)
- client := &http.Client {
- }
- req, err := http.NewRequest(method, url, payload)
-
- if err != nil {
- fmt.Println(err)
- return
- {
-
- req.Header.Add("Content-Type", "application/json")
- req.Header.Add("Accept", "application/json")
- req.Header.Add("Authorization", "Token ")
-
- res, err := client.Do(req)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer res.Body.Close()
-
- body, err := ioutil.ReadAll(res.Body)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Println(string(body))
-}
-```
-
-```ruby
-require "uri"
-require "json"
-require "net/http"
-
-url = URI("https://api.netbird.io/api/rules/{ruleId}")
-
-https = Net::HTTP.new(url.host, url.port)
-https.use_ssl = true
-
-request = Net::HTTP::Put.new(url)
-request["Content-Type"] = "application/json"
-request["Accept"] = "application/json"
-request["Authorization"] = "Token "
-
-request.body = JSON.dump({
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-})
-response = https.request(request)
-puts response.read_body
-```
-
-```java
-OkHttpClient client = new OkHttpClient().newBuilder()
- .build();
-MediaType mediaType = MediaType.parse("application/json");
-RequestBody body = RequestBody.create(mediaType, '{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}');
-Request request = new Request.Builder()
- .url("https://api.netbird.io/api/rules/{ruleId}")
- .method("PUT", body)
- .addHeader("Content-Type", "application/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization: Token ")
- .build();
-Response response = client.newCall(request).execute();
-```
-
-```php
- 'https://api.netbird.io/api/rules/{ruleId}',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'PUT',
- CURLOPT_POSTFIELDS => '{
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- "ch8i4ug6lnn4g9hqv7m1"
- ],
- "destinations": [
- "ch8i4ug6lnn4g9hqv7m0"
- ]
-}',
- CURLOPT_HTTPHEADER => array(
- 'Content-Type: application/json',
- 'Accept: application/json',
- 'Authorization: Token '
- ),
-));
-
-$response = curl_exec($curl);
-
-curl_close($curl);
-echo $response;
-```
-
-
-
-
-
-```json {{ title: 'Example' }}
-{
- "id": "ch8i4ug6lnn4g9hqv7mg",
- "name": "Default",
- "description": "This is a default rule that allows connections between all the resources",
- "disabled": false,
- "flow": "bidirect",
- "sources": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ],
- "destinations": [
- {
- "id": "ch8i4ug6lnn4g9hqv7m0",
- "name": "devs",
- "peers_count": 2,
- "issued": "api"
- }
- ]
-}
-```
-```json {{ title: 'Schema' }}
-{
- "id": "string",
- "name": "string",
- "description": "string",
- "disabled": "boolean",
- "flow": "string",
- "sources": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ],
- "destinations": [
- {
- "id": "string",
- "name": "string",
- "peers_count": "integer",
- "issued": "string"
- }
- ]
-}
-```
-
-
-
-
-
-
----
-
-
-## Delete a Rule {{ tag: 'DELETE' , label: '/api/rules/{ruleId}' }}
-
-
-
- Delete a rule. This will be deprecated in favour of `/api/policies/{policyID}`.
-
- #### Path Parameters
-
-
-
- The unique identifier of a rule
-
-
-
-
-
-
-```bash {{ title: 'cURL' }}
-curl -X DELETE https://api.netbird.io/api/rules/{ruleId} \
--H 'Authorization: Token '
-```
-
-```js
-const axios = require('axios');
-
-let config = {
- method: 'delete',
- maxBodyLength: Infinity,
- url: '/api/rules/{ruleId}',
- headers: {
- 'Authorization': 'Token '
- }
-};
-
-axios(config)
-.then((response) => {
- console.log(JSON.stringify(response.data));
-})
-.catch((error) => {
- console.log(error);
-});
-```
-
-```python
-import requests
-import json
-
-url = "https://api.netbird.io/api/rules/{ruleId}"
-
-headers: {
- 'Authorization': 'Token '
-}
-
-response = requests.request("DELETE", url, headers=headers)
-
-print(response.text)
-```
-
-```go
-package main
-
-import (
- "fmt"
- "strings"
- "net/http"
- "io/ioutil"
-)
-
-func main() {
-
- url := "https://api.netbird.io/api/rules/{ruleId}"
- method := "DELETE"
-
- client := &http.Client {
- }
- req, err := http.NewRequest(method, url, nil)
-
- if err != nil {
- fmt.Println(err)
- return
- {
-
- req.Header.Add("Authorization", "Token ")
-
- res, err := client.Do(req)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer res.Body.Close()
-
- body, err := ioutil.ReadAll(res.Body)
- if err != nil {
- fmt.Println(err)
- return
- }
- fmt.Println(string(body))
-}
-```
-
-```ruby
-require "uri"
-require "json"
-require "net/http"
-
-url = URI("https://api.netbird.io/api/rules/{ruleId}")
-
-https = Net::HTTP.new(url.host, url.port)
-https.use_ssl = true
-
-request = Net::HTTP::Delete.new(url)
-request["Authorization"] = "Token "
-
-response = https.request(request)
-puts response.read_body
-```
-
-```java
-OkHttpClient client = new OkHttpClient().newBuilder()
- .build();
-
-Request request = new Request.Builder()
- .url("https://api.netbird.io/api/rules/{ruleId}")
- .method("DELETE")
- .addHeader("Authorization: Token ")
- .build();
-Response response = client.newCall(request).execute();
-```
-
-```php
- 'https://api.netbird.io/api/rules/{ruleId}',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'DELETE',
- CURLOPT_HTTPHEADER => array(
- 'Authorization: Token '
- ),
-));
-
-$response = curl_exec($curl);
-
-curl_close($curl);
-echo $response;
-```
-
-
-
-
-
-
-
-
----