|
hlcc 2.0.0-beta2+pre1
|
Dummy Consul client wrapper. More...
Public Member Functions | |
| def | __init__ (self, host=None, port=None) |
| Simple consul client. | |
| def | get_server (self) |
| Get consul server. | |
| def | get_ip_and_port (self, service) |
| Get service (IP_address,port) of the given service if in consul db. | |
| def | get_uri (self, service, cii_srv='zpb.rr') |
| Get CII URL. | |
| def | get_if_uri (self, service, iface, cii_srv='zpb.rr') |
| Get CII URL for an interface on the given service. | |
Protected Attributes | |
| _cons | |
Dummy Consul client wrapper.
| def utils.nomad_consul_helper.ConsulClient.__init__ | ( | self, | |
host = None, |
|||
port = None |
|||
| ) |
Simple consul client.
The constructor connects to Consul on the given host and port. If the host is None (default), it looks first for the CONSUL_HTTP_ADDR environment variable and, if this is not set, uses the 127.0.0.1 localhost IP address. If the port is None (default), it looks first for the CONSUL_HTTP_ADDR environment variable and, if this is not set, uses the 8500 default port. CONSUL_HTTP_ADDR is defined as the URL for consul in the format: http://<host>:<port> Notice that is port != None, a value defined in CONSUL_HTTP_ADDR is overridden by port.
| def utils.nomad_consul_helper.ConsulClient.get_if_uri | ( | self, | |
| service, | |||
| iface, | |||
cii_srv = 'zpb.rr' |
|||
| ) |
Get CII URL for an interface on the given service.
| def utils.nomad_consul_helper.ConsulClient.get_ip_and_port | ( | self, | |
| service | |||
| ) |
Get service (IP_address,port) of the given service if in consul db.
ToDo GCH 20230202: may be port is not a good name, since we return also the IP
| def utils.nomad_consul_helper.ConsulClient.get_server | ( | self | ) |
Get consul server.
| def utils.nomad_consul_helper.ConsulClient.get_uri | ( | self, | |
| service, | |||
cii_srv = 'zpb.rr' |
|||
| ) |
Get CII URL.
|
protected |