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
44 45 46 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 44 def address inspection['Address'] end |
#create_index ⇒ Object
Key Type: Integer
190 191 192 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 190 def create_index inspection['CreateIndex'] end |
#datacenter ⇒ Object
Key Type: String
53 54 55 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 53 def datacenter inspection['Datacenter'] end |
#has_address?(address) ⇒ Boolean
48 49 50 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 48 def has_address?(address) self.address == address end |
#has_create_index?(create_index) ⇒ Boolean
194 195 196 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 194 def has_create_index?(create_index) self.create_index == create_index end |
#has_datacenter?(datacenter) ⇒ Boolean
57 58 59 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 57 def has_datacenter?(datacenter) self.datacenter == datacenter end |
#has_id?(id) ⇒ Boolean
30 31 32 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 30 def has_id?(id) self.id == id end |
#has_modify_index?(modify_index) ⇒ Boolean
203 204 205 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 203 def has_modify_index?(modify_index) self.modify_index == modify_index end |
#has_node?(node) ⇒ Boolean
39 40 41 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 39 def has_node?(node) self.node == node end |
#has_node_meta?(node_meta) ⇒ Boolean
76 77 78 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 76 def () self. == end |
#has_service_address?(service_address) ⇒ Boolean
121 122 123 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 121 def has_service_address?(service_address) self.service_address == service_address end |
#has_service_connect?(service_connect) ⇒ Boolean
185 186 187 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 185 def has_service_connect?(service_connect) self.service_connect == service_connect end |
#has_service_enable_tag_override?(service_enable_tag_override) ⇒ Boolean
158 159 160 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 158 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
94 95 96 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 94 def has_service_id?(service_id) self.service_id == service_id end |
#has_service_kind?(service_kind) ⇒ Boolean
85 86 87 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 85 def has_service_kind?(service_kind) self.service_kind == service_kind end |
#has_service_meta?(service_meta) ⇒ Boolean
140 141 142 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 140 def () self. == end |
#has_service_name?(service_name) ⇒ Boolean
103 104 105 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 103 def has_service_name?(service_name) self.service_name == service_name end |
#has_service_port?(service_port) ⇒ Boolean
149 150 151 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 149 def has_service_port?(service_port) self.service_port == service_port end |
#has_service_proxy?(service_proxy) ⇒ Boolean
176 177 178 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 176 def has_service_proxy?(service_proxy) self.service_proxy == service_proxy end |
#has_service_proxy_destination?(service_proxy_destination) ⇒ Boolean
167 168 169 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 167 def has_service_proxy_destination?(service_proxy_destination) self.service_proxy_destination == service_proxy_destination end |
#has_service_tags?(service_tags) ⇒ Boolean
112 113 114 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 112 def () self. == end |
#has_service_weights?(service_weights) ⇒ Boolean
Todo: do method for indiviual service weight are well as passing/warning
131 132 133 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 131 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
67 68 69 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 67 def has_tagged_addresses?(tagged_addresses) self.tagged_addresses == tagged_addresses end |
#id ⇒ Object
Generated Code Start =##
TODO: Make these better Key Type: String
26 27 28 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 26 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
199 200 201 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 199 def modify_index inspection['ModifyIndex'] end |
#node ⇒ Object
Key Type: String
35 36 37 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 35 def node inspection['Node'] end |
#node_meta ⇒ Object
Key Type: Hash
72 73 74 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 72 def inspection['NodeMeta'] end |
#service_address ⇒ Object
Key Type: String
117 118 119 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 117 def service_address inspection['ServiceAddress'] end |
#service_connect ⇒ Object
Key Type: Hash
181 182 183 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 181 def service_connect inspection['ServiceConnect'] end |
#service_enable_tag_override ⇒ Object
Key Type: FalseClass
154 155 156 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 154 def service_enable_tag_override inspection['ServiceEnableTagOverride'] end |
#service_id ⇒ Object
Key Type: String
90 91 92 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 90 def service_id inspection['ServiceID'] end |
#service_kind ⇒ Object
Key Type: String
81 82 83 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 81 def service_kind inspection['ServiceKind'] end |
#service_meta ⇒ Object
Key Type: Hash
136 137 138 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 136 def inspection['ServiceMeta'] end |
#service_name ⇒ Object
Key Type: String
99 100 101 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 99 def service_name inspection['ServiceName'] end |
#service_port ⇒ Object
Key Type: Integer
145 146 147 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 145 def service_port inspection['ServicePort'] end |
#service_proxy ⇒ Object
Key Type: Hash
172 173 174 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 172 def service_proxy inspection['ServiceProxy'] end |
#service_proxy_destination ⇒ Object
Key Type: String
163 164 165 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 163 def service_proxy_destination inspection['ServiceProxyDestination'] end |
#service_tags ⇒ Object
Key Type: Array
108 109 110 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 108 def inspection['ServiceTags'] end |
#service_weights ⇒ Object
Key Type: Hash
126 127 128 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 126 def service_weights inspection['ServiceWeights'] end |
#tagged_addresses ⇒ Object
Key Type: Hash
62 63 64 |
# File 'lib/serverspec_extra_types/types/consul_service.rb', line 62 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 |