mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-25 11:56:36 +00:00
switch requests examples to version with values
This commit is contained in:
@@ -296,15 +296,15 @@ curl -X POST https://api.netbird.io/api/rules \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}'
|
||||
```
|
||||
@@ -312,15 +312,15 @@ curl -X POST https://api.netbird.io/api/rules \
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
@@ -351,15 +351,15 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/rules"
|
||||
payload = json.dumps({
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
headers = {
|
||||
@@ -389,15 +389,15 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
@@ -445,15 +445,15 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
@@ -465,15 +465,15 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
@@ -502,15 +502,15 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
|
||||
CURLOPT_POSTFIELDS =>'{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
@@ -887,15 +887,15 @@ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}'
|
||||
```
|
||||
@@ -903,15 +903,15 @@ curl -X PUT https://api.netbird.io/api/rules/{ruleId} \
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
});
|
||||
let config = {
|
||||
@@ -942,15 +942,15 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/rules/{ruleId}"
|
||||
payload = json.dumps({
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
headers = {
|
||||
@@ -980,15 +980,15 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}`)
|
||||
client := &http.Client {
|
||||
@@ -1036,15 +1036,15 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
})
|
||||
response = https.request(request)
|
||||
@@ -1056,15 +1056,15 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
@@ -1093,15 +1093,15 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
|
||||
CURLOPT_POSTFIELDS =>'{
|
||||
"name": "string",
|
||||
"description": "string",
|
||||
"disabled": "boolean",
|
||||
"flow": "string",
|
||||
"name": "Default",
|
||||
"description": "This is a default rule that allows connections between all the resources",
|
||||
"disabled": false,
|
||||
"flow": "bidirect",
|
||||
"sources": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m1"
|
||||
],
|
||||
"destinations": [
|
||||
"string"
|
||||
"ch8i4ug6lnn4g9hqv7m0"
|
||||
]
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
|
||||
Reference in New Issue
Block a user