Dedicated IP

The Dedicated IP (DIP) module manages the full lifecycle of DIP addresses - static IPs reserved exclusively for a specific subscription. It handles assignment, renewal, health monitoring, and VPN protocol configuration retrieval.

Before any IP can be assigned, the subscription must first be unlocked via restoreDips. This populates the local cache and sets the backup encryption password used for all subsequent operations on that subscription.

Assigning a Dedicated IP

The first time a user sets up a Dedicated IP, unlock the subscription and then assign an IP to a chosen location. Use getAvailableDipLocations to let the user pick where they want their IP.

// Fetch available locations and let the user pick one
let locations = try manager.dip().getAvailableDipLocations(
    subscriptionId: subscriptionId
)

// Unlock the subscription
let expiredIps = try manager.dip().restoreDips(
    subscriptionId: subscriptionId,
    backupEncryptionPassword: password
)

// Assign an IP in the chosen location
try manager.dip().assignNewDip(
    subscriptionId: subscriptionId,
    locationId: selectedLocationId
)

If restoreDips or renewDips return a non-empty list of IPs, those reservations have expired due to inactivity.

Renewing reservations

IP reservations expire if not renewed regularly. Call renewDips at least once per day - the SDK handles the check internally, so calling it more frequently is safe.

Checking status and health

Use getDipStatus to get an overview of the subscription's DIP assignments, and getDipHealth to check whether a specific IP is currently reachable.

Read VPN protocols for Dedicated IP

Once an IP is assigned, you can retrieve the available VPN protocols.

Last updated