# CommandsResourceApi

All URIs are relative to *https://localhost/api/v50*

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


<a name="abortCommand"></a>
# **abortCommand**
> ApiCommand abortCommand(commandId)

Abort a running command.

Abort a running command.

### Example
```java
// 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**](ApiCommand.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getCommandResultData"></a>
# **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
```java
// 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**](File.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getCommandWithSteps"></a>
# **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.  <p>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.</p>

### Example
```java
// 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**](ApiCommandWithSteps.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getStandardError"></a>
# **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
```java
// 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**](File.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/octet-stream

<a name="getStandardOutput"></a>
# **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
```java
// 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**](File.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/octet-stream

<a name="readCommand"></a>
# **readCommand**
> ApiCommand readCommand(commandId)

Retrieve detailed information on an asynchronous command.

Retrieve detailed information on an asynchronous command.  <p>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.</p>

### Example
```java
// 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**](ApiCommand.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="readCommands"></a>
# **readCommands**
> ApiCommandList readCommands(endTime, limit, name, offset, startTime, success)

Retrieve detailed information on all recent commands.

Retrieve detailed information on all recent commands.

### Example
```java
// 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**](ApiCommandList.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="retry"></a>
# **retry**
> ApiCommand retry(commandId)

Try to rerun a command.

Try to rerun a command.

### Example
```java
// 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**](ApiCommand.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

