CommandsResourceApi

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

Method HTTP request Description
abortCommand POST /commands/{commandId}/abort Abort a running command.
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.
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();
BigDecimal commandId = new BigDecimal(); // 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 BigDecimal The command id.

Return type

ApiCommand

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();
BigDecimal commandId = new BigDecimal(); // 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 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();
BigDecimal commandId = new BigDecimal(); // 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 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();
BigDecimal commandId = new BigDecimal(); // 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 BigDecimal The command id.

Return type

ApiCommand

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();
BigDecimal commandId = new BigDecimal(); // 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 BigDecimal ID of the command that needs to be run.

Return type

ApiCommand

Authorization

basic

HTTP request headers