Class: Philae::EtcdClusterProbe
- Inherits:
-
CollectionProbe
- Object
- CollectionProbe
- Philae::EtcdClusterProbe
- Defined in:
- lib/philae/etcd_cluster_probe.rb
Instance Attribute Summary collapse
-
#etcd_probes ⇒ Object
readonly
Returns the value of attribute etcd_probes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, endpoints, read_timeout: 1, cacert: nil, ssl_cert: nil, ssl_key: nil) ⇒ EtcdClusterProbe
constructor
A new instance of EtcdClusterProbe.
- #probes ⇒ Object
Methods inherited from CollectionProbe
Constructor Details
#initialize(name, endpoints, read_timeout: 1, cacert: nil, ssl_cert: nil, ssl_key: nil) ⇒ EtcdClusterProbe
Returns a new instance of EtcdClusterProbe.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/philae/etcd_cluster_probe.rb', line 9 def initialize(name, endpoints, read_timeout: 1, cacert: nil, ssl_cert: nil, ssl_key: nil) raise ArgumentError, 'empty endpoints' if endpoints.nil? || endpoints.empty? @etcd_probes = endpoints.map do |endpoint| endpoint_uri = URI(endpoint) next EtcdProbe.new( "#{name}-#{endpoint_uri.host}-#{endpoint_uri.port}", endpoint_uri.host, endpoint_uri.port, read_timeout: read_timeout, cacert: cacert, ssl_cert: ssl_cert, ssl_key: ssl_key, ) end @name = name end |
Instance Attribute Details
#etcd_probes ⇒ Object (readonly)
Returns the value of attribute etcd_probes.
6 7 8 |
# File 'lib/philae/etcd_cluster_probe.rb', line 6 def etcd_probes @etcd_probes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/philae/etcd_cluster_probe.rb', line 6 def name @name end |
Instance Method Details
#probes ⇒ Object
26 27 28 |
# File 'lib/philae/etcd_cluster_probe.rb', line 26 def probes return @etcd_probes end |