zyhm 中文文档教程
zyhm
这是一个库,允许您远程控制运行 cPanel 的 Web 托管服务器以供个人或机器人使用。
重新编码并修复输出日志: @ihadeed/node-whm
安装
npm i zyhm
使用 JavaScript
var ZYHM = require('zyhm');
var ZYHMClient = new ZYHM.Client({
serverUrl: 'https://myserver.com:2087',
remoteAccessKey: 'remoteAccessKeyHere',
username: 'resellerOrRootUser'
});
ZYHMClient.createAccount({
username: 'myuser',
password: 'mySecurePassword!',
plan: 'Pro',
domain: 'clientdomain.com'
}).then(
function(success){
console.log(success);
// do something with data
},
function(error) {
console.error(error);
// do something with data
}
);
使用 Typescript
import { Client, ZYHMOptions } from 'zyhm';
const ZYHMClientOptions: ZYHMOptions = {
serverUrl: 'https://myserver.com:2087',
remoteAccessKey: 'remoteAccessKeyHere',
username: 'resellerOrRootUser'
};
const client: Client = new Client(ZYHMClientOptions);
client.createAccount({
username: 'myuser',
password: 'mySecurePassword!',
plan: 'Pro',
domain: 'clientdomain.com'
}).then(
success => {
console.log(success);
// do something with data
},
error => {
console.error(error);
// do something with data
}
);
方法调用函数
createAccount(options: CreateAccountOptions): Promise
terminateAccount(user: string): Promise
listAccounts(): Promise;
listIPAddresses(): Promise
接口
TypeScript
WHMOoptions
CreateAccountOptions
<代码>帐户数据
zyhm
This is a library that allows you to remotely control your web hosting server that is running cPanel for personal or bot use.
Recoded and fixing outlog from : @ihadeed/node-whm
Instalation
npm i zyhm
Usage JavaScript
var ZYHM = require('zyhm');
var ZYHMClient = new ZYHM.Client({
serverUrl: 'https://myserver.com:2087',
remoteAccessKey: 'remoteAccessKeyHere',
username: 'resellerOrRootUser'
});
ZYHMClient.createAccount({
username: 'myuser',
password: 'mySecurePassword!',
plan: 'Pro',
domain: 'clientdomain.com'
}).then(
function(success){
console.log(success);
// do something with data
},
function(error) {
console.error(error);
// do something with data
}
);
Usage Typescript
import { Client, ZYHMOptions } from 'zyhm';
const ZYHMClientOptions: ZYHMOptions = {
serverUrl: 'https://myserver.com:2087',
remoteAccessKey: 'remoteAccessKeyHere',
username: 'resellerOrRootUser'
};
const client: Client = new Client(ZYHMClientOptions);
client.createAccount({
username: 'myuser',
password: 'mySecurePassword!',
plan: 'Pro',
domain: 'clientdomain.com'
}).then(
success => {
console.log(success);
// do something with data
},
error => {
console.error(error);
// do something with data
}
);