zyhm 中文文档教程

发布于 2年前 浏览 21 项目主页 更新于 2年前

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
           }
       );

Methods Calling Function

createAccount(options: CreateAccountOptions): Promise<any>

terminateAccount(user: string): Promise<any>

listAccounts(): Promise<AccountData[]>

listIPAddresses(): Promise<any>

Interfaces TypeScript

WHMOoptions

CreateAccountOptions

AccountData

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文