protected BatchRequestResponse performApiRequest(String relativeUri, String body, String method, Integer userId) {
    WebTarget target = extendApiResource(ambariWebResource, relativeUri);
    Response response;
    try {
      Invocation.Builder invocationBuilder = target.request().header(USER_ID_HEADER, userId);
      if (method.equalsIgnoreCase("GET")) {
        response = invocationBuilder.get();
      } else if (method.equalsIgnoreCase("POST")) {
        response = invocationBuilder.post(Entity.entity(body, MediaType.APPLICATION_JSON));
      } else if (method.equalsIgnoreCase("PUT")) {
        response = invocationBuilder.put(Entity.entity(body, MediaType.APPLICATION_JSON));
      } else if (method.equalsIgnoreCase("DELETE")) {
        response = invocationBuilder.delete();
      } else {
        throw new IllegalArgumentException("Invalid HTTP method: " + method);
      }
    } catch (Exception e) {
      LOG.error("Exception occurred during API request to {}: {}", relativeUri, e.getMessage(), e);
      response = null;
    }
    return convertToBatchRequestResponse(response);
  }
Get status of a long running operation
@return
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java