UNPKG

1.18 kBJavaScriptView Raw
1#!/usr/bin/env node
2/********************************************************* {COPYRIGHT-TOP} ***
3 * Licensed Materials - Property of IBM
4 * 5725-Z22, 5725-Z63, 5725-U33, 5725-Z63
5 *
6 * (C) Copyright IBM Corporation 2016, 2017
7 *
8 * All Rights Reserved.
9 * US Government Users Restricted Rights - Use, duplication or disclosure
10 * restricted by GSA ADP Schedule Contract with IBM Corp.
11 ********************************************************** {COPYRIGHT-END} **/
12// Node module: apiconnect-cli-policies
13
14
15var subscriptions = require('apiconnect-apim-client').subscriptions;
16var listFormat = require('./formatter').listFormat;
17var getFormat = require('./formatter').getFormat;
18
19module.exports.list = list;
20function list(options) {
21 if (!options.scope) {
22 // default to org
23 options.scope = 'catalog';
24 }
25
26 return subscriptions.list(options).then(function(result) {
27 listFormat(result, options);
28 });
29}
30
31module.exports.get = get;
32function get(name, options) {
33 if (!options.scope) {
34 // default to org
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