Class: Serverspec::Type::ConsulServiceList
- Inherits:
-
ConsulBase
show all
- Defined in:
- lib/serverspec_extra_types/types/consul_service_list.rb
Instance Method Summary
collapse
Methods inherited from ConsulBase
#[], #initialize
Methods inherited from ApiBase
#[], #initialize
Instance Method Details
#has_service?(service) ⇒ Boolean
18
19
20
|
# File 'lib/serverspec_extra_types/types/consul_service_list.rb', line 18
def has_service?(service)
services.include? service
end
|
#inspection ⇒ Object
26
27
28
|
# File 'lib/serverspec_extra_types/types/consul_service_list.rb', line 26
def inspection
@inspection ||= ::MultiJson.load(get_inspection.stdout)
end
|
#services ⇒ Object
22
23
24
|
# File 'lib/serverspec_extra_types/types/consul_service_list.rb', line 22
def services
inspection.keys
end
|
#to_s ⇒ Object
12
13
14
15
16
|
# File 'lib/serverspec_extra_types/types/consul_service_list.rb', line 12
def to_s
msg = 'Consul Service List'
msg << %( with acl token: "#{@token}") if @token
msg
end
|
#url ⇒ Object
8
9
10
|
# File 'lib/serverspec_extra_types/types/consul_service_list.rb', line 8
def url
"#{@url_base}/v1/catalog/services"
end
|