Class: Serverspec::Type::ConsulService
- Inherits:
-
ConsulBase
- Object
- Base
- ApiBase
- ConsulBase
- Serverspec::Type::ConsulService
- Defined in:
- lib/serverspec_extra_types/types/consul_service.rb
Instance Method Summary collapse
-
#address ⇒ Object
Key Type: String.
-
#create_index ⇒ Object
Key Type: Integer.
-
#datacenter ⇒ Object
Key Type: String.
- #has_address?(address) ⇒ Boolean
- #has_create_index?(create_index) ⇒ Boolean
- #has_datacenter?(datacenter) ⇒ Boolean
- #has_id?(id) ⇒ Boolean
- #has_modify_index?(modify_index) ⇒ Boolean
- #has_node?(node) ⇒ Boolean
- #has_node_meta?(node_meta) ⇒ Boolean
- #has_service_address?(service_address) ⇒ Boolean
- #has_service_connect?(service_connect) ⇒ Boolean
- #has_service_enable_tag_override?(service_enable_tag_override) ⇒ Boolean
- #has_service_id?(service_id) ⇒ Boolean
- #has_service_kind?(service_kind) ⇒ Boolean
- #has_service_meta?(service_meta) ⇒ Boolean
- #has_service_name?(service_name) ⇒ Boolean
- #has_service_port?(service_port) ⇒ Boolean
- #has_service_proxy?(service_proxy) ⇒ Boolean
- #has_service_proxy_destination?(service_proxy_destination) ⇒ Boolean
- #has_service_tags?(service_tags) ⇒ Boolean
-
#has_service_weights?(service_weights) ⇒ Boolean
TODO: do method for indiviual service weight are well as passing/warning.
-
#has_tagged_addresses?(tagged_addresses) ⇒ Boolean
TODO: do method for indiviual tagged addresses.
-
#id ⇒ Object
Generated Code Start =## TODO: Make these better Key Type: String.
- #inspection ⇒ Object
-
#modify_index ⇒ Object
Key Type: Integer.
-
#node ⇒ Object
Key Type: String.
-
#node_meta ⇒ Object
Key Type: Hash.
-
#service_address ⇒ Object
Key Type: String.
-
#service_connect ⇒ Object
Key Type: Hash.
-
#service_enable_tag_override ⇒ Object
Key Type: FalseClass.
-
#service_id ⇒ Object
Key Type: String.
-
#service_kind ⇒ Object
Key Type: String.
-
#service_meta ⇒ Object
Key Type: Hash.
-
#service_name ⇒ Object
Key Type: String.
-
#service_port ⇒ Object
Key Type: Integer.
-
#service_proxy ⇒ Object
Key Type: Hash.
-
#service_proxy_destination ⇒ Object
Key Type: String.
-
#service_tags ⇒ Object
Key Type: Array.
-
#service_weights ⇒ Object
Key Type: Hash.
-
#tagged_addresses ⇒ Object
Key Type: Hash.
- #to_s ⇒ Object
- #url ⇒ Object
Methods inherited from ConsulBase
Methods inherited from ApiBase
Constructor Details
This class inherits a constructor from Serverspec::Type::ConsulBase
Instance Method Details
#address ⇒ Object
Key Type: String
43 44 45 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 43 def address inspection['Address'] end |
#create_index ⇒ Object
Key Type: Integer
189 190 191 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 189 def create_index inspection['CreateIndex'] end |
#datacenter ⇒ Object
Key Type: String
52 53 54 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 52 def datacenter inspection['Datacenter'] end |
#has_address?(address) ⇒ Boolean
47 48 49 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 47 def has_address?(address) self.address == address end |
#has_create_index?(create_index) ⇒ Boolean
193 194 195 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 193 def has_create_index?(create_index) self.create_index == create_index end |
#has_datacenter?(datacenter) ⇒ Boolean
56 57 58 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 56 def has_datacenter?(datacenter) self.datacenter == datacenter end |
#has_id?(id) ⇒ Boolean
29 30 31 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 29 def has_id?(id) self.id == id end |
#has_modify_index?(modify_index) ⇒ Boolean
202 203 204 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 202 def has_modify_index?(modify_index) self.modify_index == modify_index end |
#has_node?(node) ⇒ Boolean
38 39 40 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 38 def has_node?(node) self.node == node end |
#has_node_meta?(node_meta) ⇒ Boolean
75 76 77 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 75 def () self. == end |
#has_service_address?(service_address) ⇒ Boolean
120 121 122 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 120 def has_service_address?(service_address) self.service_address == service_address end |
#has_service_connect?(service_connect) ⇒ Boolean
184 185 186 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 184 def has_service_connect?(service_connect) self.service_connect == service_connect end |
#has_service_enable_tag_override?(service_enable_tag_override) ⇒ Boolean
157 158 159 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 157 def has_service_enable_tag_override?(service_enable_tag_override) self.service_enable_tag_override == service_enable_tag_override end |
#has_service_id?(service_id) ⇒ Boolean
93 94 95 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 93 def has_service_id?(service_id) self.service_id == service_id end |
#has_service_kind?(service_kind) ⇒ Boolean
84 85 86 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 84 def has_service_kind?(service_kind) self.service_kind == service_kind end |
#has_service_meta?(service_meta) ⇒ Boolean
139 140 141 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 139 def () self. == end |
#has_service_name?(service_name) ⇒ Boolean
102 103 104 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 102 def has_service_name?(service_name) self.service_name == service_name end |
#has_service_port?(service_port) ⇒ Boolean
148 149 150 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 148 def has_service_port?(service_port) self.service_port == service_port end |
#has_service_proxy?(service_proxy) ⇒ Boolean
175 176 177 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 175 def has_service_proxy?(service_proxy) self.service_proxy == service_proxy end |
#has_service_proxy_destination?(service_proxy_destination) ⇒ Boolean
166 167 168 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 166 def has_service_proxy_destination?(service_proxy_destination) self.service_proxy_destination == service_proxy_destination end |
#has_service_tags?(service_tags) ⇒ Boolean
111 112 113 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 111 def () self. == end |
#has_service_weights?(service_weights) ⇒ Boolean
TODO: do method for indiviual service weight are well as passing/warning
130 131 132 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 130 def has_service_weights?(service_weights) self.service_weights == service_weights end |
#has_tagged_addresses?(tagged_addresses) ⇒ Boolean
TODO: do method for indiviual tagged addresses
66 67 68 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 66 def has_tagged_addresses?(tagged_addresses) self.tagged_addresses == tagged_addresses end |
#id ⇒ Object
Generated Code Start =##
TODO: Make these better Key Type: String
25 26 27 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 25 def id inspection['ID'] end |
#inspection ⇒ Object
18 19 20 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 18 def inspection @inspection ||= ::MultiJson.load(get_inspection.stdout)[0] end |
#modify_index ⇒ Object
Key Type: Integer
198 199 200 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 198 def modify_index inspection['ModifyIndex'] end |
#node ⇒ Object
Key Type: String
34 35 36 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 34 def node inspection['Node'] end |
#node_meta ⇒ Object
Key Type: Hash
71 72 73 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 71 def inspection['NodeMeta'] end |
#service_address ⇒ Object
Key Type: String
116 117 118 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 116 def service_address inspection['ServiceAddress'] end |
#service_connect ⇒ Object
Key Type: Hash
180 181 182 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 180 def service_connect inspection['ServiceConnect'] end |
#service_enable_tag_override ⇒ Object
Key Type: FalseClass
153 154 155 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 153 def service_enable_tag_override inspection['ServiceEnableTagOverride'] end |
#service_id ⇒ Object
Key Type: String
89 90 91 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 89 def service_id inspection['ServiceID'] end |
#service_kind ⇒ Object
Key Type: String
80 81 82 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 80 def service_kind inspection['ServiceKind'] end |
#service_meta ⇒ Object
Key Type: Hash
135 136 137 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 135 def inspection['ServiceMeta'] end |
#service_name ⇒ Object
Key Type: String
98 99 100 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 98 def service_name inspection['ServiceName'] end |
#service_port ⇒ Object
Key Type: Integer
144 145 146 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 144 def service_port inspection['ServicePort'] end |
#service_proxy ⇒ Object
Key Type: Hash
171 172 173 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 171 def service_proxy inspection['ServiceProxy'] end |
#service_proxy_destination ⇒ Object
Key Type: String
162 163 164 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 162 def service_proxy_destination inspection['ServiceProxyDestination'] end |
#service_tags ⇒ Object
Key Type: Array
107 108 109 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 107 def inspection['ServiceTags'] end |
#service_weights ⇒ Object
Key Type: Hash
125 126 127 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 125 def service_weights inspection['ServiceWeights'] end |
#tagged_addresses ⇒ Object
Key Type: Hash
61 62 63 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 61 def tagged_addresses inspection['TaggedAddresses'] end |
#to_s ⇒ Object
12 13 14 15 16 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 12 def to_s msg = "Consul Service #{@name}" msg << %( with acl token: "#{@token}") if @token msg end |
#url ⇒ Object
8 9 10 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 8 def url "#{@url_base}/v1/catalog/service/#{@name}" end |