1 | #!/usr/bin/env node
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var subscriptions = require('apiconnect-apim-client').subscriptions;
|
16 | var listFormat = require('./formatter').listFormat;
|
17 | var getFormat = require('./formatter').getFormat;
|
18 |
|
19 | module.exports.list = list;
|
20 | function list(options) {
|
21 | if (!options.scope) {
|
22 |
|
23 | options.scope = 'catalog';
|
24 | }
|
25 |
|
26 | return subscriptions.list(options).then(function(result) {
|
27 | listFormat(result, options);
|
28 | });
|
29 | }
|
30 |
|
31 | module.exports.get = get;
|
32 | function get(name, options) {
|
33 | if (!options.scope) {
|
34 |
|
35 | options.scope = 'catalog';
|
36 | }
|
37 |
|
38 | options.name = name;
|
39 | return subscriptions.get(options).then(function(result) {
|
40 | getFormat(result, options);
|
41 | });
|
42 | }
|
43 |
|