https://github.com/yunionio/mcclient_nodejs
Nodejs SDK for Cloudpods API
https://github.com/yunionio/mcclient_nodejs
api cloudpods hybridcloud multicloud nodejs sdk
Last synced: 22 days ago
JSON representation
Nodejs SDK for Cloudpods API
- Host: GitHub
- URL: https://github.com/yunionio/mcclient_nodejs
- Owner: yunionio
- License: apache-2.0
- Created: 2021-08-22T00:14:45.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-11-23T15:36:21.000Z (7 months ago)
- Last Synced: 2025-11-23T17:26:10.695Z (7 months ago)
- Topics: api, cloudpods, hybridcloud, multicloud, nodejs, sdk
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nodejs SDK for Cloudpods API
This repository provides Nodejs SDK for Cloudpods API.
Based on the SDK, a simple nodejs version of climc was implemented as a usage example of SDK.
## Setup
```bash
npm install
```
## run climc of nodejs version
```bash
./bin/climc server-list
```
## use SDK in your nodejs program
```javascript
const client = require('mcclient/client');
let cli = new client.Client(os_auth_url, timeout, debug);
cli.auth(os_username, os_password, os_domain, os_project_id, os_project_name, os_project_domain)
.then((token) => {
let s = cli.session(os_region_name, os_zone_name, os_endpoint_type, token, api_version);
s.module("servers").list({limit: 100})
.then((result) => {
const misc = require("mcclient/misc");
misc.printList(result, cli.module('servers').columns());
})
}).catch((err) => {
console.error("Invalid credential:" + err);
});
```
## Note: nodejs version of mcclient is experimental, you are welcome to contribe to make it complete