code: public static String getSessionId(CloseableHttpClient httpClient, String url, String username, String password)
        throws AzkabanClientException {
      try {
        HttpPost httpPost = new HttpPost(url);
        List<NameValuePair> nvps = new ArrayList<>();
        nvps.add(new BasicNameValuePair(AzkabanClientParams.ACTION, "login"));
        nvps.add(new BasicNameValuePair(AzkabanClientParams.USERNAME, username));
        nvps.add(new BasicNameValuePair(AzkabanClientParams.PASSWORD, password));
        httpPost.setEntity(new UrlEncodedFormEntity(nvps));
        CloseableHttpResponse response = httpClient.execute(httpPost);
  
        try {
          HttpEntity entity = response.getEntity();
  
          // retrieve session id from entity
          String jsonResponseString = IOUtils.toString(entity.getContent(), "UTF-8");
          String sessionId = AzkabanClient.parseResponse(jsonResponseString).get(AzkabanClientParams.SESSION_ID);
          EntityUtils.consume(entity);
          return sessionId;
        } catch (Exception e) {
          throw new AzkabanClientException("Azkaban client cannot consume session response.", e);
        } finally {
          response.close();
        }
      } catch (Exception e) {
        throw new AzkabanClientException("Azkaban client cannot fetch session.", e);
      }
    }
docs: <p>Use Azkaban ajax api to fetch the session id. Required http request parameters are:
  <br>action=login	The fixed parameter indicating the login action.
  <br>username	The Azkaban username.
  <br>password	The corresponding password.
  </pr>
  
  @param httpClient An apache http client
  @param url Azkaban ajax endpoint
  @param username username for Azkaban login
  @param password password for Azkaban login
  
  @return session id