cm_client.ClustersResourceApi

All URIs are relative to /api/v58

Method HTTP request Description
add_hosts POST /clusters/{clusterName}/hosts
add_tags PUT /clusters/{clusterName}/tags
auto_assign_roles PUT /clusters/{clusterName}/autoAssignRoles
auto_configure PUT /clusters/{clusterName}/autoConfigure
check_ecs_prerequisites_command POST /clusters/{clusterName}/commands/checkEcsPrerequisites
configure_auto_tls_services_command POST /clusters/{clusterName}/commands/configureAutoTlsServices
configure_for_kerberos POST /clusters/{clusterName}/commands/configureForKerberos
create_clusters POST /clusters
delete_cluster DELETE /clusters/{clusterName}
delete_cluster_credentials_command POST /clusters/{clusterName}/commands/deleteCredentials
delete_tags DELETE /clusters/{clusterName}/tags
deploy_client_config POST /clusters/{clusterName}/commands/deployClientConfig
deploy_client_configs_and_refresh POST /clusters/{clusterName}/commands/deployClientConfigsAndRefresh
deploy_cluster_client_config POST /clusters/{clusterName}/commands/deployClusterClientConfig
disable_tls POST /clusters/{clusterName}/commands/disableTls
ecs_download_and_distribute POST /clusters/{clusterName}/commands/ecsDownloadAndDistribute
enter_maintenance_mode POST /clusters/{clusterName}/commands/enterMaintenanceMode
exit_maintenance_mode POST /clusters/{clusterName}/commands/exitMaintenanceMode
expire_logs POST /clusters/{clusterName}/commands/expireLogs
export GET /clusters/{clusterName}/export
first_run POST /clusters/{clusterName}/commands/firstRun
get_client_config GET /clusters/{clusterName}/clientConfig
get_cluster_support_token GET /clusters/{clusterName}/clusterSupportToken
get_kerberos_info GET /clusters/{clusterName}/kerberosInfo
get_ozone_bucket_info GET /clusters/{clusterName}/getOzoneBucketInfo
get_ozone_s3_gateway_info POST /clusters/{clusterName}/getOzoneS3GatewayInfo
get_utilization_report GET /clusters/{clusterName}/utilization
inspect_hosts_command POST /clusters/{clusterName}/commands/inspectHosts
is_tls_enabled GET /clusters/{clusterName}/isTlsEnabled
list_active_commands GET /clusters/{clusterName}/commands
list_dfs_services GET /clusters/{clusterName}/dfsServices
list_hosts GET /clusters/{clusterName}/hosts
list_service_types GET /clusters/{clusterName}/serviceTypes
list_upgrade_domains GET /clusters/{clusterName}/upgradeDomains
perf_inspector_command POST /clusters/{clusterName}/commands/perfInspector
pools_refresh POST /clusters/{clusterName}/commands/poolsRefresh
post_cloudera_runtime_upgrade POST /clusters/{clusterName}/commands/postClouderaRuntimeUpgrade
pre_upgrade_check_command POST /clusters/{clusterName}/commands/preUpgradeCheck
read_cluster GET /clusters/{clusterName}
read_clusters GET /clusters
read_tags GET /clusters/{clusterName}/tags
refresh POST /clusters/{clusterName}/commands/refresh
remove_all_hosts DELETE /clusters/{clusterName}/hosts
remove_host DELETE /clusters/{clusterName}/hosts/{hostId}
restart_command POST /clusters/{clusterName}/commands/restart
rolling_restart POST /clusters/{clusterName}/commands/rollingRestart
rolling_upgrade POST /clusters/{clusterName}/commands/rollingUpgrade
run_ozone_command POST /clusters/{clusterName}/runOzoneCommand
run_specific_host_inspections_command POST /clusters/{clusterName}/commands/runSpecificHostInspections
start_command POST /clusters/{clusterName}/commands/start
stop_command POST /clusters/{clusterName}/commands/stop
tear_down_workload_cluster POST /clusters/{clusterName}/commands/tearDownWorkload/{workloadClusterName}
update_cluster PUT /clusters/{clusterName}
upgrade_cdh_command POST /clusters/{clusterName}/commands/upgradeCdh
upgrade_services_command POST /clusters/{clusterName}/commands/upgradeServices

add_hosts

ApiHostRefList add_hosts(cluster_name, body=body)

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
body = cm_client.ApiHostRefList() # ApiHostRefList |  (optional)

try:
    api_response = api_instance.add_hosts(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->add_hosts: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
body ApiHostRefList [optional]

Return type

ApiHostRefList

Authorization

basic

HTTP request headers

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

add_tags

list[ApiEntityTag] add_tags(cluster_name, body=body)

Attach tags to the cluster. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | Name of the cluster
body = [cm_client.ApiEntityTag()] # list[ApiEntityTag] | list of tags to add (optional)

try:
    api_response = api_instance.add_tags(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->add_tags: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str Name of the cluster
body list[ApiEntityTag] list of tags to add [optional]

Return type

list[ApiEntityTag]

Authorization

basic

HTTP request headers

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

auto_assign_roles

auto_assign_roles(cluster_name)

Automatically assign roles to hosts and create the roles for all the services in a cluster.

Assignments are done based on services and hosts in the cluster, and hardware specifications. If no hosts are added to the cluster, an exception will be thrown preventing any role assignments. Existing roles will be taken into account and their assignments will be not be modified.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

try:
    api_instance.auto_assign_roles(cluster_name)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->auto_assign_roles: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

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]

auto_configure

auto_configure(cluster_name)

Automatically configures roles and services in a cluster.

Overwrites some existing configurations. Might create new role config groups. Only default role config groups must exist before calling this endpoint. Other role config groups must not exist. If they do, an exception will be thrown preventing any configuration. Ignores the Cloudera Management Service even if colocated with roles of this cluster. To avoid over-committing the heap on hosts, assign hosts to this cluster that are not being used by the Cloudera Management Service.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

try:
    api_instance.auto_configure(cluster_name)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->auto_configure: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

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]

check_ecs_prerequisites_command

ApiCommand check_ecs_prerequisites_command(cluster_name)

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 

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

Parameters

Name Type Description Notes
cluster_name str

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

configure_auto_tls_services_command

ApiCommand configure_auto_tls_services_command(cluster_name)

Configures all services in a cluster to use Auto-TLS

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

configure_for_kerberos

ApiCommand configure_for_kerberos(cluster_name, body=body)

Command to configure the cluster to use Kerberos for authentication. This command will configure all relevant services on a cluster for Kerberos usage. This command will trigger a GenerateCredentials command to create Kerberos keytabs for all roles in the cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiConfigureForKerberosArguments() # ApiConfigureForKerberosArguments | Arguments for the configure for kerberos command. (optional)

try:
    api_response = api_instance.configure_for_kerberos(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->configure_for_kerberos: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiConfigureForKerberosArguments Arguments for the configure for kerberos command. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

create_clusters

ApiClusterList create_clusters(body=body)

Creates a collection of 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.ClustersResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiClusterList() # ApiClusterList | List of clusters to created. (optional)

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

Parameters

Name Type Description Notes
body ApiClusterList List of clusters to created. [optional]

Return type

ApiClusterList

Authorization

basic

HTTP request headers

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

delete_cluster

ApiCluster delete_cluster(cluster_name)

Deletes a cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | Name of cluster to delete.

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

Parameters

Name Type Description Notes
cluster_name str Name of cluster to delete.

Return type

ApiCluster

Authorization

basic

HTTP request headers

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

delete_cluster_credentials_command

ApiCommand delete_cluster_credentials_command(cluster_name)

Delete existing Kerberos credentials for the cluster.

This command will affect all services that have been configured to use Kerberos, and have existing credentials.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | cluster name

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

Parameters

Name Type Description Notes
cluster_name str cluster name

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

delete_tags

list[ApiEntityTag] delete_tags(cluster_name, body=body)

Remove the tags associated with the cluster. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | Name of the cluster to remove tags from
body = [cm_client.ApiEntityTag()] # list[ApiEntityTag] |  (optional)

try:
    api_response = api_instance.delete_tags(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->delete_tags: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str Name of the cluster to remove tags from
body list[ApiEntityTag] [optional]

Return type

list[ApiEntityTag]

Authorization

basic

HTTP request headers

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

deploy_client_config

ApiCommand deploy_client_config(cluster_name)

Deploy the cluster-wide client configuration.

For each service in the cluster, deploy the service's client configuration to all the hosts that the service runs on.

Available since API v2.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

deploy_client_configs_and_refresh

ApiCommand deploy_client_configs_and_refresh(cluster_name)

Performs a command with the 2 steps - deploy cc - cluster refresh This orchestration is needed for the staleness wizard, so it can invoke a single command at wizard finish.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

deploy_cluster_client_config

ApiCommand deploy_cluster_client_config(cluster_name, body=body)

Deploy the Cluster's Kerberos client configuration.

Deploy krb5.conf to hosts in a cluster. Does not deploy to decommissioned hosts or hosts with active processes.

Available since API v7.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster
body = cm_client.ApiHostRefList() # ApiHostRefList | Hosts in cluster to deploy to. If empty, will target all eligible hosts in the cluster. (optional)

try:
    api_response = api_instance.deploy_cluster_client_config(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->deploy_cluster_client_config: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster
body ApiHostRefList Hosts in cluster to deploy to. If empty, will target all eligible hosts in the cluster. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

disable_tls

ApiCommand disable_tls(cluster_name)

Disables TLS settings on a cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

ecs_download_and_distribute

ApiCommand ecs_download_and_distribute(cluster_name, body=body)

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
body = cm_client.ApiEcsDownloadAndDistributeArgs() # ApiEcsDownloadAndDistributeArgs |  (optional)

try:
    api_response = api_instance.ecs_download_and_distribute(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->ecs_download_and_distribute: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
body ApiEcsDownloadAndDistributeArgs [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

enter_maintenance_mode

ApiCommand enter_maintenance_mode(cluster_name)

Put the cluster into maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v2.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

exit_maintenance_mode

ApiCommand exit_maintenance_mode(cluster_name)

Take the cluster out of maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v2.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

expire_logs

ApiCommand expire_logs(cluster_name, days=days, schedule_next=schedule_next)

Remove backup and disaster related log files in hdfs.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
days = 789 # int | Logs more than these many days old are purged. By default, it uses the value defined in the CM configuration. Set to -2 to explicitly set to default. (optional)
schedule_next = false # bool | Whether to schedule a next run for the command, or not. If set to true, the next run will get scheduled after this one finished. If a schedule already exists, it will be updated. Can be omitted, the default value is false. (optional) (default to false)

try:
    api_response = api_instance.expire_logs(cluster_name, days=days, schedule_next=schedule_next)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->expire_logs: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
days int Logs more than these many days old are purged. By default, it uses the value defined in the CM configuration. Set to -2 to explicitly set to default. [optional]
schedule_next bool Whether to schedule a next run for the command, or not. If set to true, the next run will get scheduled after this one finished. If a schedule already exists, it will be updated. Can be omitted, the default value is false. [optional] [default to false]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

export

ApiClusterTemplate export(cluster_name, export_auto_config=export_auto_config)

Export the cluster template for the given cluster. If cluster does not have host templates defined it will export host templates based on roles assignment.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | cluster name
export_auto_config = false # bool | export configs set by the auto configuration (optional) (default to false)

try:
    api_response = api_instance.export(cluster_name, export_auto_config=export_auto_config)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->export: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str cluster name
export_auto_config bool export configs set by the auto configuration [optional] [default to false]

Return type

ApiClusterTemplate

Authorization

basic

HTTP request headers

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

first_run

ApiCommand first_run(cluster_name)

Prepare and start services in a cluster.

Perform all the steps needed to prepare each service in a cluster and start the services in order.

Available since API v7.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

get_client_config

str get_client_config(cluster_name)

Download a zip-compressed archive of the client configuration, of a specific cluster. Currently, this only includes Kerberos Client Configuration (krb5.conf). For client configuration of services, use the clientConfig endpoint of the services resource. This resource does not require any 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The cluster name.

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

Parameters

Name Type Description Notes
cluster_name str The cluster name.

Return type

str

Authorization

basic

HTTP request headers

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

get_cluster_support_token

ApiClusterSupportToken get_cluster_support_token(cluster_name)

Gets the support token for a cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiClusterSupportToken

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(cluster_name)

Provides Cluster 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The cluster name.

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

Parameters

Name Type Description Notes
cluster_name str The cluster name.

Return type

ApiKerberosInfo

Authorization

basic

HTTP request headers

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

get_ozone_bucket_info

ApiOzoneBucketInfo get_ozone_bucket_info(cluster_name, bucket_name=bucket_name, volume_name=volume_name)

Returns the properties of the provided ozone bucket if the bucket exists.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
bucket_name = 'bucket_name_example' # str |  (optional)
volume_name = 'volume_name_example' # str |  (optional)

try:
    api_response = api_instance.get_ozone_bucket_info(cluster_name, bucket_name=bucket_name, volume_name=volume_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->get_ozone_bucket_info: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
bucket_name str [optional]
volume_name str [optional]

Return type

ApiOzoneBucketInfo

Authorization

basic

HTTP request headers

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

get_ozone_s3_gateway_info

ApiOzoneS3GatewayInfo get_ozone_s3_gateway_info(cluster_name, bucket_name=bucket_name)

Returns the REST url for the Ozone S3 Gateway, as well as the AWS credentials needed to access the S3 endpoint. Additionally, creates a bucket with the specified name under the volume s3v. If no Ozone is present, or Ozone is not running, returns success with an empty response. Currently, we get the credentials for the Hive kerberos principal, and give ownership of the created bucket to the same. This is likely not a permanent solution. If the cluster is not kerberizied, we return dummy credentials. Requires CDH 7.2.1+ or CDH 7.1.3+

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster
bucket_name = 'bucket_name_example' # str | the name of the bucket to create (optional)

try:
    api_response = api_instance.get_ozone_s3_gateway_info(cluster_name, bucket_name=bucket_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->get_ozone_s3_gateway_info: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster
bucket_name str the name of the bucket to create [optional]

Return type

ApiOzoneS3GatewayInfo

Authorization

basic

HTTP request headers

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

get_utilization_report

ApiClusterUtilization get_utilization_report(cluster_name, days_of_week=days_of_week, end_hour_of_day=end_hour_of_day, _from=_from, start_hour_of_day=start_hour_of_day, tenant_type=tenant_type, to=to)

Provides the resource utilization of the entire cluster as well as the resource utilization per tenant. 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | cluster name
days_of_week = ['days_of_week_example'] # list[str] | The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Monday, and 7 corrensponds to Sunday. All 7 days are included if this is not specified. (optional)
end_hour_of_day = 56 # int | The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. (optional)
_from = '_from_example' # str | Start of the time range to report utilization in ISO 8601 format. (optional)
start_hour_of_day = 56 # int | The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. (optional)
tenant_type = 'POOL' # str | The type of the tenant (POOL or USER). (optional) (default to POOL)
to = 'now' # str | End of the the time range to report utilization in ISO 8601 format (defaults to now). (optional) (default to now)

try:
    api_response = api_instance.get_utilization_report(cluster_name, days_of_week=days_of_week, end_hour_of_day=end_hour_of_day, _from=_from, start_hour_of_day=start_hour_of_day, tenant_type=tenant_type, to=to)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->get_utilization_report: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str cluster name
days_of_week list[str] The days of the week for which the user wants to report utilization. Days is a list of number between 1 to 7, where 1 corresponds to Monday, and 7 corrensponds to Sunday. All 7 days are included if this is not specified. [optional]
end_hour_of_day int The end hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 23 if this is not specified. [optional]
_from str Start of the time range to report utilization in ISO 8601 format. [optional]
start_hour_of_day int The start hour of a day for which the user wants to report utilization. The hour is a number between [0-23]. Default value is 0 if this is not specified. [optional]
tenant_type str The type of the tenant (POOL or USER). [optional] [default to POOL]
to str End of the the time range to report utilization in ISO 8601 format (defaults to now). [optional] [default to now]

Return type

ApiClusterUtilization

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(cluster_name)

Runs the host inspector on the configured hosts in the specified cluster. Available since V8.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

is_tls_enabled

bool is_tls_enabled(cluster_name)

Returns whether a cluster has any TLS settings enabled. This only checks settings that would have been enabled by Auto-TLS.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

bool

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(cluster_name, command_name=command_name, view=view)

List active cluster 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The cluster to which the role belongs.
command_name = 'command_name_example' # str | the command name, unique for the command class RestartClusterCommand#COMMAND_NAME (optional)
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    api_response = api_instance.list_active_commands(cluster_name, command_name=command_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->list_active_commands: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The cluster to which the role belongs.
command_name str the command name, unique for the command class RestartClusterCommand#COMMAND_NAME [optional]
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]

list_dfs_services

ApiServiceList list_dfs_services(cluster_name, view=view)

List the services that can provide distributed file system (DFS) capabilities in this cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | cluster name
view = 'summary' # str | data view required for matching services (optional) (default to summary)

try:
    api_response = api_instance.list_dfs_services(cluster_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->list_dfs_services: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str cluster name
view str data view required for matching services [optional] [default to summary]

Return type

ApiServiceList

Authorization

basic

HTTP request headers

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

list_hosts

ApiHostList list_hosts(cluster_name, config_name=config_name, config_value=config_value, view=view)

Returns hosts in the system filtered by optional host configuration parameters, if specified.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | Name of the cluster
config_name = 'config_name_example' # str | optional host config name to filter hosts by. Available from v40. (optional)
config_value = 'config_value_example' # str | host config value associated with config name. Available from v40. (optional)
view = 'summary' # str | The view to materialize (optional) (default to summary)

try:
    api_response = api_instance.list_hosts(cluster_name, config_name=config_name, config_value=config_value, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->list_hosts: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str Name of the cluster
config_name str optional host config name to filter hosts by. Available from v40. [optional]
config_value str host config value associated with config name. Available from v40. [optional]
view str The view to materialize [optional] [default to summary]

Return type

ApiHostList

Authorization

basic

HTTP request headers

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

list_service_types

ApiServiceTypeList list_service_types(cluster_name)

List the supported service types for a cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The cluster.

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

Parameters

Name Type Description Notes
cluster_name str The cluster.

Return type

ApiServiceTypeList

Authorization

basic

HTTP request headers

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

list_upgrade_domains

ApiHdfsUpgradeDomainList list_upgrade_domains(cluster_name)

Returns the Upgrade Domains associated with the cluster and the host names that belong to each Upgrade Domain. Hosts without an Upgrade Domain set will default to using the rack assignment of the host.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiHdfsUpgradeDomainList

Authorization

basic

HTTP request headers

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

perf_inspector_command

ApiCommand perf_inspector_command(cluster_name, body=body)

Run cluster performance diagnostics test.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiClusterPerfInspectorArgs() # ApiClusterPerfInspectorArgs | Optional arguments for the command. See ApiClusterPerfInspectorArgs. (optional)

try:
    api_response = api_instance.perf_inspector_command(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->perf_inspector_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiClusterPerfInspectorArgs Optional arguments for the command. See ApiClusterPerfInspectorArgs. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

pools_refresh

ApiCommand pools_refresh(cluster_name)

Updates all refreshable configuration files for services with Dynamic Resource Pools.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

post_cloudera_runtime_upgrade

ApiCommand post_cloudera_runtime_upgrade(cluster_name)

Post Cloudera Runtime upgrade API.

This API executes special finalization tasks (already part of regular CDH upgrade) after the installation of an updated build of Cloudera Runtime (no version change). No version change of Cloudera Rumtime means when first 3 digits of build remains the same (e.g. from 7.2.1.a to 7.2.1.b) during upgrade. Purpose of this is to automate manual tasks of CDH upgrade.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 

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

Parameters

Name Type Description Notes
cluster_name str

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

pre_upgrade_check_command

ApiCommand pre_upgrade_check_command(cluster_name, body=body)

Run cluster pre-upgrade check(s) when upgrading from specified version of CDH to the other.

Allows the following upgrade checks:

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiCdhUpgradeArgs() # ApiCdhUpgradeArgs | Arguments for the command. See ApiCdhUpgradeArgs. (optional)

try:
    api_response = api_instance.pre_upgrade_check_command(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->pre_upgrade_check_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiCdhUpgradeArgs Arguments for the command. See ApiCdhUpgradeArgs. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

read_cluster

ApiCluster read_cluster(cluster_name, view=view)

Reads information about a cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | Name of cluster to look up.
view = 'summary' # str | The view to materialize (optional) (default to summary)

try:
    api_response = api_instance.read_cluster(cluster_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->read_cluster: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str Name of cluster to look up.
view str The view to materialize [optional] [default to summary]

Return type

ApiCluster

Authorization

basic

HTTP request headers

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

read_clusters

ApiClusterList read_clusters(cluster_type=cluster_type, view=view)

List all known 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_type = 'base' # str | Type of cluster, either \"any\", \"base\", \"compute\" or \"experience\". Default is \"base\". (optional) (default to base)
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    api_response = api_instance.read_clusters(cluster_type=cluster_type, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->read_clusters: %s\n" % e)

Parameters

Name Type Description Notes
cluster_type str Type of cluster, either "any", "base", "compute" or "experience". Default is "base". [optional] [default to base]
view str The view of the data to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiClusterList

Authorization

basic

HTTP request headers

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

read_tags

list[ApiEntityTag] read_tags(cluster_name, limit=limit, offset=offset)

Returns the tags associated with this cluster. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster
limit = 56 # int | Number of tags (optional)
offset = 56 # int | Index of the first tag to retrieve (optional)

try:
    api_response = api_instance.read_tags(cluster_name, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->read_tags: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster
limit int Number of tags [optional]
offset int Index of the first tag to retrieve [optional]

Return type

list[ApiEntityTag]

Authorization

basic

HTTP request headers

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

refresh

ApiCommand refresh(cluster_name)

Updates all refreshable configuration files in the cluster. Will not restart any roles.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

remove_all_hosts

ApiHostRefList remove_all_hosts(cluster_name)

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 

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

Parameters

Name Type Description Notes
cluster_name str

Return type

ApiHostRefList

Authorization

basic

HTTP request headers

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

remove_host

ApiHostRef remove_host(cluster_name, host_id)

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
host_id = 'host_id_example' # str | 

try:
    api_response = api_instance.remove_host(cluster_name, host_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->remove_host: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
host_id str

Return type

ApiHostRef

Authorization

basic

HTTP request headers

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

restart_command

ApiCommand restart_command(cluster_name, body=body)

Restart all services in the cluster.

Services are stopped then started in the appropriate order given their dependencies. The command can optionally restart only stale services and their dependencies as well as redeploy client configuration on all services in the cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiRestartClusterArgs() # ApiRestartClusterArgs | arguments for the restart command. (optional)

try:
    api_response = api_instance.restart_command(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->restart_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiRestartClusterArgs arguments for the restart command. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

rolling_restart

ApiCommand rolling_restart(cluster_name, body=body)

Command to do a "best-effort" rolling restart of the given cluster, i.e. it does plain restart of services that cannot be rolling restarted, followed by first rolling restarting non-slaves and then rolling restarting the slave roles of services that can be rolling restarted. The slave restarts are done host-by-host.

Available since API v4. 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiRollingRestartClusterArgs() # ApiRollingRestartClusterArgs | Arguments for the rolling restart command. (optional)

try:
    api_response = api_instance.rolling_restart(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->rolling_restart: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiRollingRestartClusterArgs Arguments for the rolling restart command. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

rolling_upgrade

ApiCommand rolling_upgrade(cluster_name, body=body)

Command to do a rolling upgrade of specific services in the given cluster This command does not handle any services that don't support rolling upgrades. The command will throw an error and not start if upgrade of any such service is requested. This command does not upgrade the full CDH Cluster. You should normally use the upgradeCDH Command for upgrading the cluster. This is primarily helpful if you need to need to recover from an upgrade failure or for advanced users to script an alternative to the upgradeCdhCommand. This command expects the binaries to be available on hosts and activated. It does not change any binaries on the 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiRollingUpgradeServicesArgs() # ApiRollingUpgradeServicesArgs | Arguments for the rolling upgrade command. (optional)

try:
    api_response = api_instance.rolling_upgrade(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->rolling_upgrade: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiRollingUpgradeServicesArgs Arguments for the rolling upgrade command. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

run_ozone_command

ApiCommand run_ozone_command(cluster_name, bucket_name=bucket_name, command_name=command_name, volume_name=volume_name)

Executes an Ozone shell command on an Ozone Role. The command needs to be defined as a RoleCommand in CM (Eg GetOzoneBucketInfoCommand).

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The cluster to which the role belongs.
bucket_name = 'bucket_name_example' # str | name of the Ozone bucket (optional)
command_name = 'command_name_example' # str | The command to run on an Ozone Role. (optional)
volume_name = 'volume_name_example' # str | name of the Ozone volume (optional)

try:
    api_response = api_instance.run_ozone_command(cluster_name, bucket_name=bucket_name, command_name=command_name, volume_name=volume_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->run_ozone_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The cluster to which the role belongs.
bucket_name str name of the Ozone bucket [optional]
command_name str The command to run on an Ozone Role. [optional]
volume_name str name of the Ozone volume [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

run_specific_host_inspections_command

ApiCommand run_specific_host_inspections_command(cluster_name, body=body)

Runs a specific list of host inspections.

This command runs the ClusterInspectorCommand, which runs the host inspections for all the hosts in a cluster. More specifically, this command will run a specific list of host inspections specified by the user. If no host inspection list name is provided, the default list of inspections will be ran.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | the name of the cluster you want to run the host inspections
body = cm_client.ApiRunSpecificHostInspectionsArgs() # ApiRunSpecificHostInspectionsArgs | An object that contains the name of the list of inspections to be run. (optional)

try:
    api_response = api_instance.run_specific_host_inspections_command(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->run_specific_host_inspections_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str the name of the cluster you want to run the host inspections
body ApiRunSpecificHostInspectionsArgs An object that contains the name of the list of inspections to be run. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

start_command

ApiCommand start_command(cluster_name)

Start all services in the cluster.

Services are started in the appropriate order given their dependencies.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

stop_command

ApiCommand stop_command(cluster_name)

Stop all services in the cluster.

Services are stopped in the appropriate order given their dependencies.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

tear_down_workload_cluster

ApiCommand tear_down_workload_cluster(cluster_name, workload_cluster_name)

Tear Down Workload cluster.

Tear Down Ranger plugin service (repository) associated with the workload cluster.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
workload_cluster_name = 'workload_cluster_name_example' # str | The name of the workload cluster.

try:
    api_response = api_instance.tear_down_workload_cluster(cluster_name, workload_cluster_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->tear_down_workload_cluster: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
workload_cluster_name str The name of the workload cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

update_cluster

ApiCluster update_cluster(cluster_name, body=body)

Update an existing cluster.

To update the CDH version, provide the new value in the "fullVersion" property. Setting a correct version that matches the actual installed software will ensure the correct version-specific features, such as services, roles, commands, and configurations. This need not be manually set for clusters using parcels. In general this action is only necessary after the CDH packages have been manually updated. Note that a downgrade may be rejected if it would render existing services or roles unusable. For major upgrade, the "upgradeService" cluster command should be used instead.

To rename the cluster, provide the new name in the "displayName" property for API >= 6, or in the "name" property for API <=5.

Available since API v2.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiCluster() # ApiCluster |  (optional)

try:
    api_response = api_instance.update_cluster(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->update_cluster: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiCluster [optional]

Return type

ApiCluster

Authorization

basic

HTTP request headers

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

upgrade_cdh_command

ApiCommand upgrade_cdh_command(cluster_name, body=body)

Perform CDH upgrade to the specified version.

Allows the following upgrades:

If using packages, CDH packages on all hosts of the cluster must be manually upgraded before this command is issued.

The command will upgrade the services and their configuration to the version available in the CDH5 distribution.

Unless rolling upgrade options are provided, the entire cluster will experience downtime. If rolling upgrade options are provided, command will do a "best-effort" rolling upgrade of the given cluster, i.e. it does plain upgrade of services that cannot be rolling upgraded, followed by first rolling upgrading non-slaves and then rolling restarting the slave roles of services that can be rolling restarted. The slave restarts are done host-by-host.

Available since v9. Rolling upgrade is only available with Cloudera Manager Enterprise Edition. A more limited upgrade variant available since 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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.
body = cm_client.ApiCdhUpgradeArgs() # ApiCdhUpgradeArgs | Arguments for the command. See ApiCdhUpgradeArgs. (optional)

try:
    api_response = api_instance.upgrade_cdh_command(cluster_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ClustersResourceApi->upgrade_cdh_command: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.
body ApiCdhUpgradeArgs Arguments for the command. See ApiCdhUpgradeArgs. [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

upgrade_services_command

ApiCommand upgrade_services_command(cluster_name)

Upgrades the services in the cluster to the CDH5 version.

This command requires that the CDH packages in the hosts used by the cluster be upgraded to CDH5 before this command is issued. Once issued, this command will stop all running services before proceeding.

If parcels are used instead of CDH system packages then the following steps need to happen in order:

  1. Stop all services manually
  2. Activate parcel
  3. Run this upgrade command
The command will upgrade the services and their configuration to the version available in the CDH5 distribution.

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.ClustersResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | The name of the cluster.

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

Parameters

Name Type Description Notes
cluster_name str The name of the cluster.

Return type

ApiCommand

Authorization

basic

HTTP request headers

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