-
Notifications
You must be signed in to change notification settings - Fork 0
Servers
OnCloud edited this page Jan 3, 2025
·
2 revisions
Important
Before making API calls, client must be initialized.
const name = "my-server"; // Server name
const hostname = "my-server.example.com"; // FQDN
const operatingSystemId = 1; // ID of the operating system template. Which can be found in Dashboard > Operating System Templates, the ending number of the URL.
const sshKeys = [1, 2, 3]; // IDs of the SSH keys
const serverBuild = await virtfusion.server.build(serverCreate.data.id, {
name,
hostname,
operatingSystemId,
sshKeys,
});
const packageId = 1; // ID of the package
const userId = 1; // ID of the user
const hypervisorId = 1; // ID of the hypervisor
const serverCreate = await virtfusion.server.create({
packageId,
userId,
hypervisorId,
ipv4: 1, // Number of IPv4 address
});
const serverId = 1; // ID of the server
const delay = 0; // Delay in minutes
const serverDelete = await virtfusion.server.delete(serverId, 0);
const responseType = "simple"; // "full" or "simple"
const serverList = await virtfusion.server.list({
responseType,
page: 1,
limit: 5,
});
const serverId = 1; // ID of the server
const serverData = await virtfusion.server.retrieve(serverId);
const serverId = 1; // ID of the server
const serverTraffic = await virtfusion.server.traffic(serverId);
Note
The project is under active development, with features being implemented incrementally. For detailed features support list, please refer to the Roadmap Page.