cm_client.ClouderaManagerResourceApi

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

Method HTTP request Description
add_custom_certs POST /cm/commands/addCustomCerts Add custom certificates to the Auto-TLS certificate database.
begin_trial POST /cm/trial/begin Begin trial license.
clusters_perf_inspector_command POST /cm/commands/clustersPerfInspector Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs User must be Full Administrator or Global Cluster Administrator.
collect_diagnostic_data_command POST /cm/commands/collectDiagnosticData Collect diagnostic data from hosts managed by Cloudera Manager.
delete_credentials_command POST /cm/commands/deleteCredentials Delete existing Kerberos credentials.
delete_instances POST /cm/deleteInstances Remove a list of cm servers from ha cluster.
disable_csp POST /cm/commands/disableCsp Disables the CSP by setting csp type to "none", only when currently the csp type is either "embedded" or "vault".
end_trial POST /cm/trial/end End trial license.
generate_cmca POST /cm/commands/generateCmca Generate a CMCA.
generate_credentials_adhoc POST /cm/commands/generateCredentialsAdhoc Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.
generate_credentials_command POST /cm/commands/generateCredentials Generate missing Kerberos credentials.
get_cluster_support_token_list GET /cm/clusterSupportTokens Gets the support tokens for all the clusters.
get_config GET /cm/config Retrieve the Cloudera Manager settings.
get_deployment2 GET /cm/deployment Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc.
get_kerberos_info GET /cm/kerberosInfo Provides Cloudera Manager Kerberos information.
get_kerberos_principals GET /cm/kerberosPrincipals Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
get_krb5_conf GET /cm/krb5conf Retrieves krb5.
get_licensed_feature_usage GET /cm/licensedFeatureUsage Retrieve a summary of licensed feature usage.
get_log GET /cm/log Returns the entire contents of the Cloudera Manager log file.
get_scm_db_info GET /cm/scmDbInfo Provides Cloudera Manager server's database information.
get_shutdown_readiness GET /cm/shutdownReadiness Retrieve Cloudera Manager's readiness for shutdown and destroy.
get_version GET /cm/version Provides version information of Cloudera Manager itself.
host_install_command POST /cm/commands/hostInstall Perform installation on a set of hosts.
hosts_decommission_command POST /cm/commands/hostsDecommission Decommission the given hosts.
hosts_offline_or_decommission_command POST /cm/commands/hostsOfflineOrDecommission Decommission the given hosts.
hosts_perf_inspector_command POST /cm/commands/hostsPerfInspector Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs User must be Full Administrator or Global Cluster Administrator.
hosts_recommission_and_exit_maintenance_mode_command POST /cm/commands/hostsRecommissionAndExitMaintenanceMode Recommission and exit maintenance on the given hosts.
hosts_recommission_command POST /cm/commands/hostsRecommission Recommission the given hosts.
hosts_recommission_with_start_command POST /cm/commands/hostsRecommissionWithStart Recommission the given hosts.
hosts_start_roles_command POST /cm/commands/hostsStartRoles Start all the roles on the given hosts.
hosts_stop_roles_command POST /cm/commands/hostsStopRoles Stop all the roles on the given hosts.
import_admin_credentials POST /cm/commands/importAdminCredentials Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
import_cluster_template POST /cm/importClusterTemplate Create cluster as per the given cluster template.
import_kerberos_principal POST /cm/commands/importKerberosPrincipal Imports the Kerberos credentials for the specified principal which can then be used to add to a role's keytab by running Generate Credentials command.
inspect_hosts_command POST /cm/commands/inspectHosts Runs the host inspector on the configured hosts.
list_active_commands GET /cm/commands List active global commands.
migrate_cmca_to_db POST /cm/commands/migrateCmcaToDb Migrate CMCA to the DB.
read_instance GET /cm/instances/{cmServerId} Retrieves the CM server information.
read_instances GET /cm/instances Retrieves all CM server information.
read_license GET /cm/license Retrieve information about the Cloudera Manager license.
refresh_parcel_repos POST /cm/commands/refreshParcelRepos .
retrieve_keytab POST /cm/retrieveKeytab Retrieves a keytab for a list of principals.
rotate_csp_keys POST /cm/commands/rotateCspKeys Perform rotation of the CSP key.
test_external_authentication POST /cm/commands/testExternalAuthentication Launches a command to test the currently configured external authentication.
update_config PUT /cm/config Update the Cloudera Manager settings.
update_csp_type POST /cm/commands/updateCspType Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type.
update_deployment2 PUT /cm/deployment Apply the supplied deployment description to the system.
update_global_truststore POST /cm/commands/updateGlobalTruststore Add/remove certificates to the Auto-TLS certificate truststore.
update_license POST /cm/license Updates the Cloudera Manager license.

add_custom_certs

ApiCommand add_custom_certs(body=body)

Add custom certificates to the Auto-TLS certificate database.

Add custom certificates to the Auto-TLS certificate database

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiAddCustomCertsArguments() # ApiAddCustomCertsArguments |  (optional)

try:
    # Add custom certificates to the Auto-TLS certificate database.
    api_response = api_instance.add_custom_certs(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->add_custom_certs: %s\n" % e)

Parameters

Name Type Description Notes
body ApiAddCustomCertsArguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

begin_trial

begin_trial()

Begin trial license.

Begin trial license.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Begin trial license.
    api_instance.begin_trial()
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->begin_trial: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

basic

HTTP request headers

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

clusters_perf_inspector_command

ApiCommand clusters_perf_inspector_command(body=body)

Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs User must be Full Administrator or Global Cluster Administrator.

Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs User must be Full Administrator or Global Cluster Administrator.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiClustersPerfInspectorArgs() # ApiClustersPerfInspectorArgs | Required arguments for the command. See ApiClustersPerfInspectorArgs. (optional)

try:
    # Run performance diagnostics test against specified clusters in ApiClustersPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
    api_response = api_instance.clusters_perf_inspector_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->clusters_perf_inspector_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiClustersPerfInspectorArgs Required arguments for the command. See ApiClustersPerfInspectorArgs. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

collect_diagnostic_data_command

ApiCommand collect_diagnostic_data_command(body=body)

Collect diagnostic data from hosts managed by Cloudera Manager.

Collect diagnostic data from hosts managed by Cloudera Manager.

After the command has completed, the ApiCommand will contain a resultDataUrl from where you can download the result.

Only available with Cloudera Manager Enterprise Edition.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiCollectDiagnosticDataArguments() # ApiCollectDiagnosticDataArguments | The command arguments. (optional)

try:
    # Collect diagnostic data from hosts managed by Cloudera Manager.
    api_response = api_instance.collect_diagnostic_data_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->collect_diagnostic_data_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiCollectDiagnosticDataArguments The command arguments. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

delete_credentials_command

ApiCommand delete_credentials_command(delete_credentials_mode=delete_credentials_mode)

Delete existing Kerberos credentials.

Delete existing Kerberos credentials.

This command will affect all services that have been configured to use Kerberos, and have existing credentials. In V18 this takes a new paramater to determine whether it needs to delete all credentials or just unused ones.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
delete_credentials_mode = 'all' # str | this can be set to \"all\" or \"unused\" (optional) (default to all)

try:
    # Delete existing Kerberos credentials.
    api_response = api_instance.delete_credentials_command(delete_credentials_mode=delete_credentials_mode)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->delete_credentials_command: %s\n" % e)

Parameters

Name Type Description Notes
delete_credentials_mode str this can be set to "all" or "unused" [optional] [default to all]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

delete_instances

ApiCmServerList delete_instances(body=body)

Remove a list of cm servers from ha cluster.

Remove a list of cm servers from ha cluster.

Available since API v49. Removes instances of cm server.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiStringList() # ApiStringList |  (optional)

try:
    # Remove a list of cm servers from ha cluster.
    api_response = api_instance.delete_instances(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->delete_instances: %s\n" % e)

Parameters

Name Type Description Notes
body ApiStringList [optional]

Return type

ApiCmServerList

Authorization

basic

HTTP request headers

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

disable_csp

ApiCommand disable_csp()

Disables the CSP by setting csp type to "none", only when currently the csp type is either "embedded" or "vault".

Disables the CSP by setting csp type to "none", only when currently the csp type is either "embedded" or "vault". This will decrypt the encrypted configurations and disable the use of Credential Storage Provider.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Disables the CSP by setting csp type to \"none\", only when currently the csp type is either \"embedded\" or \"vault\".
    api_response = api_instance.disable_csp()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->disable_csp: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

end_trial

end_trial()

End trial license.

End trial license.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # End trial license.
    api_instance.end_trial()
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->end_trial: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

basic

HTTP request headers

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

generate_cmca

ApiCommand generate_cmca(body=body)

Generate a CMCA.

Generate a CMCA

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiGenerateCmcaArguments() # ApiGenerateCmcaArguments |  (optional)

try:
    # Generate a CMCA.
    api_response = api_instance.generate_cmca(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->generate_cmca: %s\n" % e)

Parameters

Name Type Description Notes
body ApiGenerateCmcaArguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

generate_credentials_adhoc

ApiCommand generate_credentials_adhoc(body=body)

Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.

Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.

This command will affect all services that have been configured to use Kerberos, and haven't had their credentials generated yet.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiPrincipalList() # ApiPrincipalList |  (optional)

try:
    # Generate missing Kerberos credentials, optionally accepting a list of ad-hoc credentials to generate as well.
    api_response = api_instance.generate_credentials_adhoc(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->generate_credentials_adhoc: %s\n" % e)

Parameters

Name Type Description Notes
body ApiPrincipalList [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

generate_credentials_command

ApiCommand generate_credentials_command()

Generate missing Kerberos credentials.

Generate missing Kerberos credentials.

This command will affect all services that have been configured to use Kerberos, and haven't had their credentials generated yet.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Generate missing Kerberos credentials.
    api_response = api_instance.generate_credentials_command()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->generate_credentials_command: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

get_cluster_support_token_list

ApiClusterSupportTokenList get_cluster_support_token_list()

Gets the support tokens for all the clusters.

Gets the support tokens for all the clusters.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Gets the support tokens for all the clusters.
    api_response = api_instance.get_cluster_support_token_list()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_cluster_support_token_list: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiClusterSupportTokenList

Authorization

basic

HTTP request headers

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

get_config

ApiConfigList get_config(view=view)

Retrieve the Cloudera Manager settings.

Retrieve the Cloudera Manager settings.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
view = 'summary' # str | The view to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    # Retrieve the Cloudera Manager settings.
    api_response = api_instance.get_config(view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_config: %s\n" % e)

Parameters

Name Type Description Notes
view str The view to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiConfigList

Authorization

basic

HTTP request headers

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

get_deployment2

ApiDeployment2 get_deployment2(view=view)

Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc.

Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc.

This object can be used to reconstruct your entire deployment

Note: Only users with sufficient privileges are allowed to call this.

Note: starting with v19, the deployment information contains a newer version of users ApiUser2 that can hold granular permissions.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
view = 'export' # str | May be one of \"export\" (default) or \"export_redacted\".  The latter replaces configurations that are sensitive with the word \"REDACTED\". Other filter options are not supported. (optional) (default to export)

try:
    # Retrieve full description of the entire Cloudera Manager deployment including all hosts, clusters, services, roles, users, settings, etc.
    api_response = api_instance.get_deployment2(view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_deployment2: %s\n" % e)

Parameters

Name Type Description Notes
view str May be one of "export" (default) or "export_redacted". The latter replaces configurations that are sensitive with the word "REDACTED". Other filter options are not supported. [optional] [default to export]

Return type

ApiDeployment2

Authorization

basic

HTTP request headers

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

get_kerberos_info

ApiKerberosInfo get_kerberos_info()

Provides Cloudera Manager Kerberos information.

Provides Cloudera Manager Kerberos information

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Provides Cloudera Manager Kerberos information.
    api_response = api_instance.get_kerberos_info()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_kerberos_info: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiKerberosInfo

Authorization

basic

HTTP request headers

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

get_kerberos_principals

ApiPrincipalList get_kerberos_principals(missing_only=missing_only)

Returns the Kerberos principals needed by the services being managed by Cloudera Manager.

Returns the Kerberos principals needed by the services being managed by Cloudera Manager.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
missing_only = true # bool | Whether to include only those principals which do not already exist in Cloudera Manager's database. (optional)

try:
    # Returns the Kerberos principals needed by the services being managed by Cloudera Manager.
    api_response = api_instance.get_kerberos_principals(missing_only=missing_only)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_kerberos_principals: %s\n" % e)

Parameters

Name Type Description Notes
missing_only bool Whether to include only those principals which do not already exist in Cloudera Manager's database. [optional]

Return type

ApiPrincipalList

Authorization

basic

HTTP request headers

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

get_krb5_conf

file get_krb5_conf()

Retrieves krb5.

Retrieves krb5.conf of the CM server host

Available since API v41.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Retrieves krb5.
    api_response = api_instance.get_krb5_conf()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_krb5_conf: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

file

Authorization

basic

HTTP request headers

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

get_licensed_feature_usage

ApiLicensedFeatureUsage get_licensed_feature_usage()

Retrieve a summary of licensed feature usage.

Retrieve a summary of licensed feature usage.

This command will return information about what Cloudera Enterprise licensed features are in use in the clusters being managed by this Cloudera Manager, as well as totals for usage across all clusters.

The specific features described can vary between different versions of Cloudera Manager.

Available since API v6.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Retrieve a summary of licensed feature usage.
    api_response = api_instance.get_licensed_feature_usage()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_licensed_feature_usage: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiLicensedFeatureUsage

Authorization

basic

HTTP request headers

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

get_log

str get_log()

Returns the entire contents of the Cloudera Manager log file.

Returns the entire contents of the Cloudera Manager log file

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Returns the entire contents of the Cloudera Manager log file.
    api_response = api_instance.get_log()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_log: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

str

Authorization

basic

HTTP request headers

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

get_scm_db_info

ApiScmDbInfo get_scm_db_info()

Provides Cloudera Manager server's database information.

Provides Cloudera Manager server's database information

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Provides Cloudera Manager server's database information.
    api_response = api_instance.get_scm_db_info()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_scm_db_info: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiScmDbInfo

Authorization

basic

HTTP request headers

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

get_shutdown_readiness

ApiShutdownReadiness get_shutdown_readiness(last_activity_time=last_activity_time)

Retrieve Cloudera Manager's readiness for shutdown and destroy.

Retrieve Cloudera Manager's readiness for shutdown and destroy. Applications that wish to destroy Cloudera Manager and its managed cluster should poll this API, repeatedly if necessary, to respect its readiness.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
last_activity_time = 'last_activity_time_example' # str | End time of the last known activity/workload against the managed clusters, in ISO 8601 format. (optional)

try:
    # Retrieve Cloudera Manager's readiness for shutdown and destroy.
    api_response = api_instance.get_shutdown_readiness(last_activity_time=last_activity_time)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_shutdown_readiness: %s\n" % e)

Parameters

Name Type Description Notes
last_activity_time str End time of the last known activity/workload against the managed clusters, in ISO 8601 format. [optional]

Return type

ApiShutdownReadiness

Authorization

basic

HTTP request headers

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

get_version

ApiVersionInfo get_version()

Provides version information of Cloudera Manager itself.

Provides version information of Cloudera Manager itself.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Provides version information of Cloudera Manager itself.
    api_response = api_instance.get_version()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->get_version: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiVersionInfo

Authorization

basic

HTTP request headers

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

host_install_command

ApiCommand host_install_command(body=body)

Perform installation on a set of hosts.

Perform installation on a set of hosts.

This command installs Cloudera Manager Agent on a set of hosts.

Available since API v6.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostInstallArguments() # ApiHostInstallArguments | Hosts to perform installation on (optional)

try:
    # Perform installation on a set of hosts.
    api_response = api_instance.host_install_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->host_install_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostInstallArguments Hosts to perform installation on [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_decommission_command

ApiCommand hosts_decommission_command(body=body)

Decommission the given hosts.

Decommission the given hosts. All slave roles on the hosts will be decommissioned. All other roles will be stopped.

To offline by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostNameList() # ApiHostNameList |  (optional)

try:
    # Decommission the given hosts.
    api_response = api_instance.hosts_decommission_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_decommission_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostNameList [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_offline_or_decommission_command

ApiCommand hosts_offline_or_decommission_command(offline_timeout=offline_timeout, body=body)

Decommission the given hosts.

Decommission the given hosts. All slave roles on the hosts will be offlined or decommissioned with preference being offlined if supported by the service.

Currently the offline operation is only supported by HDFS, where the offline operation will put DataNodes into HDFS IN MAINTENANCE state which prevents unnecessary re-replication which could occur if decommissioned.

All other roles on the hosts will be stopped.

The offlineTimeout parameter is used to specify a timeout for offline. For HDFS, when the timeout expires, the DataNode will automatically transition out of HDFS IN MAINTENANCE state, back to HDFS IN SERVICE state.

To offline or decommission by Upgrade Domain, use the “upgradeDomains” endpoint from the clusters resource to get the list of host names that belong in each Upgrade Domain. Available since API v40.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
offline_timeout = 56 # int | offline timeout in seconds. Specify as null to get the default timeout (4 hours). Ignored if service does not support he offline operation. (optional)
body = cm_client.ApiHostNameList() # ApiHostNameList | list of host names to decommission. (optional)

try:
    # Decommission the given hosts.
    api_response = api_instance.hosts_offline_or_decommission_command(offline_timeout=offline_timeout, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_offline_or_decommission_command: %s\n" % e)

Parameters

Name Type Description Notes
offline_timeout int offline timeout in seconds. Specify as null to get the default timeout (4 hours). Ignored if service does not support he offline operation. [optional]
body ApiHostNameList list of host names to decommission. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_perf_inspector_command

ApiCommand hosts_perf_inspector_command(body=body)

Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs User must be Full Administrator or Global Cluster Administrator.

Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs User must be Full Administrator or Global Cluster Administrator.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostsPerfInspectorArgs() # ApiHostsPerfInspectorArgs | Required arguments for the command. See ApiHostsPerfInspectorArgs. (optional)

try:
    # Run performance diagnostics test against specified hosts in ApiHostsPerfInspectorArgs  User must be Full Administrator or Global Cluster Administrator.
    api_response = api_instance.hosts_perf_inspector_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_perf_inspector_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostsPerfInspectorArgs Required arguments for the command. See ApiHostsPerfInspectorArgs. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_recommission_and_exit_maintenance_mode_command

ApiCommand hosts_recommission_and_exit_maintenance_mode_command(recommission_type=recommission_type, body=body)

Recommission and exit maintenance on the given hosts.

Recommission and exit maintenance on the given hosts. The recommission step may optionally start roles as well.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
recommission_type = 'recommission' # str |  (optional) (default to recommission)
body = cm_client.ApiHostNameList() # ApiHostNameList |  (optional)

try:
    # Recommission and exit maintenance on the given hosts.
    api_response = api_instance.hosts_recommission_and_exit_maintenance_mode_command(recommission_type=recommission_type, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_recommission_and_exit_maintenance_mode_command: %s\n" % e)

Parameters

Name Type Description Notes
recommission_type str [optional] [default to recommission]
body ApiHostNameList [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_recommission_command

ApiCommand hosts_recommission_command(body=body)

Recommission the given hosts.

Recommission the given hosts. All slave roles on the hosts will be recommissioned. Roles are not started after this command. Use hostsStartRoles command for that.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostNameList() # ApiHostNameList |  (optional)

try:
    # Recommission the given hosts.
    api_response = api_instance.hosts_recommission_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_recommission_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostNameList [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_recommission_with_start_command

ApiCommand hosts_recommission_with_start_command(body=body)

Recommission the given hosts.

Recommission the given hosts. If slave roles support start when decommissioned, start those roles before recommission. All slave roles on the hosts will be recommissioned. Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Recommission the given hosts. If possible, start those roles before recommission. All slave roles on the hosts will be recommissioned. Do not use without guidance from Cloudera. Currently, only HDFS DataNodes will be started by this 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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostNameList() # ApiHostNameList |  (optional)

try:
    # Recommission the given hosts.
    api_response = api_instance.hosts_recommission_with_start_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_recommission_with_start_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostNameList [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_start_roles_command

ApiCommand hosts_start_roles_command(body=body)

Start all the roles on the given hosts.

Start all the roles on the given hosts.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostNameList() # ApiHostNameList |  (optional)

try:
    # Start all the roles on the given hosts.
    api_response = api_instance.hosts_start_roles_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_start_roles_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostNameList [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

hosts_stop_roles_command

ApiCommand hosts_stop_roles_command(body=body)

Stop all the roles on the given hosts.

Stop all the roles on the given hosts.

Available since API v51. Stops roles on the given hosts.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiHostNameList() # ApiHostNameList | list of hosts (optional)

try:
    # Stop all the roles on the given hosts.
    api_response = api_instance.hosts_stop_roles_command(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->hosts_stop_roles_command: %s\n" % e)

Parameters

Name Type Description Notes
body ApiHostNameList list of hosts [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

import_admin_credentials

ApiCommand import_admin_credentials(password=password, username=username)

Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.

Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
password = 'password_example' # str | Password for the Account Manager.  return Information about the submitted command. (optional)
username = 'username_example' # str | Username of the Account Manager. Full name including the Kerberos realm must be specified. (optional)

try:
    # Imports the KDC Account Manager credentials needed by Cloudera Manager to create kerberos principals needed by CDH services.
    api_response = api_instance.import_admin_credentials(password=password, username=username)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->import_admin_credentials: %s\n" % e)

Parameters

Name Type Description Notes
password str Password for the Account Manager. return Information about the submitted command. [optional]
username str Username of the Account Manager. Full name including the Kerberos realm must be specified. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

import_cluster_template

ApiCommand import_cluster_template(add_repositories=add_repositories, body=body)

Create cluster as per the given cluster template.

Create cluster as per the given cluster template

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
add_repositories = false # bool | if true the parcels repositories in the cluster template will be added. (optional) (default to false)
body = cm_client.ApiClusterTemplate() # ApiClusterTemplate | cluster template (optional)

try:
    # Create cluster as per the given cluster template.
    api_response = api_instance.import_cluster_template(add_repositories=add_repositories, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->import_cluster_template: %s\n" % e)

Parameters

Name Type Description Notes
add_repositories bool if true the parcels repositories in the cluster template will be added. [optional] [default to false]
body ApiClusterTemplate cluster template [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

import_kerberos_principal

ApiCommand import_kerberos_principal(kvno=kvno, password=password, principal=principal)

Imports the Kerberos credentials for the specified principal which can then be used to add to a role's keytab by running Generate Credentials command.

Imports the Kerberos credentials for the specified principal which can then be used to add to a role's keytab by running Generate Credentials 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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
kvno = 56 # int | Key-version number of the password.  return Information about the submitted command. (optional)
password = 'password_example' # str | Password for the Kerberos principal. Cloudera Manager will encrypt the principal and password and use it when needed for a daemon. (optional)
principal = 'principal_example' # str | Name of the principal. Full name including the Kerberos realm must be specified. If it already exists, it will be overwritten. (optional)

try:
    # Imports the Kerberos credentials for the specified principal which can then be used to add to a role's keytab by running Generate Credentials command.
    api_response = api_instance.import_kerberos_principal(kvno=kvno, password=password, principal=principal)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->import_kerberos_principal: %s\n" % e)

Parameters

Name Type Description Notes
kvno int Key-version number of the password. return Information about the submitted command. [optional]
password str Password for the Kerberos principal. Cloudera Manager will encrypt the principal and password and use it when needed for a daemon. [optional]
principal str Name of the principal. Full name including the Kerberos realm must be specified. If it already exists, it will be overwritten. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

inspect_hosts_command

ApiCommand inspect_hosts_command()

Runs the host inspector on the configured hosts.

Runs the host inspector on the configured hosts.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Runs the host inspector on the configured hosts.
    api_response = api_instance.inspect_hosts_command()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->inspect_hosts_command: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

list_active_commands

ApiCommandList list_active_commands(view=view)

List active global commands.

List active global commands.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    # List active global commands.
    api_response = api_instance.list_active_commands(view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->list_active_commands: %s\n" % e)

Parameters

Name Type Description Notes
view str The view of the data to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiCommandList

Authorization

basic

HTTP request headers

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

migrate_cmca_to_db

ApiCommand migrate_cmca_to_db()

Migrate CMCA to the DB.

Migrate CMCA to the DB

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Migrate CMCA to the DB.
    api_response = api_instance.migrate_cmca_to_db()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->migrate_cmca_to_db: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

read_instance

ApiCmServer read_instance(cm_server_id)

Retrieves the CM server information.

Retrieves the CM server information.

Available since API v41.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
cm_server_id = 'cm_server_id_example' # str | The CM server ID.

try:
    # Retrieves the CM server information.
    api_response = api_instance.read_instance(cm_server_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->read_instance: %s\n" % e)

Parameters

Name Type Description Notes
cm_server_id str The CM server ID.

Return type

ApiCmServer

Authorization

basic

HTTP request headers

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

read_instances

ApiCmServerList read_instances()

Retrieves all CM server information.

Retrieves all CM server information.

Available since API v41.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Retrieves all CM server information.
    api_response = api_instance.read_instances()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->read_instances: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCmServerList

Authorization

basic

HTTP request headers

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

read_license

ApiLicense read_license()

Retrieve information about the Cloudera Manager license.

Retrieve information about the Cloudera Manager license.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Retrieve information about the Cloudera Manager license.
    api_response = api_instance.read_license()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->read_license: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiLicense

Authorization

basic

HTTP request headers

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

refresh_parcel_repos

ApiCommand refresh_parcel_repos()

.

Submit a command to refresh parcels information.

This API could be used following two scenarios.
- User updated Cloudera Manager's local parcel repository.
- User updated remote parcel locations.

User wants to invoke this API to make sure that Cloudera Manager gets latest parcels information. User can then monitor the returned command before proceeding to the next step.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # .
    api_response = api_instance.refresh_parcel_repos()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->refresh_parcel_repos: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

retrieve_keytab

file retrieve_keytab(body=body)

Retrieves a keytab for a list of principals.

Retrieves a keytab for a list of principals. The principals must already exist.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiPrincipalList() # ApiPrincipalList |  (optional)

try:
    # Retrieves a keytab for a list of principals.
    api_response = api_instance.retrieve_keytab(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->retrieve_keytab: %s\n" % e)

Parameters

Name Type Description Notes
body ApiPrincipalList [optional]

Return type

file

Authorization

basic

HTTP request headers

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

rotate_csp_keys

ApiCommand rotate_csp_keys()

Perform rotation of the CSP key.

Perform rotation of the CSP key. The previously encrypted text will be decrypted using the older key. Then It will be re-encrypted using the new CSP key.The new encrypted text will be stored in the database.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Perform rotation of the CSP key.
    api_response = api_instance.rotate_csp_keys()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->rotate_csp_keys: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

test_external_authentication

ApiCommand test_external_authentication(body=body)

Launches a command to test the currently configured external authentication.

Launches a command to test the currently configured external authentication

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiTestCmExternalAuthArguments() # ApiTestCmExternalAuthArguments |  (optional)

try:
    # Launches a command to test the currently configured external authentication.
    api_response = api_instance.test_external_authentication(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->test_external_authentication: %s\n" % e)

Parameters

Name Type Description Notes
body ApiTestCmExternalAuthArguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

update_config

ApiConfigList update_config(message=message, body=body)

Update the Cloudera Manager settings.

Update the Cloudera Manager settings.

If a value is set in the given configuration, it will be added to the manager's settings, replacing any existing entry. If a value is unset (its value is null), the existing the setting will be erased.

Settings that are not listed in the input will maintain their current values.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
message = 'message_example' # str | Optional message describing the changes. (optional)
body = cm_client.ApiConfigList() # ApiConfigList | Settings to update. (optional)

try:
    # Update the Cloudera Manager settings.
    api_response = api_instance.update_config(message=message, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->update_config: %s\n" % e)

Parameters

Name Type Description Notes
message str Optional message describing the changes. [optional]
body ApiConfigList Settings to update. [optional]

Return type

ApiConfigList

Authorization

basic

HTTP request headers

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

update_csp_type

ApiCommand update_csp_type(body=body)

Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type.

Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiUpdateCspTypeArguments() # ApiUpdateCspTypeArguments |  (optional)

try:
    # Updates the CSP type from previous csp type to new csp type, by copying the key_id (used for encryption of configs) from previous csp type to new csp type.
    api_response = api_instance.update_csp_type(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->update_csp_type: %s\n" % e)

Parameters

Name Type Description Notes
body ApiUpdateCspTypeArguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

update_deployment2

ApiDeployment2 update_deployment2(delete_current_deployment=delete_current_deployment, body=body)

Apply the supplied deployment description to the system.

Apply the supplied deployment description to the system. This will create the clusters, services, hosts and other objects specified in the argument. This call does not allow for any merge conflicts. If an entity already exists in the system, this call will fail. You can request, however, that all entities in the system are deleted before instantiating the new ones.

You may specify a complete or partial deployment, e.g. you can provide host info with no clusters. However, if you request that the current deployment be deleted, you are required to specify at least one admin user or this call will fail. This is to protect you from creating a system that cannot be logged into again.

If there are any errors creating (or optionally deleting) a deployment, all changes will be rolled back leaving the system exactly as it was before calling this method. The system will never be left in a state where part of the deployment is created and other parts are not.

If the submitted deployment contains entities that require Cloudera Enterprise license, then the license should be provided to Cloudera Manager before making this API call.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
delete_current_deployment = false # bool | If true, the current deployment is deleted before the specified deployment is applied (optional) (default to false)
body = cm_client.ApiDeployment2() # ApiDeployment2 | The deployment to create (optional)

try:
    # Apply the supplied deployment description to the system.
    api_response = api_instance.update_deployment2(delete_current_deployment=delete_current_deployment, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->update_deployment2: %s\n" % e)

Parameters

Name Type Description Notes
delete_current_deployment bool If true, the current deployment is deleted before the specified deployment is applied [optional] [default to false]
body ApiDeployment2 The deployment to create [optional]

Return type

ApiDeployment2

Authorization

basic

HTTP request headers

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

update_global_truststore

ApiCommand update_global_truststore(body=body)

Add/remove certificates to the Auto-TLS certificate truststore.

Add/remove certificates to the Auto-TLS certificate truststore

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiUpdateGlobalTruststoreArguments() # ApiUpdateGlobalTruststoreArguments |  (optional)

try:
    # Add/remove certificates to the Auto-TLS certificate truststore.
    api_response = api_instance.update_global_truststore(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->update_global_truststore: %s\n" % e)

Parameters

Name Type Description Notes
body ApiUpdateGlobalTruststoreArguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

update_license

ApiLicense update_license(license=license)

Updates the Cloudera Manager license.

Updates the Cloudera Manager license.

After a new license is installed, the Cloudera Manager needs to be restarted for the changes to take effect.

The license file should be uploaded using a request with content type "multipart/form-data", instead of being encoded into a JSON representation.

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.ClouderaManagerResourceApi(cm_client.ApiClient(configuration))
license = '/path/to/file.txt' # file |  (optional)

try:
    # Updates the Cloudera Manager license.
    api_response = api_instance.update_license(license=license)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClouderaManagerResourceApi->update_license: %s\n" % e)

Parameters

Name Type Description Notes
license file [optional]

Return type

ApiLicense

Authorization

basic

HTTP request headers

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