Update the WireGuard Peer
Update the WireGuard peer.
PATCH
/
wireguard_peers
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const wireguardPeer = await client.wireguardPeers.update('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
wireguard_peer = client.wireguard_peers.update(
id="6a09cdc3-8948-47f0-aa62-74ac943d6c58",
)
print(wireguard_peer.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
wireguardPeer, err := client.WireguardPeers.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.WireguardPeerUpdateParams{
WireguardPeerPatch: telnyx.WireguardPeerPatchParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardPeer.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.wireguardpeers.WireguardPeerPatch;
import com.telnyx.sdk.models.wireguardpeers.WireguardPeerUpdateParams;
import com.telnyx.sdk.models.wireguardpeers.WireguardPeerUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
WireguardPeerUpdateParams params = WireguardPeerUpdateParams.builder()
.id("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
.wireguardPeerPatch(WireguardPeerPatch.builder().build())
.build();
WireguardPeerUpdateResponse wireguardPeer = client.wireguardPeers().update(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
wireguard_peer = telnyx.wireguard_peers.update("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
puts(wireguard_peer)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$wireguardPeer = $client->wireguardPeers->update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
publicKey: 'qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=',
);
var_dump($wireguardPeer);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx wireguard-peers update \
--api-key 'My API Key' \
--id 6a09cdc3-8948-47f0-aa62-74ac943d6c58curl --request PATCH \
--url https://api.telnyx.com/v2/wireguard_peers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
'{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "wireguard_peer",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
"last_seen": "2018-02-02T22:25:27.521Z",
"wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifies the resource.
Example:
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Body
application/json
The WireGuard PublicKey.
If you do not provide a Public Key, a new Public and Private key pair will be generated for you.
Example:
"qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const wireguardPeer = await client.wireguardPeers.update('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
wireguard_peer = client.wireguard_peers.update(
id="6a09cdc3-8948-47f0-aa62-74ac943d6c58",
)
print(wireguard_peer.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
wireguardPeer, err := client.WireguardPeers.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.WireguardPeerUpdateParams{
WireguardPeerPatch: telnyx.WireguardPeerPatchParam{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wireguardPeer.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.wireguardpeers.WireguardPeerPatch;
import com.telnyx.sdk.models.wireguardpeers.WireguardPeerUpdateParams;
import com.telnyx.sdk.models.wireguardpeers.WireguardPeerUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
WireguardPeerUpdateParams params = WireguardPeerUpdateParams.builder()
.id("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
.wireguardPeerPatch(WireguardPeerPatch.builder().build())
.build();
WireguardPeerUpdateResponse wireguardPeer = client.wireguardPeers().update(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
wireguard_peer = telnyx.wireguard_peers.update("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
puts(wireguard_peer)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$wireguardPeer = $client->wireguardPeers->update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
publicKey: 'qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=',
);
var_dump($wireguardPeer);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx wireguard-peers update \
--api-key 'My API Key' \
--id 6a09cdc3-8948-47f0-aa62-74ac943d6c58curl --request PATCH \
--url https://api.telnyx.com/v2/wireguard_peers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
'{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "wireguard_peer",
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"public_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU=",
"last_seen": "2018-02-02T22:25:27.521Z",
"wireguard_interface_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"private_key": "qF4EqlZq+5JL2IKYY8ij49daYyfKVhevJrcDxdqC8GU="
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}