Skip to main content
GET
/
servers
Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";

const latitudesh = new Latitudesh({
  bearer: process.env["LATITUDESH_BEARER"] ?? "",
});

async function run() {
  const result = await latitudesh.servers.list({
    filterTags: "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();
{
  "data": [
    {
      "id": "sv_WeGoqAanqP7nz",
      "type": "servers",
      "attributes": {
        "tags": [
          {
            "id": "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79",
            "name": "tag1",
            "description": "Autem tempora est aperiam.",
            "color": "#160303"
          },
          {
            "id": "tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
            "name": "tag2",
            "description": "Vitae cupiditate doloribus optio.",
            "color": "#ee6dee"
          }
        ],
        "hostname": "Hostname",
        "label": "832845NODEKG",
        "price": 599,
        "role": "Bare Metal",
        "primary_ipv4": "19.98.98.65",
        "primary_ipv6": "49e5:fef3:7891:16df:ccf6:93bb:a930:4dc0",
        "status": "on",
        "ipmi_status": "Normal",
        "created_at": null,
        "scheduled_deletion_at": null,
        "locked": false,
        "rescue_allowed": false,
        "region": {
          "city": "São Paulo 74",
          "country": "Singapore 66",
          "site": {
            "id": "loc_695BdKjrOevVo",
            "name": "São Paulo 74",
            "slug": "SAO",
            "facility": "São Paulo 74",
            "rack_id": "rack_VLMmAD8EOwop2"
          }
        },
        "team": {
          "id": "team_Ygapr2KkrMur4QneZ00yUEGl4W2",
          "name": "292 Team",
          "slug": "292-team",
          "description": "292 Team",
          "address": "Apt. 180 27016 Chi Prairie, Kenyaport, CA 12866",
          "currency": {
            "id": "cur_AW6Q2D9lqKLpr",
            "code": "BRL",
            "name": "Brazilian Real",
            "currency_id": null
          },
          "status": "verified",
          "feature_flags": [],
          "limits": {
            "bare_metal": null,
            "bare_metal_gpu": 1,
            "virtual_machine": null,
            "virtual_machine_gpu": 3,
            "database": null,
            "filesystem": null,
            "block_storage": null
          }
        },
        "project": {
          "id": "proj_Z8rodmnGq1jLB",
          "name": "Incredible Linen Car",
          "slug": "incredible-linen-car",
          "description": "Lightweight Iron Chair",
          "provisioning_type": "on_demand",
          "billing_type": "Normal",
          "billing_method": "Normal",
          "bandwidth_alert": false,
          "environment": null,
          "billing": {},
          "stats": {
            "databases": 1,
            "ip_addresses": 8,
            "prefixes": 0,
            "servers": 3,
            "storages": 0,
            "virtual_machines": 0,
            "vlans": 0
          }
        },
        "plan": {
          "id": "plan_pbV0Dg1Rd4AWz",
          "name": "g3.h100.small-51",
          "slug": "plan-slug",
          "billing": "hourly"
        },
        "interfaces": [
          {
            "role": "ipmi",
            "name": "IPMI",
            "mac_address": "00:11:22:33:44:55",
            "description": "IPMI Interface"
          },
          {
            "role": "internal",
            "name": "PXE",
            "mac_address": "66:77:88:99:aa:bb",
            "description": "PXE Interface"
          }
        ],
        "operating_system": {
          "name": "Ubuntu (18.04 x64 LTS)",
          "slug": "ubuntu_18_04_x64_lts",
          "version": "18.04 x64 LTS",
          "features": {
            "raid": true,
            "ssh_keys": true
          },
          "distro": {
            "name": "Ubuntu",
            "slug": "ubuntu",
            "series": "bionic"
          }
        },
        "specs": {
          "cpu": "Xeon E-2186G CPU @ 3.80GHz (6 cores)",
          "disk": "500 GB SSD",
          "ram": "32 GB",
          "nic": "",
          "gpu": null
        }
      }
    }
  ],
  "meta": {}
}

Authorizations

Authorization
string
header
required

Query Parameters

filter[project]
string

The project ID or Slug to filter by

filter[region]
string

The region Slug to filter by

filter[hostname]
string

The hostname of server to filter by

filter[created_at_gte]
string

The created at greater than equal date to filter by

filter[created_at_lte]
string

The created at less than equal date to filter by

filter[label]
string

The label of server to filter by

filter[status]
string

The status of server to filter by

filter[plan]
string

The platform/plan name of the server to filter by

filter[gpu]
boolean

Filter by the existence of an associated GPU

filter[ram][eql]
integer

Filter servers with RAM size (in GB) equals the provided value.

filter[ram][gte]
integer

Filter servers with RAM size (in GB) greater than or equal the provided value.

filter[ram][lte]
integer

Filter servers with RAM size (in GB) less than or equal the provided value.

filter[disk]
integer

The disk size in Gigabytes to filter by, should be used with the following options: [eql] to filter for values equal to the provided value. [gte] to filter for values greater than or equal to the provided value. [lte] to filter by values lower than or equal to the provided value.

filter[tags]
string

The tags IDs to filter by, separated by comma, e.g. filter[tags]=tag_1,tag_2will return servers with tag_1 AND tag_2

extra_fields[servers]
string

The credentials are provided as extra attributes that are lazy loaded. To request it, just set extra_fields[servers]=credentials in the query string.

page[size]
integer
default:20

Number of items to return per page

Required range: x >= 1
page[number]
integer
default:1

Page number to return (starts at 1)

Required range: x >= 1

Response

200 - application/vnd.api+json

Success

data
object[]
meta
object