Class: WavefrontCommandUser

Inherits:
WavefrontCommandBase show all
Defined in:
lib/wavefront-cli/commands/user.rb

Overview

Define the user command.

Instance Method Summary collapse

Methods inherited from WavefrontCommandBase

#acl_commands, #commands, #common_options, #docopt, #global_options, #opt_row, #option_column_width, #options, #sdk_class, #sdk_file, #tag_commands, #word

Instance Method Details

#_commandsObject

delete uses a different string because it accepts multiples. Adding ellipsis to <id> causes everything else to expect an array.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/wavefront-cli/commands/user.rb', line 14

def _commands
  ["list #{CMN} [-l] [-O fields]",
   "describe #{CMN} <id>",
   "create #{CMN} [-e] [-m permission...] [-g group...] <id>",
   "invite #{CMN} [-m permission...] [-g group...] <id>",
   "update #{CMN} <key=value> <id>",
   "delete #{CMN} <user>...",
   "import #{CMN} <file>",
   "groups #{CMN} <id>",
   "join #{CMN} <id> <group>...",
   "leave #{CMN} <id> <group>...",
   "grant #{CMN} <privilege> to <id>",
   "revoke #{CMN} <privilege> from <id>",
   "search #{CMN} [-al] [-o offset] [-L limit] <condition>..."]
end

#_optionsObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/wavefront-cli/commands/user.rb', line 30

def _options
  [common_options,
   '-l, --long                list users in detail',
   '-o, --offset=n            start from nth user',
   '-L, --limit=COUNT         number of users to list',
   '-O, --fields=F1,F2,...    only show given fields',
   '-e, --email               send e-mail to user on account creation',
   '-m, --permission=STRING   give user this permission',
   '-g, --group=STRING        add user to this user group',
   '-f, --format=STRING       output format']
end

#descriptionObject



6
7
8
# File 'lib/wavefront-cli/commands/user.rb', line 6

def description
  'view and manage Wavefront users'
end

#postscriptObject



42
43
44
45
46
# File 'lib/wavefront-cli/commands/user.rb', line 42

def postscript
  'If your account does not have RBAC enabled, you must grant user ' \
  "permissions with '-m'. For a list of permissions, see " \
  "'wf usergroup --help'.".fold(TW, 0)
end