@panda-clouds/docker-machine
v1.5.0
Published
allows the use of docker-machine from node
Downloads
3
Readme
PCDockerMachine
maintained by PandaClouds.com
PCDockerMachine
provides a clean way to validate data in Parse Sever Cloud Code.
Installation
If you want to use this library, you first need to install the Node.js.
When you install node.js, will also be installed npm.
Please run the following command.
npm install --save @panda-clouds/docker-machine
Usage
Node.js
const PCDockerMachine = require('@panda-clouds/docker-machine');
const options = {};
options['digitalocean-access-token'] = '< my DigitalOcean Token >';
// Create the machine on Digital Ocean
const machine = await DockerMachine.create('machine-test', 'digitalocean', options);
const status = await machine.status(); // => 'Running'
const IPv4 = await machine.getIPv4(); // => '123.234.321.21'
const allMachines = await Machine.ls(); // => [{'name':'machine-test'...},{'name':'other-machine'...}]
// Destroy the machine
await machine.destroy();
const status = await machine.status(); // => 'Machine Not Found'
You can replace PCDockerMachine with any variable.
Methods
Unit Tests are an additional resource for learning functionality.
- status()
returns the status of the machine
Example:
const status = await machine.status() // => 'Running'
Contributions
Pull requests are welcome! here is a checklist to speed things up:
- modify
PCDockerMachine.js
- add unit tests in
PCDockerMachine.spec.js
- run
npm test
- document method in
README.md
- add your name to 'Contributors' in
README.md
Contributors
(Add your name)
- [*] Marc Smith