All URIs are relative to https://api.fvpn.io
| Method | HTTP request | Description |
|---|---|---|
| CreateDevice | Post /v1/devices/ | Create a new account |
| DeleteDevice | Delete /v1/devices/{device_id}/ | Delete a device |
| GetDashboardAnalytics | Get /v1/devices/analytics/dashboard/ | Get device data usage analytics for dashboard |
| GetDevice | Get /v1/devices/{device_id}/ | Retrieve a device |
| GetDeviceAnalytics | Get /v1/devices/{device_id}/analytics/ | Get data usage analytics for a specific device |
| GetDeviceNode | Get /v1/devices/{device_id}/node/ | Get the node of a device |
| GetDevices | Get /v1/devices/ | List all devices |
| PartialUpdateDevice | Patch /v1/devices/{device_id}/ | Partially update a device |
| SetDeviceNode | Post /v1/devices/{device_id}/set-node/ | Set a node on a device |
| UpdateDevice | Put /v1/devices/{device_id}/ | Update a device |
Device CreateDevice(ctx).DeviceRequest(deviceRequest).Execute()
Create a new account
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceRequest := *openapiclient.NewDeviceRequest("PubKey_example") // DeviceRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.CreateDevice(context.Background()).DeviceRequest(deviceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.CreateDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.CreateDevice`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateDeviceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceRequest | DeviceRequest |
- Content-Type: application/json, multipart/form-data, application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteDevice(ctx, deviceId).Execute()
Delete a device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DashboardAnalytics GetDashboardAnalytics(ctx).Top(top).Execute()
Get device data usage analytics for dashboard
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
top := int32(56) // int32 | Number of top devices to include (default: 5) (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.GetDashboardAnalytics(context.Background()).Top(top).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDashboardAnalytics``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDashboardAnalytics`: DashboardAnalytics
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDashboardAnalytics`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetDashboardAnalyticsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| top | int32 | Number of top devices to include (default: 5) |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Device GetDevice(ctx, deviceId).Execute()
Retrieve a device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.GetDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDevice`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiGetDeviceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeviceAnalytics GetDeviceAnalytics(ctx, deviceId).ComparePrevious(comparePrevious).EndDate(endDate).StartDate(startDate).Execute()
Get data usage analytics for a specific device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
comparePrevious := true // bool | Whether to include comparison with previous period (true/false) (optional)
endDate := "endDate_example" // string | End date in ISO format (default: current date and time) (optional)
startDate := "startDate_example" // string | Start date in ISO format (default: 7 days ago) (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.GetDeviceAnalytics(context.Background(), deviceId).ComparePrevious(comparePrevious).EndDate(endDate).StartDate(startDate).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDeviceAnalytics``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDeviceAnalytics`: DeviceAnalytics
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDeviceAnalytics`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiGetDeviceAnalyticsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
comparePrevious | bool | Whether to include comparison with previous period (true/false) | endDate | string | End date in ISO format (default: current date and time) | startDate | string | Start date in ISO format (default: 7 days ago) |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Node GetDeviceNode(ctx, deviceId).Execute()
Get the node of a device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.GetDeviceNode(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDeviceNode``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDeviceNode`: Node
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDeviceNode`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiGetDeviceNodeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedDeviceList GetDevices(ctx).Cursor(cursor).Limit(limit).Execute()
List all devices
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
cursor := "cursor_example" // string | The pagination cursor value. (optional)
limit := int32(56) // int32 | Number of results to return per page. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.GetDevices(context.Background()).Cursor(cursor).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDevices``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDevices`: PaginatedDeviceList
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDevices`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetDevicesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| cursor | string | The pagination cursor value. | |
| limit | int32 | Number of results to return per page. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Device PartialUpdateDevice(ctx, deviceId).PatchedDeviceRequest(patchedDeviceRequest).Execute()
Partially update a device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
patchedDeviceRequest := *openapiclient.NewPatchedDeviceRequest() // PatchedDeviceRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.PartialUpdateDevice(context.Background(), deviceId).PatchedDeviceRequest(patchedDeviceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.PartialUpdateDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PartialUpdateDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.PartialUpdateDevice`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiPartialUpdateDeviceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
patchedDeviceRequest | PatchedDeviceRequest | |
- Content-Type: application/json, multipart/form-data, application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Node SetDeviceNode(ctx, deviceId).SetNodeRequest(setNodeRequest).Execute()
Set a node on a device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
setNodeRequest := *openapiclient.NewSetNodeRequest() // SetNodeRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.SetDeviceNode(context.Background(), deviceId).SetNodeRequest(setNodeRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.SetDeviceNode``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SetDeviceNode`: Node
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.SetDeviceNode`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiSetDeviceNodeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
setNodeRequest | SetNodeRequest | |
- Content-Type: application/json, multipart/form-data, application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Device UpdateDevice(ctx, deviceId).DeviceRequest(deviceRequest).Execute()
Update a device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/forestvpn/fvpn-api-go"
)
func main() {
deviceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | A UUID string identifying this Device.
deviceRequest := *openapiclient.NewDeviceRequest("PubKey_example") // DeviceRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.UpdateDevice(context.Background(), deviceId).DeviceRequest(deviceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.UpdateDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.UpdateDevice`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| deviceId | string | A UUID string identifying this Device. |
Other parameters are passed through a pointer to a apiUpdateDeviceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
deviceRequest | DeviceRequest | |
- Content-Type: application/json, multipart/form-data, application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]