mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-17 16:06:36 +00:00
Update API pages with v0.35.2
This commit is contained in:
@@ -162,16 +162,15 @@ echo $response;
|
||||
```json {{ title: 'Example' }}
|
||||
[
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"source_posture_checks": [
|
||||
"chacdk86lnnboviihd70"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -187,6 +186,7 @@ echo $response;
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
@@ -221,16 +221,15 @@ echo $response;
|
||||
```json {{ title: 'Schema' }}
|
||||
[
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
"id": "string",
|
||||
"source_posture_checks": [
|
||||
"string"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
@@ -246,6 +245,7 @@ echo $response;
|
||||
"end": "integer"
|
||||
}
|
||||
],
|
||||
"id": "string",
|
||||
"sources": [
|
||||
{
|
||||
"id": "string",
|
||||
@@ -294,17 +294,12 @@ echo $response;
|
||||
|
||||
### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="id" type="string" required={false}>
|
||||
|
||||
Policy ID
|
||||
|
||||
</Property>
|
||||
<Property name="name" type="string" required={true}>
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Policy name identifier
|
||||
|
||||
</Property>
|
||||
<Property name="description" type="string" required={true}>
|
||||
<Property name="description" type="string" required={false}>
|
||||
|
||||
Policy friendly description
|
||||
|
||||
@@ -325,12 +320,7 @@ echo $response;
|
||||
<summary>Policy rule object for policy UI editor</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="id" type="string" required={false}>
|
||||
|
||||
Policy rule ID
|
||||
|
||||
</Property>
|
||||
<Property name="name" type="string" required={true}>
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Policy rule name identifier
|
||||
|
||||
@@ -387,59 +377,20 @@ echo $response;
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
<Property name="sources" type="string[]" required={false}>
|
||||
<Property name="id" type="string" required={false}>
|
||||
|
||||
Policy rule ID
|
||||
|
||||
</Property>
|
||||
<Property name="sources" type="string[]" required={true}>
|
||||
|
||||
Policy rule source group IDs
|
||||
|
||||
</Property>
|
||||
<Property name="sourceResource" type="object" required={false}>
|
||||
|
||||
<details class="custom-details" open>
|
||||
<summary>More Information</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="id" type="string" required={true}>
|
||||
|
||||
ID of the resource
|
||||
|
||||
</Property>
|
||||
<Property name="type" type="string" required={true} enumList={["host","subnet","domain"]}>
|
||||
|
||||
Network resource type based of the address
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
<Property name="destinations" type="string[]" required={false}>
|
||||
<Property name="destinations" type="string[]" required={true}>
|
||||
|
||||
Policy rule destination group IDs
|
||||
|
||||
</Property>
|
||||
<Property name="destinationResource" type="object" required={false}>
|
||||
|
||||
<details class="custom-details" open>
|
||||
<summary>More Information</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="id" type="string" required={true}>
|
||||
|
||||
ID of the resource
|
||||
|
||||
</Property>
|
||||
<Property name="type" type="string" required={true} enumList={["host","subnet","domain"]}>
|
||||
|
||||
Network resource type based of the address
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
@@ -460,7 +411,6 @@ curl -X POST https://api.netbird.io/api/policies \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -469,7 +419,6 @@ curl -X POST https://api.netbird.io/api/policies \
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -485,20 +434,13 @@ curl -X POST https://api.netbird.io/api/policies \
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}'
|
||||
@@ -507,7 +449,6 @@ curl -X POST https://api.netbird.io/api/policies \
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -516,7 +457,6 @@ let data = JSON.stringify({
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -532,20 +472,13 @@ let data = JSON.stringify({
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -576,7 +509,6 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/policies"
|
||||
payload = json.dumps({
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -585,7 +517,6 @@ payload = json.dumps({
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -601,20 +532,13 @@ payload = json.dumps({
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -645,7 +569,6 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -654,7 +577,6 @@ func main() {
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -670,20 +592,13 @@ func main() {
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}`)
|
||||
@@ -732,7 +647,6 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -741,7 +655,6 @@ request.body = JSON.dump({
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -757,20 +670,13 @@ request.body = JSON.dump({
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -783,7 +689,6 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -792,7 +697,6 @@ RequestBody body = RequestBody.create(mediaType, '{
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -808,20 +712,13 @@ RequestBody body = RequestBody.create(mediaType, '{
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}');
|
||||
@@ -850,7 +747,6 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -859,7 +755,6 @@ curl_setopt_array($curl, array(
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -875,20 +770,13 @@ curl_setopt_array($curl, array(
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}',
|
||||
@@ -911,16 +799,15 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"source_posture_checks": [
|
||||
"chacdk86lnnboviihd70"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -936,6 +823,7 @@ echo $response;
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
@@ -968,16 +856,15 @@ echo $response;
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
"id": "string",
|
||||
"source_posture_checks": [
|
||||
"string"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
@@ -993,6 +880,7 @@ echo $response;
|
||||
"end": "integer"
|
||||
}
|
||||
],
|
||||
"id": "string",
|
||||
"sources": [
|
||||
{
|
||||
"id": "string",
|
||||
@@ -1199,16 +1087,15 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"source_posture_checks": [
|
||||
"chacdk86lnnboviihd70"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1224,6 +1111,7 @@ echo $response;
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
@@ -1256,16 +1144,15 @@ echo $response;
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
"id": "string",
|
||||
"source_posture_checks": [
|
||||
"string"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
@@ -1281,6 +1168,7 @@ echo $response;
|
||||
"end": "integer"
|
||||
}
|
||||
],
|
||||
"id": "string",
|
||||
"sources": [
|
||||
{
|
||||
"id": "string",
|
||||
@@ -1336,17 +1224,12 @@ echo $response;
|
||||
|
||||
### Request-Body Parameters
|
||||
|
||||
<Properties><Property name="id" type="string" required={false}>
|
||||
|
||||
Policy ID
|
||||
|
||||
</Property>
|
||||
<Property name="name" type="string" required={true}>
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Policy name identifier
|
||||
|
||||
</Property>
|
||||
<Property name="description" type="string" required={true}>
|
||||
<Property name="description" type="string" required={false}>
|
||||
|
||||
Policy friendly description
|
||||
|
||||
@@ -1367,12 +1250,7 @@ echo $response;
|
||||
<summary>Policy rule object for policy UI editor</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="id" type="string" required={false}>
|
||||
|
||||
Policy rule ID
|
||||
|
||||
</Property>
|
||||
<Property name="name" type="string" required={true}>
|
||||
<Properties><Property name="name" type="string" required={true}>
|
||||
|
||||
Policy rule name identifier
|
||||
|
||||
@@ -1429,59 +1307,20 @@ echo $response;
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
<Property name="sources" type="string[]" required={false}>
|
||||
<Property name="id" type="string" required={false}>
|
||||
|
||||
Policy rule ID
|
||||
|
||||
</Property>
|
||||
<Property name="sources" type="string[]" required={true}>
|
||||
|
||||
Policy rule source group IDs
|
||||
|
||||
</Property>
|
||||
<Property name="sourceResource" type="object" required={false}>
|
||||
|
||||
<details class="custom-details" open>
|
||||
<summary>More Information</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="id" type="string" required={true}>
|
||||
|
||||
ID of the resource
|
||||
|
||||
</Property>
|
||||
<Property name="type" type="string" required={true} enumList={["host","subnet","domain"]}>
|
||||
|
||||
Network resource type based of the address
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
<Property name="destinations" type="string[]" required={false}>
|
||||
<Property name="destinations" type="string[]" required={true}>
|
||||
|
||||
Policy rule destination group IDs
|
||||
|
||||
</Property>
|
||||
<Property name="destinationResource" type="object" required={false}>
|
||||
|
||||
<details class="custom-details" open>
|
||||
<summary>More Information</summary>
|
||||
<Properties>
|
||||
|
||||
<Properties><Property name="id" type="string" required={true}>
|
||||
|
||||
ID of the resource
|
||||
|
||||
</Property>
|
||||
<Property name="type" type="string" required={true} enumList={["host","subnet","domain"]}>
|
||||
|
||||
Network resource type based of the address
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
</Properties>
|
||||
</details>
|
||||
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
@@ -1502,7 +1341,6 @@ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Authorization: Token <TOKEN>' \
|
||||
--data-raw '{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1511,7 +1349,6 @@ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1527,20 +1364,13 @@ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}'
|
||||
@@ -1549,7 +1379,6 @@ curl -X PUT https://api.netbird.io/api/policies/{policyId} \
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1558,7 +1387,6 @@ let data = JSON.stringify({
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1574,20 +1402,13 @@ let data = JSON.stringify({
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -1618,7 +1439,6 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/policies/{policyId}"
|
||||
payload = json.dumps({
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1627,7 +1447,6 @@ payload = json.dumps({
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1643,20 +1462,13 @@ payload = json.dumps({
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -1687,7 +1499,6 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1696,7 +1507,6 @@ func main() {
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1712,20 +1522,13 @@ func main() {
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}`)
|
||||
@@ -1774,7 +1577,6 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1783,7 +1585,6 @@ request.body = JSON.dump({
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1799,20 +1600,13 @@ request.body = JSON.dump({
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -1825,7 +1619,6 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1834,7 +1627,6 @@ RequestBody body = RequestBody.create(mediaType, '{
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1850,20 +1642,13 @@ RequestBody body = RequestBody.create(mediaType, '{
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}');
|
||||
@@ -1892,7 +1677,6 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1901,7 +1685,6 @@ curl_setopt_array($curl, array(
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1917,20 +1700,13 @@ curl_setopt_array($curl, array(
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
"ch8i4ug6lnn4g9hqv797"
|
||||
],
|
||||
"sourceResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
},
|
||||
"destinations": [
|
||||
"ch8i4ug6lnn4g9h7v7m0"
|
||||
],
|
||||
"destinationResource": {
|
||||
"id": "chacdk86lnnboviihd7g",
|
||||
"type": "host"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}',
|
||||
@@ -1953,16 +1729,15 @@ echo $response;
|
||||
<CodeGroup title="Response">
|
||||
```json {{ title: 'Example' }}
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"description": "This is a default policy that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"source_posture_checks": [
|
||||
"chacdk86lnnboviihd70"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"enabled": true,
|
||||
@@ -1978,6 +1753,7 @@ echo $response;
|
||||
"end": 320
|
||||
}
|
||||
],
|
||||
"id": "ch8i4ug6lnn4g9hqv7mg",
|
||||
"sources": [
|
||||
{
|
||||
"id": "ch8i4ug6lnn4g9hqv7m0",
|
||||
@@ -2010,16 +1786,15 @@ echo $response;
|
||||
```
|
||||
```json {{ title: 'Schema' }}
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
"id": "string",
|
||||
"source_posture_checks": [
|
||||
"string"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"enabled": "boolean",
|
||||
@@ -2035,6 +1810,7 @@ echo $response;
|
||||
"end": "integer"
|
||||
}
|
||||
],
|
||||
"id": "string",
|
||||
"sources": [
|
||||
{
|
||||
"id": "string",
|
||||
|
||||
Reference in New Issue
Block a user