Update API pages with v0.32.0

This commit is contained in:
netbirddev
2024-11-15 22:25:53 +00:00
parent 02585bd085
commit 0b556223a8

View File

@@ -760,22 +760,7 @@ echo $response;
#### Request-Body Parameters
<Properties><Property name="name" type="string" required={true}>
Setup Key name
</Property>
<Property name="type" type="string" required={true}>
Setup key type, one-off for single time usage and reusable
</Property>
<Property name="expires_in" type="integer" required={true} min={0}>
Expiration time in seconds, 0 will mean the key never expires
</Property>
<Property name="revoked" type="boolean" required={true}>
<Properties><Property name="revoked" type="boolean" required={true}>
Setup key revocation status
@@ -784,16 +769,6 @@ echo $response;
List of group IDs to auto-assign to peers registered with this key
</Property>
<Property name="usage_limit" type="integer" required={true}>
A number of times this key can be used. The value of 0 indicates the unlimited usage.
</Property>
<Property name="ephemeral" type="boolean" required={false}>
Indicate that the peer will be ephemeral or not
</Property>
</Properties>
@@ -808,30 +783,20 @@ curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \
-H 'Content-Type: application/json' \
-H 'Authorization: Token <TOKEN>' \
--data-raw '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
});
let config = {
method: 'put',
@@ -860,15 +825,10 @@ import json
url = "https://api.netbird.io/api/setup-keys/{keyId}"
payload = json.dumps({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
})
headers = {
'Content-Type': 'application/json',
@@ -897,15 +857,10 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
}`)
client := &http.Client {
}
@@ -952,15 +907,10 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
})
response = https.request(request)
puts response.read_body
@@ -971,15 +921,10 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/setup-keys/{keyId}")
@@ -1006,15 +951,10 @@ curl_setopt_array($curl, array(
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => '{
"name": "Default key",
"type": "reusable",
"expires_in": 86400,
"revoked": false,
"auto_groups": [
"ch8i4ug6lnn4g9hqv7m0"
],
"usage_limit": 0,
"ephemeral": true
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',