Update API pages with v0.35.2

This commit is contained in:
netbirddev
2024-12-31 18:00:46 +00:00
parent 10df6808a8
commit efe7040e75

View File

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