qbit/consul-client/src/main/java/io/advantageous/consul/endpoints/SessionEndpoint.java
public String create(Session session, final String datacenter) {


        final URI uri = createURI("/create");
        final HttpRequestBuilder httpRequestBuilder = RequestUtils
                .getHttpRequestBuilder(datacenter, null, null, "");


        HTTP.Response httpResponse = HTTP.jsonRestCallViaPUT(uri.toString() + "?" + httpRequestBuilder.paramString(),
                toJson(session));

        if (httpResponse == null || httpResponse.code() != 200) {
            die("Unable to create the session", uri, httpResponse);
        }

        final String id = fromJson(httpResponse.body(), SessionId.class).getId();
        session.setId(id);
        return id;
    }
public String create(Session session, final String datacenter) {


        final URI uri = createURI("/create");
        final HttpRequestBuilder httpRequestBuilder = RequestUtils
                .getHttpRequestBuilder(datacenter, null, null, "");


        HTTP.Response httpResponse = HTTP.jsonRestCallViaPUT(uri.toString() + "?" + httpRequestBuilder.paramString(),
                toJson(session));

        if (httpResponse == null || httpResponse.code() != 200) {
            die("Unable to create the session", uri, httpResponse);
        }

        final String id = fromJson(httpResponse.body(), SessionId.class).getId();
        session.setId(id);
        return id;
    }
The create endpoint is used to initialize a new session.
Sessions must be associated with a node and may be associated with any number of checks.
The create endpoint expects a JSON request body to be PUT. The request body must look like:

<pre>
<code>
{
"LockDelay": "15s",
"Name": "my-service-lock",
"Node": "foobar",
"Checks": ["a", "b", "c"],
"Behavior": "release",
"TTL": "0s"
}
</code>
</pre>

None of the fields are mandatory, and in fact no body needs to be PUT if the defaults are to be used.
By default, the agent's local datacenter is used; another datacenter can be specified using
the "?dc=" query parameter. However, it is not recommended to use cross-datacenter sessions.
/v1/session/create: Creates a new session

@param session    session to create
@param datacenter datacenter
@return a session id