cm_client.CommandsResourceApi

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

Method HTTP request Description
abort_command POST /commands/{commandId}/abort Abort a running command.
get_standard_error GET /commands/{commandId}/logs/stderr Download a zip-compressed archive of standard error outputs for the command's one-off processes.
get_standard_output GET /commands/{commandId}/logs/stdout Download a zip-compressed archive of standard outputs for the command's one-off processes.
read_command GET /commands/{commandId} Retrieve detailed information on an asynchronous command.
retry POST /commands/{commandId}/retry Try to rerun a command.

abort_command

ApiCommand abort_command(command_id)

Abort a running command.

Abort a running command.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CommandsResourceApi(cm_client.ApiClient(configuration))
command_id = 3.4 # float | The command id.

try:
    # Abort a running command.
    api_response = api_instance.abort_command(command_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommandsResourceApi->abort_command: %s\n" % e)

Parameters

Name Type Description Notes
command_id float The command id.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_standard_error

file get_standard_error(command_id)

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

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CommandsResourceApi(cm_client.ApiClient(configuration))
command_id = 3.4 # float | The command id.

try:
    # Download a zip-compressed archive of standard error outputs for the command's one-off processes.
    api_response = api_instance.get_standard_error(command_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommandsResourceApi->get_standard_error: %s\n" % e)

Parameters

Name Type Description Notes
command_id float The command id.

Return type

file

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_standard_output

file get_standard_output(command_id)

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

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CommandsResourceApi(cm_client.ApiClient(configuration))
command_id = 3.4 # float | The command id.

try:
    # Download a zip-compressed archive of standard outputs for the command's one-off processes.
    api_response = api_instance.get_standard_output(command_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommandsResourceApi->get_standard_output: %s\n" % e)

Parameters

Name Type Description Notes
command_id float The command id.

Return type

file

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_command

ApiCommand read_command(command_id)

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

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CommandsResourceApi(cm_client.ApiClient(configuration))
command_id = 3.4 # float | The command id.

try:
    # Retrieve detailed information on an asynchronous command.
    api_response = api_instance.read_command(command_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommandsResourceApi->read_command: %s\n" % e)

Parameters

Name Type Description Notes
command_id float The command id.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retry

ApiCommand retry(command_id)

Try to rerun a command.

Try to rerun a command.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CommandsResourceApi(cm_client.ApiClient(configuration))
command_id = 3.4 # float | ID of the command that needs to be run.

try:
    # Try to rerun a command.
    api_response = api_instance.retry(command_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommandsResourceApi->retry: %s\n" % e)

Parameters

Name Type Description Notes
command_id float ID of the command that needs to be run.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]