Skip to content

Commit

Permalink
api
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Feb 4, 2024
1 parent 576379c commit ce017b8
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.kyuubi.client;

import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.kyuubi.client.api.v1.dto.Engine;
import org.apache.kyuubi.client.api.v1.dto.OperationData;
import org.apache.kyuubi.client.api.v1.dto.ServerData;
Expand Down Expand Up @@ -103,10 +104,24 @@ public String closeSession(String sessionHandleStr) {
}

public List<OperationData> listOperations() {
return listOperations(Collections.emptyList(), null);
}

public List<OperationData> listOperations(List<String> users, String sessionHandleStr) {
Map<String, Object> params = new HashMap<>();
if (users != null && !users.isEmpty()) {
params.put("users", String.join(",", users));
}
if (StringUtils.isNotBlank(sessionHandleStr)) {
params.put("sessionHandle", sessionHandleStr);
}
OperationData[] result =
this.getClient()
.get(
API_BASE_PATH + "/operations", null, OperationData[].class, client.getAuthHeader());
API_BASE_PATH + "/operations",
params,
OperationData[].class,
client.getAuthHeader());
return Arrays.asList(result);
}

Expand Down

0 comments on commit ce017b8

Please sign in to comment.