qbit/consul-client/src/main/java/io/advantageous/consul/endpoints/AgentEndpoint.java
public void register(final Registration registration) {

        final URI uri = createURI("/service/register");
        HTTP.Response response = HTTP.jsonRestCallViaPUT(uri.toString(), toJson(registration));

        if (response.status() != 200) {
            die("Error registering service with Consul", uri, registration, response.payloadAsString());
        }
    }
public void register(final Registration registration) {

        final URI uri = createURI("/service/register");
        HTTP.Response response = HTTP.jsonRestCallViaPUT(uri.toString(), toJson(registration));

        if (response.status() != 200) {
            die("Error registering service with Consul", uri, registration, response.payloadAsString());
        }
    }
public void register ( final Registration registration ) { final URI uri = createURI ( "/service/register" ) ; HTTP . Response response = HTTP . jsonRestCallViaPUT ( uri . toString ( ) , toJson ( registration ) ) ; if ( response . status ( ) != 200 ) { die ( "Error registering service with Consul" , uri , registration , response . payloadAsString ( ) ) ; } }
Register a service with Consul.

@param registration The registration payload.
Register a service with Consul .