pydo.droplets.list_neighbors()

Description

To retrieve a list of any “neighbors” (i.e. Droplets that are co-located on the same physical hardware) for a specific Droplet, send a GET request to /v2/droplets/$DROPLET_ID/neighbors.

The results will be returned as a JSON object with a key of droplets. This will be set to an array containing objects representing any other Droplets that share the same physical hardware. An empty array indicates that the Droplet is not co-located any other Droplets associated with your account.

Parameters

Name Type Required Description Default Value
droplet_id integer True A unique identifier for a Droplet instance.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

resp = client.droplets.list_neighbors(droplet_id=594828)

More Information

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

In this article...