cloudways-js-client
v0.0.47
Published
A client library to power your applications with Cloudways API
Downloads
295
Maintainers
Readme
import { initializeCloudwaysApi } from 'cloudways-js-client';
const email = '[email protected]'; // Replace with your Cloudways account email
const apiKey = 'your_api_key'; // Replace with your Cloudways API key
initializeCloudwaysApi(email, apiKey);
import { deleteServer } from "cloudways-js-client";
async function deleteServerA() {
const serverId = 12345; // Replace with the server ID you want to delete
await deleteServer(serverId);
console.log("Server deleted successfully.");
}
import { getServersList } from "cloudways-js-client";
async function listServers() {
try {
const servers = await getServersList();
console.log("Servers List:", servers);
} catch (error) {
console.error("Error fetching servers list:", error);
}
}
listServers();
async function deleteServerAndGetList() {
const serverId = 12345; // Replace with the server ID to delete
await deleteServer(serverId);
console.log("Server deleted successfully.");
console.log("Updated Servers List:", await getServersList());
}
deleteServerAndGetList();