Skip to content

Commit 8a30d25

Browse files
committed
Initial commit to add orchestration support to cli
1 parent c9f3ca6 commit 8a30d25

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

bin/pkgcloud

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ program
1111
.command('database', 'Database commands')
1212
.command('dns', 'DNS commands')
1313
.command('network', 'Network commands')
14+
.command('orchestration', 'Heat commands')
1415
.parse(process.argv);

bin/pkgcloud-orchestration

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env node
2+
var program = require('commander');
3+
4+
program
5+
.command('list-stacks', 'List stacks')
6+
.command('get-stack', 'Get stack')
7+
.command('create-stack', 'Create stack')
8+
.command('update-stack', 'Update stack')
9+
.command('delete-stack', 'Delete stack')
10+
.command('get-template', 'Get template')
11+
.command('validate-template', 'Validate template')
12+
.parse(process.argv);

helpers.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ var exports = {};
1111
var client;
1212

1313
var CLIENT_TYPES = {
14-
'compute' : 'COMPUTE',
15-
'database' : 'DATABASE',
16-
'storage' : 'STORAGE',
17-
'dns' : 'DNS',
18-
'network' : 'NETWORK'
14+
'compute' : 'COMPUTE',
15+
'database' : 'DATABASE',
16+
'storage' : 'STORAGE',
17+
'dns' : 'DNS',
18+
'network' : 'NETWORK',
19+
'orchestration' : 'ORCHESTRATION'
1920
};
2021

2122
exports.CLIENT_TYPES = CLIENT_TYPES;
@@ -71,7 +72,9 @@ exports.init = function(config, type, callback) {
7172
if (type === CLIENT_TYPES.storage) {
7273
client = cloud.storage.createClient(config.storage[0]);
7374
}
74-
75+
if (type === CLIENT_TYPES.orchestration) {
76+
client = cloud.storage.createClient(config.heat[0]);
77+
}
7578
if(client) {
7679
client.on("log::error", globalErrorHandler);
7780
}

0 commit comments

Comments
 (0)