UNPKG

4.49 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
14var g = require('strong-globalize')();
15
16module.exports = {
17 name: 'subscriptions',
18 version: require('../package.json').version,
19 path: __filename,
20 isBuiltin: true,
21 topics: topics,
22};
23
24function topics() {
25 return [ {
26 name: 'subscriptions',
27 helpInfo: g.f('apic_subscriptions_list_help.txt'),
28 commands: [
29 {
30 command: 'list',
31 loginRequired: 'org',
32 defaultType: true,
33 aliases: [ 'subscriptions' ],
34 helpInfo: g.f('apic_subscriptions_list_help.txt'),
35 action: function(opts) {
36 return require('./plugin-impl').list(opts);
37 },
38 type: 'catalog',
39 options: [
40 { name: 'product', rune: 'p' },
41 { name: 'catalog', rune: 'c', type: 'name', default: '$APIC_CONFIG$.catalog.data.catalogs', required: true },
42 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.catalog.data.orgs', required: true },
43 { name: 'server', rune: 's', type: 'host', default: '$APIC_CONFIG$.catalog.host', required: true },
44 ],
45 },
46 {
47 command: 'list',
48 loginRequired: 'org',
49 helpInfo: g.f('apic_subscriptions_list_help.txt'),
50 action: function(opts) {
51 return require('./plugin-impl').list(opts);
52 },
53 type: 'space',
54 options: [
55 { name: 'space', type: 'name', default: '$APIC_CONFIG$.space.data.spaces', required: true },
56 { name: 'product', rune: 'p' },
57 { name: 'catalog', rune: 'c', type: 'name', default: '$APIC_CONFIG$.space.data.catalogs', required: true },
58 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.space.data.orgs', required: true },
59 { name: 'server', rune: 's', type: 'host', default: '$APIC_CONFIG$.space.host', required: true },
60 ],
61 },
62 {
63 command: 'list',
64 loginRequired: 'org',
65 helpInfo: g.f('apic_subscriptions_list_help.txt'),
66 action: function(opts) {
67 return require('./plugin-impl').list(opts);
68 },
69 type: 'consumer-org',
70 options: [
71 { name: 'application', rune: 'a', type: 'name' },
72 { name: 'catalog', rune: 'c', type: 'name', default: '$APIC_CONFIG$.catalog.data.catalogs', required: true },
73 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.catalog.data.orgs', required: true },
74 { name: 'server', rune: 's', type: 'host', default: '$APIC_CONFIG$.catalog.host', required: true },
75 ],
76 },
77 {
78 command: 'get <name>',
79 loginRequired: 'org',
80 defaultType: true,
81 helpInfo: g.f('apic_subscriptions_get_help.txt'),
82 action: function(name, opts) {
83 return require('./plugin-impl').get(name, opts);
84 },
85 type: 'catalog',
86 options: [
87 { name: 'catalog', rune: 'c', type: 'name', default: '$APIC_CONFIG$.catalog.data.catalogs', required: true },
88 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.catalog.data.orgs', required: true },
89 { name: 'server', rune: 's', type: 'host', default: '$APIC_CONFIG$.catalog.host', required: true },
90 ],
91 },
92 {
93 command: 'get <name>',
94 loginRequired: 'org',
95 helpInfo: g.f('apic_subscriptions_get_help.txt'),
96 action: function(name, opts) {
97 return require('./plugin-impl').get(name, opts);
98 },
99 type: 'space',
100 options: [
101 { name: 'space', type: 'name', default: '$APIC_CONFIG$.space.data.spaces', required: true },
102 { name: 'catalog', rune: 'c', type: 'name', default: '$APIC_CONFIG$.space.data.catalogs', required: true },
103 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.space.data.orgs', required: true },
104 { name: 'server', rune: 's', type: 'host', default: '$APIC_CONFIG$.space.host', required: true },
105 ],
106 },
107 ],
108 },
109 ];
110};
111