import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.elasticIps.createElasticIp({
data: {
type: "elastic_ips",
attributes: {
projectId: "proj_AoW6vRnwkvLn0",
serverId: "sv_2GmAlJ6BXlK1a",
},
},
});
console.log(result);
}
run();{
"data": {
"id": null,
"type": "elastic_ips",
"attributes": {
"address": "177.54.156.7",
"status": "configuring",
"project": {
"id": "proj_AoW6vRnwkvLn0",
"name": "My Project",
"slug": "my-project"
}
}
}
}Creates a new Elastic IP and assigns it to the specified server. The IP is provisioned asynchronously—the response will show status configuring and the id will be null until provisioning completes.
Note: This feature requires the elastic_ips feature flag to be enabled for your team. Currently only IPv4 /32 addresses in routed mode are supported.
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.elasticIps.createElasticIp({
data: {
type: "elastic_ips",
attributes: {
projectId: "proj_AoW6vRnwkvLn0",
serverId: "sv_2GmAlJ6BXlK1a",
},
},
});
console.log(result);
}
run();{
"data": {
"id": null,
"type": "elastic_ips",
"attributes": {
"address": "177.54.156.7",
"status": "configuring",
"project": {
"id": "proj_AoW6vRnwkvLn0",
"name": "My Project",
"slug": "my-project"
}
}
}
}Was this page helpful?