Skip to content

Latest commit

 

History

History
137 lines (88 loc) · 3.42 KB

WireguardApi.md

File metadata and controls

137 lines (88 loc) · 3.42 KB

\WireguardApi

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
GetWireGuardPeerInfo Get /wireguard/peers/{pubKey}/ Wireguard peer info
ListWireGuardPeers Get /wireguard/peers/ Wireguard peers list

GetWireGuardPeerInfo

WireGuardPeerInfo GetWireGuardPeerInfo(ctx, pubKey).Execute()

Wireguard peer info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    pubKey := "pubKey_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WireguardApi.GetWireGuardPeerInfo(context.Background(), pubKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WireguardApi.GetWireGuardPeerInfo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWireGuardPeerInfo`: WireGuardPeerInfo
    fmt.Fprintf(os.Stdout, "Response from `WireguardApi.GetWireGuardPeerInfo`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
pubKey string

Other Parameters

Other parameters are passed through a pointer to a apiGetWireGuardPeerInfoRequest struct via the builder pattern

Name Type Description Notes

Return type

WireGuardPeerInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListWireGuardPeers

[]WireGuardPeerInfo ListWireGuardPeers(ctx).Execute()

Wireguard peers list

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WireguardApi.ListWireGuardPeers(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WireguardApi.ListWireGuardPeers``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListWireGuardPeers`: []WireGuardPeerInfo
    fmt.Fprintf(os.Stdout, "Response from `WireguardApi.ListWireGuardPeers`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListWireGuardPeersRequest struct via the builder pattern

Return type

[]WireGuardPeerInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]