UNPKG

4.09 kBJavaScriptView Raw
1// Copyright IBM Corp. 2016. All Rights Reserved.
2// Node module: apiconnect-cli-catalogs
3// US Government Users Restricted Rights - Use, duplication or disclosure
4// restricted by GSA ADP Schedule Contract with IBM Corp.
5
6/********************************************************* {COPYRIGHT-TOP} ***
7 * IBM Confidential
8 * OCO Source Materials
9 * 5725-C11, 5725-C12, 7198-8FX, 5725-F70, 5725-F71, 5725-F72, 5725-L30
10 *
11 * (C) Copyright IBM Corporation 2015 All Rights Reserved.
12 *
13 * The source code for this program is not published or otherwise
14 * divested of its trade secrets, irrespective of what has been
15 * deposited with the U.S. Copyright Office.
16 ********************************************************* {COPYRIGHT-END} **/
17/*eslint brace-style: 0, max-len: 0*/
18
19var g = require('strong-globalize')();
20
21module.exports = {
22 name: 'catalogs',
23 version: require('../package.json').version,
24 path: __filename,
25 isBuiltin: true,
26 topics: getTopics,
27};
28
29function getTopics() {
30 return [ {
31 name: 'catalogs',
32 commands: [
33 {
34 command: 'list',
35 loginRequired: 'org',
36 aliases: [ 'catalogs' ],
37 helpInfo: function() {
38 return g.f('apic_catalogs_list_help.txt');
39 },
40 action: function(opts) {
41 return require('./plugin-impl').catalogsList(opts);
42 },
43 options: [
44 { name: 'all-organizations', rune: 'O', type: 'boolean' },
45 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.org.data.orgs' },
46 { name: 'server', rune: 's', type: 'hostname', default: '$APIC_CONFIG$.org.hostname', required: true },
47 ],
48 },
49 {
50 command: 'create <displayName>',
51 loginRequired: 'org',
52 helpInfo: function() {
53 return g.f('apic_catalogs_create_help.txt');
54 },
55 action: function(displayName, opts) {
56 return require('./plugin-impl').catalogsCreate(displayName, opts);
57 },
58 options: [
59 { name: 'name' },
60 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.org.data.orgs', required: true },
61 { name: 'server', rune: 's', type: 'hostname', default: '$APIC_CONFIG$.org.hostname', required: true },
62 ],
63 },
64 {
65 command: 'get <name>',
66 loginRequired: 'org',
67 helpInfo: function() {
68 return g.f('apic_catalogs_get_help.txt');
69 },
70 action: function(name, opts) {
71 return require('./plugin-impl').catalogsGet(name, opts);
72 },
73 options: [
74 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.org.data.orgs', required: true },
75 { name: 'server', rune: 's', type: 'hostname', default: '$APIC_CONFIG$.org.hostname', required: true },
76 ],
77 },
78 {
79 command: 'delete <name>',
80 loginRequired: 'org',
81 helpInfo: function() {
82 return g.f('apic_catalogs_delete_help.txt');
83 },
84 action: function(name, opts) {
85 return require('./plugin-impl').catalogsDelete(name, opts);
86 },
87 options: [
88 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.org.data.orgs', required: true },
89 { name: 'server', rune: 's', type: 'hostname', default: '$APIC_CONFIG$.org.hostname', required: true },
90 ],
91 },
92 {
93 command: 'set <name>',
94 loginRequired: 'org',
95 helpInfo: function() {
96 return g.f('apic_catalogs_set_help.txt');
97 },
98 action: function(name, opts) {
99 return require('./plugin-impl').catalogsSet(name, opts);
100 },
101 options: [
102 { name: 'name' },
103 { name: 'display-name' },
104 { name: 'organization', rune: 'o', type: 'name', default: '$APIC_CONFIG$.org.data.orgs', required: true },
105 { name: 'server', rune: 's', type: 'hostname', default: '$APIC_CONFIG$.org.hostname', required: true },
106 { name: 'spaces', type: 'enum', values: [ 'enabled', 'disabled' ] },
107 ],
108 },
109 ],
110 } ];
111}