Create Wireguard Peer

  • Creates a new WireGuard Peer.

  • The full WireGuard Peer needs to be provided to create the object. Optional data will be filled with defaults or left empty.

To create a WireGuard Peer, perform a POST request.

Endpoint

Use the following endpoint to create a WireGuard Peer: https://vpn.de-fra.ionos.com/wireguardgateways/{gatewayId}/peers.

Request

curl --location \
--request POST 'https://vpn.de-fra.ionos.com/wireguardgateways/85c79b4b-5b40-570a-b788-58dd46ea71e2/peers' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \
--header 'Content-Type: application/json' \
--data-raw '{
  "metadata": {},
  "properties": {
    "name": "My Company Gateway Peer",
    "description": "Allows local machine A to connect to Datacenter LAN Y.",
    "endpoint": {
      "host": "198.51.100.0/24",
      "port": 51820
    },
    "allowedIPs": [
      "198.51.100.0/24"
    ],
    "publicKey": "no8iaSEoqfbI6PVYsdEiUU5efYdtKX8VAhKity19MWI="
  }
}'

Below is the list of mandatory body parameters for creating a WireGuard Peer:

Response

201 Successful operation

{
  "id": "b62b3a40-adee-5b6c-b98d-be20bfcbdd91",
  "type": "wireguardpeer",
  "href": "/wireguardgateways/{gatewayId}/peers/b62b3a40-adee-5b6c-b98d-be20bfcbdd91",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "resourceURN": "ionos:<product>:<location>:<contract>:<resource-path>",
    "status": "AVAILABLE",
    "statusMessage": null
  },
  "properties": {
    "name": "My Company Gateway Peer",
    "description": "Allows local machine A to connect to Datacenter LAN Y.",
    "endpoint": {
      "host": "198.51.100.0/24",
      "port": 51820
    },
    "allowedIPs": [
      "198.51.100.0/24"
    ],
    "publicKey": "no8iaSEoqfbI6PVYsdEiUU5efYdtKX8VAhKity19MWI="
  }
}

Result: The WireGuard Peer is successfully created. the id and other details of the created WireGuard Peer are provided in the response.

Last updated