Ensure Wireguard Peer

Ensures that the Wireguard Peer with the provided ID is created or modified. The full Wireguard Peer needs to be provided to ensure (either update or create) the Wireguard Peer. Non present data will only be filled with defaults or left empty, but not take previous values into consideration.

To ensure that the Wireguard Peer with the provided ID is created or modified, perform PUT request.

Note: If Wireguard Peer for a given peerId does not exist, a new one is created instead.

Endpoint

Use the following endpoint to ensure that Wireguard Peer is created or modified: https://vpn.de-fra.ionos.com/wireguardgateways/{gatewayId}/peers/{peerId}.

Request

Note: The following request contains a sample gatewayId and peerId. Replace them with the gatewayId and peerId values whose information you want to update.

curl --location \
--request PUT 'https://vpn.de-fra.ionos.com/wireguardgateways/85c79b4b-5b40-570a-b788-58dd46ea71e2/peers/b62b3a40-adee-5b6c-b98d-be20bfcbdd91' \
--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": "1.2.3.4",
      "port": 51820
    },
    "allowedIPs": [
      "1.2.3.4/32"
    ],
    "publicKey": "no8iaSEoqfbI6PVYsdEiUU5efYdtKX8VAhKity19MWI="
  }
}'

Below is the list of mandatory path parameters:

Below is the list of fields returned in the response for a WireGuard Peer:

To make authenticated requests to the API, the following fields are mandatory in the request header:

Response

200 Successful operation

Following is an example of when a Wireguard Peer is successfully created.

{
  "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": "1.2.3.4",
      "port": 51820
    },
    "allowedIPs": [
      "1.2.3.4/32"
    ],
    "publicKey": "no8iaSEoqfbI6PVYsdEiUU5efYdtKX8VAhKity19MWI="
  }
}

Result: The Wireguard Peer is successfully updated or created.

Last updated

Revision created

commented latest release