mirror of
https://github.com/netbirdio/docs.git
synced 2026-09-17 12:29:05 +02:00
Update API pages with v0.80.0-canary.pr-7535.1
This commit is contained in:
@@ -2,6 +2,382 @@ export const title = 'Agent Network'
|
||||
|
||||
|
||||
|
||||
## Provision a managed Agent Network gateway {{ tag: 'POST' , label: '/api/integrations/agent-network/managed-proxy' }}
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
Starts provisioning of a NetBird-managed Agent Network gateway for the account, allocating its endpoint under the managed zone on the first call. Idempotent — answers 202 when this call started (or, after a failure, restarted) provisioning and 200 when a deployment already exists, reporting current state either way. Returns 409 when the account already has an Agent Network endpoint that managed provisioning does not own, and 503 when endpoint allocation is temporarily exhausted.
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="POST" label="/api/integrations/agent-network/managed-proxy">
|
||||
```bash {{ title: 'cURL' }}
|
||||
curl -X POST https://api.netbird.io/api/integrations/agent-network/managed-proxy \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
|
||||
let config = {
|
||||
method: 'post',
|
||||
maxBodyLength: Infinity,
|
||||
url: '/api/integrations/agent-network/managed-proxy',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
}
|
||||
};
|
||||
|
||||
axios(config)
|
||||
.then((response) => {
|
||||
console.log(JSON.stringify(response.data));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
```
|
||||
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
url = "https://api.netbird.io/api/integrations/agent-network/managed-proxy"
|
||||
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
}
|
||||
|
||||
response = requests.request("POST", url, headers=headers)
|
||||
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
url := "https://api.netbird.io/api/integrations/agent-network/managed-proxy"
|
||||
method := "POST"
|
||||
|
||||
client := &http.Client {
|
||||
}
|
||||
req, err := http.NewRequest(method, url, nil)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
req.Header.Add("Accept", "application/json")
|
||||
req.Header.Add("Authorization", "Token <TOKEN>")
|
||||
|
||||
res, err := client.Do(req)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
fmt.Println(string(body))
|
||||
}
|
||||
```
|
||||
|
||||
```ruby
|
||||
require "uri"
|
||||
require "json"
|
||||
require "net/http"
|
||||
|
||||
url = URI("https://api.netbird.io/api/integrations/agent-network/managed-proxy")
|
||||
|
||||
https = Net::HTTP.new(url.host, url.port)
|
||||
https.use_ssl = true
|
||||
|
||||
request = Net::HTTP::Post.new(url)
|
||||
request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
```
|
||||
|
||||
```java
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/integrations/agent-network/managed-proxy")
|
||||
.method("POST")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("Authorization: Token <TOKEN>")
|
||||
.build();
|
||||
Response response = client.newCall(request).execute();
|
||||
```
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.netbird.io/api/integrations/agent-network/managed-proxy',
|
||||
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_HTTPHEADER => array(
|
||||
'Accept: application/json',
|
||||
'Authorization: Token <TOKEN>'
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
echo $response;
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "d1m3kebd9pcs0c1pnu7g",
|
||||
"state": "ready",
|
||||
"endpoint": "brave-otter.gateway.netbird.io",
|
||||
"region": "us-east",
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Failure detail reported by the rollout. Only set when state is `failed`."
|
||||
}
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"state": "string",
|
||||
"endpoint": "string",
|
||||
"region": "string",
|
||||
"message": "string"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Retrieve managed Agent Network gateway status {{ tag: 'GET' , label: '/api/integrations/agent-network/managed-proxy' }}
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
Reports the account's managed gateway deployment and its derived state. Returns 404 when the account has no managed deployment.
|
||||
</Col>
|
||||
|
||||
<Col sticky>
|
||||
<CodeGroup title="Request" tag="GET" label="/api/integrations/agent-network/managed-proxy">
|
||||
```bash {{ title: 'cURL' }}
|
||||
curl -X GET https://api.netbird.io/api/integrations/agent-network/managed-proxy \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
|
||||
let config = {
|
||||
method: 'get',
|
||||
maxBodyLength: Infinity,
|
||||
url: '/api/integrations/agent-network/managed-proxy',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
}
|
||||
};
|
||||
|
||||
axios(config)
|
||||
.then((response) => {
|
||||
console.log(JSON.stringify(response.data));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
```
|
||||
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
url = "https://api.netbird.io/api/integrations/agent-network/managed-proxy"
|
||||
|
||||
headers = {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Token <TOKEN>'
|
||||
}
|
||||
|
||||
response = requests.request("GET", url, headers=headers)
|
||||
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"net/http"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
url := "https://api.netbird.io/api/integrations/agent-network/managed-proxy"
|
||||
method := "GET"
|
||||
|
||||
client := &http.Client {
|
||||
}
|
||||
req, err := http.NewRequest(method, url, nil)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
req.Header.Add("Accept", "application/json")
|
||||
req.Header.Add("Authorization", "Token <TOKEN>")
|
||||
|
||||
res, err := client.Do(req)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
fmt.Println(string(body))
|
||||
}
|
||||
```
|
||||
|
||||
```ruby
|
||||
require "uri"
|
||||
require "json"
|
||||
require "net/http"
|
||||
|
||||
url = URI("https://api.netbird.io/api/integrations/agent-network/managed-proxy")
|
||||
|
||||
https = Net::HTTP.new(url.host, url.port)
|
||||
https.use_ssl = true
|
||||
|
||||
request = Net::HTTP::Get.new(url)
|
||||
request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
```
|
||||
|
||||
```java
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/integrations/agent-network/managed-proxy")
|
||||
.method("GET")
|
||||
.addHeader("Accept", "application/json")
|
||||
.addHeader("Authorization: Token <TOKEN>")
|
||||
.build();
|
||||
Response response = client.newCall(request).execute();
|
||||
```
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.netbird.io/api/integrations/agent-network/managed-proxy',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'GET',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Accept: application/json',
|
||||
'Authorization: Token <TOKEN>'
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
echo $response;
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "d1m3kebd9pcs0c1pnu7g",
|
||||
"state": "ready",
|
||||
"endpoint": "brave-otter.gateway.netbird.io",
|
||||
"region": "us-east",
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Failure detail reported by the rollout. Only set when state is `failed`."
|
||||
}
|
||||
}
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"state": "string",
|
||||
"endpoint": "string",
|
||||
"region": "string",
|
||||
"message": "string"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## List Agent Network access logs {{ tag: 'GET' , label: '/api/agent-network/access-logs' }}
|
||||
|
||||
<Row>
|
||||
|
||||
@@ -214,6 +214,11 @@ echo $response;
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -269,6 +274,11 @@ echo $response;
|
||||
"windows_path": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -520,6 +530,23 @@ echo $response;
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
<Property name="certificate_check" type="object" required={false}>
|
||||
|
||||
<details className="custom-details" open>
|
||||
<summary>Posture check for a certificate held by the peer that chains to one of the given CA certificates</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="ca_certificates" type="string[]" required={true}>
|
||||
|
||||
PEM encoded CA certificates the peer's certificate must chain to
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
@@ -590,6 +617,11 @@ curl -X POST https://api.netbird.io/api/posture-checks \
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}'
|
||||
@@ -648,6 +680,11 @@ let data = JSON.stringify({
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -728,6 +765,11 @@ payload = json.dumps({
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -808,6 +850,11 @@ func main() {
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}`)
|
||||
@@ -907,6 +954,11 @@ request.body = JSON.dump({
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -969,6 +1021,11 @@ RequestBody body = RequestBody.create(mediaType, '{
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}');
|
||||
@@ -1047,6 +1104,11 @@ curl_setopt_array($curl, array(
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}',
|
||||
@@ -1120,6 +1182,11 @@ echo $response;
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1173,6 +1240,11 @@ echo $response;
|
||||
"windows_path": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1405,6 +1477,11 @@ echo $response;
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1458,6 +1535,11 @@ echo $response;
|
||||
"windows_path": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1716,6 +1798,23 @@ echo $response;
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
<Property name="certificate_check" type="object" required={false}>
|
||||
|
||||
<details className="custom-details" open>
|
||||
<summary>Posture check for a certificate held by the peer that chains to one of the given CA certificates</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="ca_certificates" type="string[]" required={true}>
|
||||
|
||||
PEM encoded CA certificates the peer's certificate must chain to
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
@@ -1786,6 +1885,11 @@ curl -X PUT https://api.netbird.io/api/posture-checks/{postureCheckId} \
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}'
|
||||
@@ -1844,6 +1948,11 @@ let data = JSON.stringify({
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1924,6 +2033,11 @@ payload = json.dumps({
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -2004,6 +2118,11 @@ func main() {
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}`)
|
||||
@@ -2103,6 +2222,11 @@ request.body = JSON.dump({
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -2165,6 +2289,11 @@ RequestBody body = RequestBody.create(mediaType, '{
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}');
|
||||
@@ -2243,6 +2372,11 @@ curl_setopt_array($curl, array(
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}',
|
||||
@@ -2316,6 +2450,11 @@ echo $response;
|
||||
"windows_path": "C:
rogramData
etBird\netbird.exe"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2369,6 +2508,11 @@ echo $response;
|
||||
"windows_path": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"certificate_check": {
|
||||
"ca_certificates": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user