CommandsResourceApi

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

Method HTTP request Description
abortCommand POST /commands/{commandId}/abort Abort a running command.
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

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