use of com.microsoft.azure.hdinsight.sdk.rest.livy.interactive.api.PostSessions in project azure-tools-for-java by Microsoft.
the class Session method createSessionRequest.
private Observable<com.microsoft.azure.hdinsight.sdk.rest.livy.interactive.Session> createSessionRequest() {
final URI uri = baseUrl.resolve(REST_SEGMENT_SESSION);
final PostSessions postBody = getCreateParameters().build();
final String json = postBody.convertToJson().orElseThrow(() -> new IllegalArgumentException("Bad session arguments to post."));
getCtrlSubject().onNext(new SparkLogLine(TOOL, Debug, "Create Livy Session by sending request to " + uri + " with body " + json));
final StringEntity entity = new StringEntity(json, StandardCharsets.UTF_8);
entity.setContentType("application/json");
return getHttp().setUserAgent(getUserAgent()).post(uri.toString(), entity, null, null, com.microsoft.azure.hdinsight.sdk.rest.livy.interactive.Session.class);
}
Aggregations