com.databricks.sdk.service.compute.CommandExecutionImpl Maven / Gradle / Ivy
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
package com.databricks.sdk.service.compute;
import com.databricks.sdk.core.ApiClient;
import com.databricks.sdk.support.Generated;
import java.util.HashMap;
import java.util.Map;
/** Package-local implementation of CommandExecution */
@Generated
class CommandExecutionImpl implements CommandExecutionService {
private final ApiClient apiClient;
public CommandExecutionImpl(ApiClient apiClient) {
this.apiClient = apiClient;
}
@Override
public void cancel(CancelCommand request) {
String path = "/api/1.2/commands/cancel";
Map headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
apiClient.POST(path, request, CancelResponse.class, headers);
}
@Override
public CommandStatusResponse commandStatus(CommandStatusRequest request) {
String path = "/api/1.2/commands/status";
Map headers = new HashMap<>();
headers.put("Accept", "application/json");
return apiClient.GET(path, request, CommandStatusResponse.class, headers);
}
@Override
public ContextStatusResponse contextStatus(ContextStatusRequest request) {
String path = "/api/1.2/contexts/status";
Map headers = new HashMap<>();
headers.put("Accept", "application/json");
return apiClient.GET(path, request, ContextStatusResponse.class, headers);
}
@Override
public Created create(CreateContext request) {
String path = "/api/1.2/contexts/create";
Map headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return apiClient.POST(path, request, Created.class, headers);
}
@Override
public void destroy(DestroyContext request) {
String path = "/api/1.2/contexts/destroy";
Map headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
apiClient.POST(path, request, DestroyResponse.class, headers);
}
@Override
public Created execute(Command request) {
String path = "/api/1.2/commands/execute";
Map headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return apiClient.POST(path, request, Created.class, headers);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy