Skip to content

upyun-dev/holdcloud-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

holdcloud sdk package

Install

import and constructor

const HoldCloud = require('holdcloud-sdk');
const holdcloud = new HoldCloud(username, password, baseUrl);

methods

Gets a list of services under the specified project

/**
 * @param   {String}  projectId    project id
 * @return  {array}             list
 */
holdcloud.listUnionservices(projectId);

Create the container service under the specified project

/**
 * @param   {String}}  project   project id
 * @param   {Object}   options   app param
 * @return  {integer}           app id
 */
holdcloud.createContainerApp(projectId, options);

Creating a container instance

/**
 * @param   {integer}   appId    app id
 * @param   {Object}   options  instance param
 * @return  {Object}             {}
 */
holdcloud.createContainerAppInstances(appId);

Check to see if the container app name is repeated

/**
 * @param   {string}  projectId  project Id
 * @param   {string}  name       container name
 * @return  {object}             {code: 400, id: 233} || {code: 200, id: null}
 */
holdcloud.checkContainerappsName(projectId, name);

get container instance status

/**
 * @param   {integer}  appId    服务 id
 * @return  {Object}           {state: "Creating"}
 */
holdcloud.getContainerAppState(appId);

Restart the specified service

/**
 * @param  {integer} appId  [app id]
 */
holdcloud.restartContainerApp(appId);

Delete container specified service

/**
 * @param  {integer} appId  [app id]
 */
holdcloud.destroyContainerApp(appId);

Tests

/test/holdcloud.test.js,

constructor

const username = '**@gmail.com';
const password = '*****';
const baseUrl = 'https://console.holdcloud.com/api/v1';
const projectId = 89;
const appId = 133;

run

npm run test

About

厚德云 sdk

Resources

Stars

Watchers

Forks

Packages

No packages published