Class: Kscript::KkElasticCertFingerUtils
- Inherits:
-
Base
- Object
- Base
- Kscript::KkElasticCertFingerUtils
show all
- Defined in:
- lib/kscript/plugins/kk_elastic_cert_finger_utils.rb
Constant Summary
collapse
- DEFAULT_CERT_PATH =
'elasticsearch.crt'
Instance Attribute Summary collapse
Attributes inherited from Base
#logger
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#human_output?, inherited, #with_error_handling
Constructor Details
Initialize with certificate path
18
19
20
21
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 18
def initialize(*args, **opts)
super
@cert_path = args[0] || opts[:cert_path] || self.class::DEFAULT_CERT_PATH
end
|
Instance Attribute Details
#cert_path ⇒ Object
Returns the value of attribute cert_path.
14
15
16
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 14
def cert_path
@cert_path
end
|
Class Method Details
.arguments ⇒ Object
31
32
33
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 31
def self.arguments
'<cert_file>'
end
|
.author ⇒ Object
43
44
45
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 43
def self.author
'kk'
end
|
.description ⇒ Object
47
48
49
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 47
def self.description
'Generate Elasticsearch certificate SHA256 fingerprint.'
end
|
.group ⇒ Object
39
40
41
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 39
def self.group
'elastic'
end
|
.usage ⇒ Object
35
36
37
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 35
def self.usage
"kscript elastic_cert_finger <cert_file>\nkscript elastic_cert_finger ./ca.crt"
end
|
Instance Method Details
#run(*args, **_opts) ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/kscript/plugins/kk_elastic_cert_finger_utils.rb', line 23
def run(*args, **_opts)
with_error_handling do
@cert_path = args[0] if args[0]
generate
end
end
|