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": 5,
"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": {}
}Returns a list of all servers belonging to the team.
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": 5,
"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": {}
}The project ID or Slug to filter by
The region Slug to filter by
The hostname of server to filter by
The created at greater than equal date to filter by
The created at less than equal date to filter by
The label of server to filter by
The status of server to filter by
The platform/plan name of the server to filter by
Filter by the existence of an associated GPU
Filter servers with RAM size (in GB) equals the provided value.
Filter servers with RAM size (in GB) greater than or equal the provided value.
Filter servers with RAM size (in GB) less than or equal the provided value.
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.
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
The credentials are provided as extra attributes that are lazy loaded. To request it, just set extra_fields[servers]=credentials in the query string.
Number of items to return per page
x >= 1Page number to return (starts at 1)
x >= 1Was this page helpful?