Class: Hieracles::Options::Hc

Inherits:
Hieracles::Optparse show all
Defined in:
lib/hieracles/options/hc.rb

Instance Attribute Summary

Attributes inherited from Hieracles::Optparse

#options, #payload

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Hieracles::Optparse

#initialize, #optionkeys

Constructor Details

This class inherits a constructor from Hieracles::Optparse

Class Method Details

.usageObject



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/hieracles/options/hc.rb', line 60

def self.usage
  return "\nUsage: hc <fqdn> <command> [extra_args]\n\nAvailable commands:\n  info        provides the farm, datacenter, country\n        associated to the given fqdn\n        An extra param can be added for filtering\n        eg. hc <fqdn> info timestamp\n        eg. hc <fqdn> info farm\n  facts       lists facts, either provided as a fact file\n        or grabbed from puppetdb.\n        An extra param can be added for filtering\n        eg. hc <fqdn> facts architecture\n        eg. hc <fqdn> facts 'memory.*mb'\n  files       list all files containing params affecting this fqdn\n        (in more than commons)\n  paths       list all file paths for files with params\n  modules     list modules included in the farm where the node is\n  params      list params for the node matching the fqdn\n        An extra filter string can be added to limit the list\n        use ruby regexp without the enclosing slashes\n        eg. hc <fqdn> params postfix.*version\n        eg. hc <fqdn> params '^postfix'\n        eg. hc <fqdn> params 'version$'\n  allparams   same as params but including the common.yaml params (huge)\n        Also accepts a search string\n\nExtra args:\n  -f <plain|console|csv|yaml|rawyaml|json> default console\n  -p extraparam=what,anotherparam=this \n  -c <configfile>\n  -h <hierafile>\n  -b <basepath> default ./\n  -e <encdir>\n  -y <fact_file> - facts in yaml format\n  -j <fact_file> - facts in json format\n  -v just displays the version of Hieracles\n  -i - interactive mode\n  -db - query puppetdb\n  -nodb - do not query puppetdb\n  END\nend\n"

Instance Method Details

#available_optionsObject



7
8
9
10
11
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/hieracles/options/hc.rb', line 7

def available_options
  {
    config: {
      has_arg: true,
      aliases: ['c', 'conf', 'config']
    },
    format: {
      has_arg: true,
      aliases: ['f', 'format']
    },
    params: {
      has_arg: true,
      aliases: ['p', 'params']
    },
    hierafile: {
      has_arg: true,
      aliases: ['h', 'hierafile']
    },
    basepath: {
      has_arg: true,
      aliases: ['b', 'basepath']
    },
    encpath: {
      has_arg: true,
      aliases: ['e', 'encpath']
    },
    version: {
      has_arg: false,
      aliases: ['v', 'version']
    },
    yaml_facts: {
      has_arg: true,
      aliases: ['y', 'yaml']
    },
    json_facts: {
      has_arg: true,
      aliases: ['j', 'json']
    },
    interactive: {
      has_arg: false,
      aliases: ['i', 'interactive']
    },
    db: {
      has_arg: false,
      aliases: ['db']
    },
    nodb: {
      has_arg: false,
      aliases: ['nodb', 'no-db', 'no']
    }
  }
end