Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REST] Sync the AdminRestApi with the AdminResource Apis #6045

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading