CommandsResourceApi

All URIs are relative to https://localhost/api/v52

Method HTTP request Description
abortCommand POST /commands/{commandId}/abort Abort a running command.
getCommandResultData GET /commands/{commandId}/download Download the end result of a command.
getCommandWithSteps GET /commands/{commandId}/steps Retrieve detailed information of an asynchronous command including the command steps.
getStandardError GET /commands/{commandId}/logs/stderr Download a zip-compressed archive of standard error outputs for the command's one-off processes.
getStandardOutput GET /commands/{commandId}/logs/stdout Download a zip-compressed archive of standard outputs for the command's one-off processes.
readCommand GET /commands/{commandId} Retrieve detailed information on an asynchronous command.
readCommands GET /commands/commands Retrieve detailed information on all recent commands.
retry POST /commands/{commandId}/retry Try to rerun a command.

abortCommand

ApiCommand abortCommand(commandId)

Abort a running command.

Abort a running command.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | The command id.
try {
    ApiCommand result = apiInstance.abortCommand(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#abortCommand");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal The command id.

Return type

ApiCommand

Authorization

basic

HTTP request headers

getCommandResultData

File getCommandResultData(commandId)

Download the end result of a command.

Download the end result of a command. Content-Type header is explicitly set in the implementation instead of using annotation. In case the MIME type is not set for the command result, application/octet-stream is set.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | The command id.
try {
    File result = apiInstance.getCommandResultData(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#getCommandResultData");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal The command id.

Return type

File

Authorization

basic

HTTP request headers

getCommandWithSteps

ApiCommandWithSteps getCommandWithSteps(commandId)

Retrieve detailed information of an asynchronous command including the command steps.

Retrieve detailed information of an asynchronous command including the command steps.

Cloudera Manager keeps the results and statuses of asynchronous commands, which have non-negative command IDs. On the other hand, synchronous commands complete immediately, and their results are passed back in the return object of the command execution API call. Outside of that return object, there is no way to check the result of a synchronous command.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | The command id.
try {
    ApiCommandWithSteps result = apiInstance.getCommandWithSteps(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#getCommandWithSteps");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal The command id.

Return type

ApiCommandWithSteps

Authorization

basic

HTTP request headers

getStandardError

File getStandardError(commandId)

Download a zip-compressed archive of standard error outputs for the command's one-off processes.

Download a zip-compressed archive of standard error outputs for the command's one-off processes. Log files are returned zipped together.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | The command id.
try {
    File result = apiInstance.getStandardError(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#getStandardError");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal The command id.

Return type

File

Authorization

basic

HTTP request headers

getStandardOutput

File getStandardOutput(commandId)

Download a zip-compressed archive of standard outputs for the command's one-off processes.

Download a zip-compressed archive of standard outputs for the command's one-off processes. Log files are returned zipped together.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | The command id.
try {
    File result = apiInstance.getStandardOutput(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#getStandardOutput");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal The command id.

Return type

File

Authorization

basic

HTTP request headers

readCommand

ApiCommand readCommand(commandId)

Retrieve detailed information on an asynchronous command.

Retrieve detailed information on an asynchronous command.

Cloudera Manager keeps the results and statuses of asynchronous commands, which have non-negative command IDs. On the other hand, synchronous commands complete immediately, and their results are passed back in the return object of the command execution API call. Outside of that return object, there is no way to check the result of a synchronous command.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | The command id.
try {
    ApiCommand result = apiInstance.readCommand(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#readCommand");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal The command id.

Return type

ApiCommand

Authorization

basic

HTTP request headers

readCommands

ApiCommandList readCommands(endTime, limit, name, offset, startTime, success)

Retrieve detailed information on all recent commands.

Retrieve detailed information on all recent commands.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal endTime = new java.math.BigDecimal(); // java.math.BigDecimal | timestamp of the command end time
java.math.BigDecimal limit = new java.math.BigDecimal(); // java.math.BigDecimal | command count to return (from offset)
String name = "name_example"; // String | the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME
java.math.BigDecimal offset = new java.math.BigDecimal(); // java.math.BigDecimal | command position to start
java.math.BigDecimal startTime = new java.math.BigDecimal(); // java.math.BigDecimal | timestamp of the command start time
Boolean success = true; // Boolean | whether the command was successful, if already finished
try {
    ApiCommandList result = apiInstance.readCommands(endTime, limit, name, offset, startTime, success);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#readCommands");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
endTime java.math.BigDecimal timestamp of the command end time [optional] [default to -1]
limit java.math.BigDecimal command count to return (from offset) [optional] [default to 50]
name String the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME [optional]
offset java.math.BigDecimal command position to start [optional] [default to 0]
startTime java.math.BigDecimal timestamp of the command start time [optional] [default to -1]
success Boolean whether the command was successful, if already finished [optional]

Return type

ApiCommandList

Authorization

basic

HTTP request headers

retry

ApiCommand retry(commandId)

Try to rerun a command.

Try to rerun a command.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.CommandsResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

CommandsResourceApi apiInstance = new CommandsResourceApi();
java.math.BigDecimal commandId = new java.math.BigDecimal(); // java.math.BigDecimal | ID of the command that needs to be run.
try {
    ApiCommand result = apiInstance.retry(commandId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CommandsResourceApi#retry");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
commandId java.math.BigDecimal ID of the command that needs to be run.

Return type

ApiCommand

Authorization

basic

HTTP request headers