Skip to content
  • Auto
  • Light
  • Dark

List Neighbors

List Neighbors for a Droplet
gpu_droplets.list_neighbors(intdroplet_id) -> GPUDropletListNeighborsResponse
get/v2/droplets/{droplet_id}/neighbors

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.

ParametersExpand Collapse
droplet_id: int
ReturnsExpand Collapse
class GPUDropletListNeighborsResponse:
droplets: Optional[List[Droplet]]
id: int

A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.

backup_ids: List[int]

An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires image:read scope.

created_at: datetime

A time value given in ISO8601 combined date and time format that represents when the Droplet was created.

formatdate-time
disk: int

The size of the Droplet's disk in gigabytes.

features: List[str]

An array of features enabled on this Droplet.

image: Image

The Droplet's image.
Requires image:read scope.

locked: bool

A boolean value indicating whether the Droplet has been locked, preventing actions by users.

memory: int

Memory of the Droplet in megabytes.

multipleOf8
name: str

The human-readable name set for the Droplet instance.

networks: Networks

The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.

v4: Optional[List[NetworkV4]]
gateway: Optional[str]

The gateway of the specified IPv4 network interface.

For private interfaces, a gateway is not provided. This is denoted by returning nil as its value.

ip_address: Optional[str]

The IP address of the IPv4 network interface.

formatipv4
netmask: Optional[str]

The netmask of the IPv4 network interface.

formatipv4
type: Optional[Literal["public", "private"]]

The type of the IPv4 network interface.

Accepts one of the following:
"public"
"private"
v6: Optional[List[NetworkV6]]
gateway: Optional[str]

The gateway of the specified IPv6 network interface.

formatipv6
ip_address: Optional[str]

The IP address of the IPv6 network interface.

formatipv6
netmask: Optional[int]

The netmask of the IPv6 network interface.

type: Optional[Literal["public"]]

The type of the IPv6 network interface.

Note: IPv6 private networking is not currently supported.

Accepts one of the following:
"public"
next_backup_window: Optional[DropletNextBackupWindow]

The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.

region: Region
size: Size
size_slug: str

The unique slug identifier for the size of this Droplet.

snapshot_ids: List[int]

An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires image:read scope.

status: Literal["new", "active", "off", "archive"]

A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".

Accepts one of the following:
"new"
"active"
"off"
"archive"
tags: List[str]

An array of Tags the Droplet has been tagged with.
Requires tag:read scope.

vcpus: int

The number of virtual CPUs.

volume_ids: List[str]

A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires block_storage:read scope.

disk_info: Optional[List[DiskInfo]]

An array of objects containing information about the disks available to the Droplet.

size: Optional[Size]
amount: Optional[int]

The amount of space allocated to the disk.

unit: Optional[str]

The unit of measure for the disk size.

type: Optional[Literal["local", "scratch"]]

The type of disk. All Droplets contain a local disk. Additionally, GPU Droplets can also have a scratch disk for non-persistent data.

Accepts one of the following:
"local"
"scratch"
gpu_info: Optional[GPUInfo]

An object containing information about the GPU capabilities of Droplets created with this size.

Deprecatedkernel: Optional[Kernel]

Note: All Droplets created after March 2017 use internal kernels by default. These Droplets will have this attribute set to null.

The current kernel for Droplets with externally managed kernels. This will initially be set to the kernel of the base image when the Droplet is created.

vpc_uuid: Optional[str]

A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires vpc:read scope.

from gradient import Gradient

client = Gradient()
response = client.gpu_droplets.list_neighbors(
    1,
)
print(response.droplets)
{
  "droplets": [
    {
      "id": 3164444,
      "backup_ids": [
        53893572
      ],
      "created_at": "2020-07-21T18:37:44Z",
      "disk": 25,
      "features": [
        "backups",
        "private_networking",
        "ipv6"
      ],
      "image": {
        "created_at": "2020-05-04T22:23:02Z",
        "description": " ",
        "distribution": "Ubuntu",
        "error_message": " ",
        "min_disk_size": 20,
        "name": "Nifty New Snapshot",
        "public": true,
        "regions": [
          "nyc1",
          "nyc2"
        ],
        "size_gigabytes": 2.34,
        "slug": "nifty1",
        "status": "NEW",
        "tags": [
          "base-image",
          "prod"
        ],
        "type": "snapshot"
      },
      "locked": false,
      "memory": 1024,
      "name": "example.com",
      "networks": {
        "v4": [
          {
            "gateway": "104.236.0.1",
            "ip_address": "104.236.32.182",
            "netmask": "255.255.192.0",
            "type": "public"
          }
        ],
        "v6": [
          {
            "gateway": "2604:a880:0:1010::1",
            "ip_address": "2604:a880:0:1010::18a:a001",
            "netmask": 64,
            "type": "public"
          }
        ]
      },
      "next_backup_window": {
        "end": "2019-12-04T23:00:00Z",
        "start": "2019-12-04T00:00:00Z"
      },
      "region": {
        "available": true,
        "features": [
          "private_networking",
          "backups",
          "ipv6",
          "metadata",
          "install_agent",
          "storage",
          "image_transfer"
        ],
        "name": "New York 3",
        "sizes": [
          "s-1vcpu-1gb",
          "s-1vcpu-2gb",
          "s-1vcpu-3gb",
          "s-2vcpu-2gb",
          "s-3vcpu-1gb",
          "s-2vcpu-4gb",
          "s-4vcpu-8gb",
          "s-6vcpu-16gb",
          "s-8vcpu-32gb",
          "s-12vcpu-48gb",
          "s-16vcpu-64gb",
          "s-20vcpu-96gb",
          "s-24vcpu-128gb",
          "s-32vcpu-192g"
        ],
        "slug": "nyc3"
      },
      "size": {
        "available": true,
        "description": "Basic",
        "disk": 25,
        "memory": 1024,
        "price_hourly": 0.00743999984115362,
        "price_monthly": 5,
        "regions": [
          "ams2",
          "ams3",
          "blr1",
          "fra1",
          "lon1",
          "nyc1",
          "nyc2",
          "nyc3",
          "sfo1",
          "sfo2",
          "sfo3",
          "sgp1",
          "tor1"
        ],
        "slug": "s-1vcpu-1gb",
        "transfer": 1,
        "vcpus": 1,
        "disk_info": [
          {
            "size": {
              "amount": 25,
              "unit": "gib"
            },
            "type": "local"
          }
        ],
        "gpu_info": {
          "count": 1,
          "model": "nvidia_h100",
          "vram": {
            "amount": 25,
            "unit": "gib"
          }
        }
      },
      "size_slug": "s-1vcpu-1gb",
      "snapshot_ids": [
        67512819
      ],
      "status": "active",
      "tags": [
        "web",
        "env:prod"
      ],
      "vcpus": 1,
      "volume_ids": [
        "506f78a4-e098-11e5-ad9f-000f53306ae1"
      ],
      "disk_info": [
        {
          "size": {
            "amount": 25,
            "unit": "gib"
          },
          "type": "local"
        }
      ],
      "gpu_info": {
        "count": 1,
        "model": "nvidia_h100",
        "vram": {
          "amount": 25,
          "unit": "gib"
        }
      },
      "kernel": {
        "id": 7515,
        "name": "DigitalOcean GrubLoader v0.2 (20160714)",
        "version": "2016.07.13-DigitalOcean_loader_Ubuntu"
      },
      "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000"
    }
  ]
}
Returns Examples
{
  "droplets": [
    {
      "id": 3164444,
      "backup_ids": [
        53893572
      ],
      "created_at": "2020-07-21T18:37:44Z",
      "disk": 25,
      "features": [
        "backups",
        "private_networking",
        "ipv6"
      ],
      "image": {
        "created_at": "2020-05-04T22:23:02Z",
        "description": " ",
        "distribution": "Ubuntu",
        "error_message": " ",
        "min_disk_size": 20,
        "name": "Nifty New Snapshot",
        "public": true,
        "regions": [
          "nyc1",
          "nyc2"
        ],
        "size_gigabytes": 2.34,
        "slug": "nifty1",
        "status": "NEW",
        "tags": [
          "base-image",
          "prod"
        ],
        "type": "snapshot"
      },
      "locked": false,
      "memory": 1024,
      "name": "example.com",
      "networks": {
        "v4": [
          {
            "gateway": "104.236.0.1",
            "ip_address": "104.236.32.182",
            "netmask": "255.255.192.0",
            "type": "public"
          }
        ],
        "v6": [
          {
            "gateway": "2604:a880:0:1010::1",
            "ip_address": "2604:a880:0:1010::18a:a001",
            "netmask": 64,
            "type": "public"
          }
        ]
      },
      "next_backup_window": {
        "end": "2019-12-04T23:00:00Z",
        "start": "2019-12-04T00:00:00Z"
      },
      "region": {
        "available": true,
        "features": [
          "private_networking",
          "backups",
          "ipv6",
          "metadata",
          "install_agent",
          "storage",
          "image_transfer"
        ],
        "name": "New York 3",
        "sizes": [
          "s-1vcpu-1gb",
          "s-1vcpu-2gb",
          "s-1vcpu-3gb",
          "s-2vcpu-2gb",
          "s-3vcpu-1gb",
          "s-2vcpu-4gb",
          "s-4vcpu-8gb",
          "s-6vcpu-16gb",
          "s-8vcpu-32gb",
          "s-12vcpu-48gb",
          "s-16vcpu-64gb",
          "s-20vcpu-96gb",
          "s-24vcpu-128gb",
          "s-32vcpu-192g"
        ],
        "slug": "nyc3"
      },
      "size": {
        "available": true,
        "description": "Basic",
        "disk": 25,
        "memory": 1024,
        "price_hourly": 0.00743999984115362,
        "price_monthly": 5,
        "regions": [
          "ams2",
          "ams3",
          "blr1",
          "fra1",
          "lon1",
          "nyc1",
          "nyc2",
          "nyc3",
          "sfo1",
          "sfo2",
          "sfo3",
          "sgp1",
          "tor1"
        ],
        "slug": "s-1vcpu-1gb",
        "transfer": 1,
        "vcpus": 1,
        "disk_info": [
          {
            "size": {
              "amount": 25,
              "unit": "gib"
            },
            "type": "local"
          }
        ],
        "gpu_info": {
          "count": 1,
          "model": "nvidia_h100",
          "vram": {
            "amount": 25,
            "unit": "gib"
          }
        }
      },
      "size_slug": "s-1vcpu-1gb",
      "snapshot_ids": [
        67512819
      ],
      "status": "active",
      "tags": [
        "web",
        "env:prod"
      ],
      "vcpus": 1,
      "volume_ids": [
        "506f78a4-e098-11e5-ad9f-000f53306ae1"
      ],
      "disk_info": [
        {
          "size": {
            "amount": 25,
            "unit": "gib"
          },
          "type": "local"
        }
      ],
      "gpu_info": {
        "count": 1,
        "model": "nvidia_h100",
        "vram": {
          "amount": 25,
          "unit": "gib"
        }
      },
      "kernel": {
        "id": 7515,
        "name": "DigitalOcean GrubLoader v0.2 (20160714)",
        "version": "2016.07.13-DigitalOcean_loader_Ubuntu"
      },
      "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000"
    }
  ]
}