Class: WavefrontCommandAccount

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

Overview

Define the account 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, #sdk_class, #sdk_file, #tag_commands, #thing, #things, #word

Instance Method Details

#_commandsObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/wavefront-cli/commands/account.rb', line 12

def _commands
  ["list #{CMN} [-sSal] [-O fields] [-o offset] [-L limit]",
   "describe #{CMN} <id>",
   "create user #{CMN} [-m permission...] [-g group-id...] " \
   '[-r role-id...] [-i policy-id] <id>',
   "invite user #{CMN} [-m permission...] [-g group-id...] " \
   '[-r role-id...] [-i policy-id] <id>',
   "delete #{CMN} <id>",
   "dump #{CMN}",
   "import #{CMN} [-uU] <file>",
   "role #{CMN} add to <id> <role>...",
   "role #{CMN} remove from <id> <role>...",
   "roles #{CMN} <id>",
   "ingestionpolicy #{CMN} add to <id> <policy>",
   "ingestionpolicy #{CMN} remove from <id> <policy>",
   "ingestionpolicy #{CMN} <id>",
   "group #{CMN} add to <id> <group>...",
   "group #{CMN} remove from <id> <group>...",
   "groups #{CMN} <id>",
   "grant #{CMN} <permission> to <account>...",
   "revoke #{CMN} <permission> from <account>...",
   "permissions #{CMN} <id>",
   "business functions #{CMN} <id>",
   "validate #{CMN} [-l] <account>...",
   "search #{CMN} [-al] [-o offset] [-L limit] [-O fields] <condition>..."]
end

#_optionsObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/wavefront-cli/commands/account.rb', line 39

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",
   '-s, --service            list only service accounts',
   '-S, --user               list only user accounts',
   '-O, --fields=F1,F2,...   only show given fields',
   "-u, --update             update an existing #{thing}",
   "-U, --upsert             import new or update existing #{thing}",
   '-m, --permission=STRING  Wavefront permission name',
   '-g, --groupid=STRING     Wavefront usergroup ID',
   '-r, --roleid=STRING      Wavefront role ID',
   '-i, --policyid=STRING    Wavefront ingestion policy ID']
end

#descriptionObject



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

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

#postscriptObject



56
57
58
59
60
# File 'lib/wavefront-cli/commands/account.rb', line 56

def postscript
  'Service accounts can be partially managed with this command, but ' \
  "'wf serviceaccount' has more features.\n\nFor a list of permissions, " \
  "run 'wf settings list permissions'.".fold(TW, 0)
end