Update API pages

This commit is contained in:
GitHub Actions
2023-07-24 16:01:31 +00:00
parent 68b67a7a12
commit cf787d83c9
6 changed files with 297 additions and 49 deletions

View File

@@ -166,7 +166,9 @@ echo $response;
"id": "ch8i4ug6lnn4g9hqv7l0", "id": "ch8i4ug6lnn4g9hqv7l0",
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
} }
] ]
@@ -177,7 +179,9 @@ echo $response;
"id": "string", "id": "string",
"settings": { "settings": {
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer" "peer_login_expiration": "integer",
"jwt_groups_enabled": "boolean",
"jwt_groups_claim_name": "string"
} }
} }
] ]
@@ -223,6 +227,20 @@ echo $response;
> >
Period of time after which peer login expires (seconds). Period of time after which peer login expires (seconds).
</Property>
<Property name="jwt_groups_enabled" type="boolean" required={false}
>
Allows extract groups from JWT claim and add it to account groups.
</Property>
<Property name="jwt_groups_claim_name" type="string" required={false}
>
Name of the claim from which we extract groups names to add it to account groups.
</Property> </Property>
</Properties> </Properties>
</Col> </Col>
@@ -237,7 +255,9 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
--data-raw '{ --data-raw '{
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}' }'
``` ```
@@ -247,7 +267,9 @@ const axios = require('axios');
let data = JSON.stringify({ let data = JSON.stringify({
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}); });
let config = { let config = {
@@ -279,7 +301,9 @@ url = "https://api.netbird.io/api/accounts/{accountId}"
payload = json.dumps({ payload = json.dumps({
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}) })
headers: { headers: {
@@ -311,7 +335,9 @@ func main() {
payload := strings.NewReader(`{ payload := strings.NewReader(`{
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}`) }`)
client := &http.Client { client := &http.Client {
@@ -361,7 +387,9 @@ request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({ request.body = JSON.dump({
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}) })
response = https.request(request) response = https.request(request)
@@ -375,7 +403,9 @@ MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{ RequestBody body = RequestBody.create(mediaType, '{
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}'); }');
Request request = new Request.Builder() Request request = new Request.Builder()
@@ -405,7 +435,9 @@ curl_setopt_array($curl, array(
CURLOPT_POSTFIELDS => '{ CURLOPT_POSTFIELDS => '{
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
}', }',
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
@@ -431,7 +463,9 @@ echo $response;
"id": "ch8i4ug6lnn4g9hqv7l0", "id": "ch8i4ug6lnn4g9hqv7l0",
"settings": { "settings": {
"peer_login_expiration_enabled": true, "peer_login_expiration_enabled": true,
"peer_login_expiration": 43200 "peer_login_expiration": 43200,
"jwt_groups_enabled": true,
"jwt_groups_claim_name": "roles"
} }
} }
``` ```
@@ -440,7 +474,9 @@ echo $response;
"id": "string", "id": "string",
"settings": { "settings": {
"peer_login_expiration_enabled": "boolean", "peer_login_expiration_enabled": "boolean",
"peer_login_expiration": "integer" "peer_login_expiration": "integer",
"jwt_groups_enabled": "boolean",
"jwt_groups_claim_name": "string"
} }
} }
``` ```

View File

@@ -166,6 +166,7 @@ echo $response;
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2, "peers_count": 2,
"issued": "api",
"peers": [ "peers": [
{ {
"id": "chacbco6lnnbn6cg5s90", "id": "chacbco6lnnbn6cg5s90",
@@ -181,6 +182,7 @@ echo $response;
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer", "peers_count": "integer",
"issued": "string",
"peers": [ "peers": [
{ {
"id": "string", "id": "string",
@@ -431,6 +433,7 @@ echo $response;
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2, "peers_count": 2,
"issued": "api",
"peers": [ "peers": [
{ {
"id": "chacbco6lnnbn6cg5s90", "id": "chacbco6lnnbn6cg5s90",
@@ -444,6 +447,7 @@ echo $response;
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer", "peers_count": "integer",
"issued": "string",
"peers": [ "peers": [
{ {
"id": "string", "id": "string",
@@ -635,6 +639,7 @@ echo $response;
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2, "peers_count": 2,
"issued": "api",
"peers": [ "peers": [
{ {
"id": "chacbco6lnnbn6cg5s90", "id": "chacbco6lnnbn6cg5s90",
@@ -648,6 +653,7 @@ echo $response;
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer", "peers_count": "integer",
"issued": "string",
"peers": [ "peers": [
{ {
"id": "string", "id": "string",
@@ -905,6 +911,7 @@ echo $response;
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2, "peers_count": 2,
"issued": "api",
"peers": [ "peers": [
{ {
"id": "chacbco6lnnbn6cg5s90", "id": "chacbco6lnnbn6cg5s90",
@@ -918,6 +925,7 @@ echo $response;
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer", "peers_count": "integer",
"issued": "string",
"peers": [ "peers": [
{ {
"id": "string", "id": "string",

View File

@@ -174,7 +174,8 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"ssh_enabled": true, "ssh_enabled": true,
@@ -202,7 +203,8 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"ssh_enabled": "boolean", "ssh_enabled": "boolean",
@@ -407,7 +409,8 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"ssh_enabled": true, "ssh_enabled": true,
@@ -433,7 +436,8 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"ssh_enabled": "boolean", "ssh_enabled": "boolean",
@@ -703,7 +707,8 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"ssh_enabled": true, "ssh_enabled": true,
@@ -729,7 +734,8 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"ssh_enabled": "boolean", "ssh_enabled": "boolean",

View File

@@ -184,14 +184,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -223,14 +225,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }
@@ -672,14 +676,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -709,14 +715,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }
@@ -920,14 +928,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -957,14 +967,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }
@@ -1413,14 +1425,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -1450,14 +1464,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }

View File

@@ -172,14 +172,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -197,14 +199,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }
@@ -527,14 +531,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -550,14 +556,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }
@@ -747,14 +755,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -770,14 +780,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }
@@ -1107,14 +1119,16 @@ echo $response;
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "ch8i4ug6lnn4g9hqv7m0", "id": "ch8i4ug6lnn4g9hqv7m0",
"name": "devs", "name": "devs",
"peers_count": 2 "peers_count": 2,
"issued": "api"
} }
] ]
} }
@@ -1130,14 +1144,16 @@ echo $response;
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
], ],
"destinations": [ "destinations": [
{ {
"id": "string", "id": "string",
"name": "string", "name": "string",
"peers_count": "integer" "peers_count": "integer",
"issued": "string"
} }
] ]
} }

View File

@@ -970,6 +970,172 @@ echo $response;
</Col>
</Row>
---
## Resend user invitation {{ tag: 'POST' , label: '/api/users/{userId}/invite' }}
<Row>
<Col>
Resend user invitation
#### Path Parameters
<Properties>
<Property name="userId" type="string" required={true}>
The unique identifier of a user
</Property>
</Properties>
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/api/users/{userId}/invite">
```bash {{ title: 'cURL' }}
curl -X POST https://api.netbird.io/api/users/{userId}/invite \
-H 'Authorization: Token <TOKEN>'
```
```js
const axios = require('axios');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '/api/users/{userId}/invite',
headers: {
'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/users/{userId}/invite"
headers: {
'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/users/{userId}/invite"
method := "POST"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
{
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/users/{userId}/invite")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
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/users/{userId}/invite")
.method("POST")
.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/users/{userId}/invite',
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(
'Authorization: Token <TOKEN>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
</CodeGroup>
</Col> </Col>
</Row> </Row>