Class: WavefrontCommandUsergroup

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

Overview

Define the usergroup command.

Instance Method Summary collapse

Methods inherited from WavefrontCommandBase

#acl_commands, #commands, #common_options, #docopt, #global_option_text, #global_options, #opt_row, #option_column_width, #options, #tag_commands, #things, #word

Instance Method Details

#_commandsObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/wavefront-cli/commands/usergroup.rb', line 24

def _commands
  ["list #{CMN} [-al] [-O fields] [-o offset] [-L limit]",
   "describe #{CMN} <id>",
   "create #{CMN} [-p permission...] <name>",
   "delete #{CMN} <id>",
   "dump #{CMN}",
   "import #{CMN} [-u] <file>",
   "set #{CMN} <key=value> <id>",
   "users #{CMN} <id>",
   "permissions #{CMN} <id>",
   "add user #{CMN} <id> <user>...",
   "remove user #{CMN} <id> <user>...",
   "grant #{CMN} <permission> to <id>",
   "revoke #{CMN} <permission> from <id>",
   "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
end

#_optionsObject



41
42
43
44
45
46
47
48
49
50
# File 'lib/wavefront-cli/commands/usergroup.rb', line 41

def _options
  [common_options,
   "-l, --long               list #{things} in detail",
   "-a, --all                list all #{things}",
   "-o, --offset=n           start from nth #{thing}",
   "-L, --limit=COUNT        number of #{things} to list",
   '-O, --fields=F1,F2,...   only show given fields',
   "-u, --update             update an existing #{thing}",
   '-p, --permission=STRING  Wavefront permission']
end

#descriptionObject



12
13
14
# File 'lib/wavefront-cli/commands/usergroup.rb', line 12

def description
  "view and manage Wavefront #{things}"
end

#postscriptObject



52
53
54
55
# File 'lib/wavefront-cli/commands/usergroup.rb', line 52

def postscript
  "'wf settings list permissions' will give you a list of all " \
  'currently supported permissions.'.fold(TW, 0)
end

#sdk_classObject



16
17
18
# File 'lib/wavefront-cli/commands/usergroup.rb', line 16

def sdk_class
  'UserGroup'
end

#sdk_fileObject



20
21
22
# File 'lib/wavefront-cli/commands/usergroup.rb', line 20

def sdk_file
  'usergroup'
end

#thingObject



8
9
10
# File 'lib/wavefront-cli/commands/usergroup.rb', line 8

def thing
  'user group'
end