cm_client.ClustersResourceApi

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

Method HTTP request Description
add_hosts POST /clusters/{clusterName}/hosts
add_tags PUT /clusters/{clusterName}/tags Attach tags to the cluster.
auto_assign_roles PUT /clusters/{clusterName}/autoAssignRoles Automatically assign roles to hosts and create the roles for all the services in a cluster.
auto_configure PUT /clusters/{clusterName}/autoConfigure Automatically configures roles and services in a cluster.
configure_auto_tls_services_command POST /clusters/{clusterName}/commands/configureAutoTlsServices Configures all services in a cluster to use Auto-TLS.
configure_for_kerberos POST /clusters/{clusterName}/commands/configureForKerberos Command to configure the cluster to use Kerberos for authentication.
create_clusters POST /clusters Creates a collection of clusters.
delete_cluster DELETE /clusters/{clusterName} Deletes a cluster.
delete_cluster_credentials_command POST /clusters/{clusterName}/commands/deleteCredentials Delete existing Kerberos credentials for the cluster.
delete_tags DELETE /clusters/{clusterName}/tags Remove the tags associated with the cluster.
deploy_client_config POST /clusters/{clusterName}/commands/deployClientConfig Deploy the cluster-wide client configuration.
deploy_client_configs_and_refresh POST /clusters/{clusterName}/commands/deployClientConfigsAndRefresh 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.
deploy_cluster_client_config POST /clusters/{clusterName}/commands/deployClusterClientConfig Deploy the Cluster's Kerberos client configuration.
disable_tls POST /clusters/{clusterName}/commands/disableTls Disables TLS settings on a cluster.
enter_maintenance_mode POST /clusters/{clusterName}/commands/enterMaintenanceMode Put the cluster into maintenance mode.
exit_maintenance_mode POST /clusters/{clusterName}/commands/exitMaintenanceMode Take the cluster out of maintenance mode.
expire_logs POST /clusters/{clusterName}/commands/expireLogs Remove backup and disaster related log files in hdfs.
export GET /clusters/{clusterName}/export Export the cluster template for the given cluster.
first_run POST /clusters/{clusterName}/commands/firstRun Prepare and start services in a cluster.
get_client_config GET /clusters/{clusterName}/clientConfig Download a zip-compressed archive of the client configuration, of a specific cluster.
get_kerberos_info GET /clusters/{clusterName}/kerberosInfo Provides Cluster Kerberos information.
get_utilization_report GET /clusters/{clusterName}/utilization Provides the resource utilization of the entire cluster as well as the resource utilization per tenant.
inspect_hosts_command POST /clusters/{clusterName}/commands/inspectHosts Runs the host inspector on the configured hosts in the specified cluster.
is_tls_enabled GET /clusters/{clusterName}/isTlsEnabled Returns whether a cluster has any TLS settings enabled.
list_active_commands GET /clusters/{clusterName}/commands List active cluster commands.
list_dfs_services GET /clusters/{clusterName}/dfsServices List the services that can provide distributed file system (DFS) capabilities in this cluster.
list_hosts GET /clusters/{clusterName}/hosts Returns the hosts associated with the cluster filtered by optional host configuration parameter, if specified.
list_service_types GET /clusters/{clusterName}/serviceTypes List the supported service types for a cluster.
list_upgrade_domains GET /clusters/{clusterName}/upgradeDomains Returns the Upgrade Domains associated with the cluster and the host names that belong to each Upgrade Domain.
perf_inspector_command POST /clusters/{clusterName}/commands/perfInspector Run cluster performance diagnostics test.
pools_refresh POST /clusters/{clusterName}/commands/poolsRefresh Updates all refreshable configuration files for services with Dynamic Resource Pools.
pre_upgrade_check_command POST /clusters/{clusterName}/commands/preUpgradeCheck Run cluster pre-upgrade check(s) when upgrading from specified version of CDH to the other.
read_cluster GET /clusters/{clusterName} Reads information about a cluster.
read_clusters GET /clusters List all known clusters.
read_tags GET /clusters/{clusterName}/tags Returns the tags associated with this cluster.
refresh POST /clusters/{clusterName}/commands/refresh Updates all refreshable configuration files in the cluster.
remove_all_hosts DELETE /clusters/{clusterName}/hosts
remove_host DELETE /clusters/{clusterName}/hosts/{hostId}
restart_command POST /clusters/{clusterName}/commands/restart Restart all services in the cluster.
rolling_restart POST /clusters/{clusterName}/commands/rollingRestart Command to do a "best-effort" rolling restart of the given cluster, i.
rolling_upgrade POST /clusters/{clusterName}/commands/rollingUpgrade 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.
start_command POST /clusters/{clusterName}/commands/start Start all services in the cluster.
stop_command POST /clusters/{clusterName}/commands/stop Stop all services in the cluster.
update_cluster PUT /clusters/{clusterName} Update an existing cluster.
upgrade_cdh_command POST /clusters/{clusterName}/commands/upgradeCdh Perform CDH upgrade to the specified version.
upgrade_services_command POST /clusters/{clusterName}/commands/upgradeServices Upgrades the services in the cluster to the CDH5 version.

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.

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:
    # Attach tags to the cluster.
    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.

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:
    # Automatically assign roles to hosts and create the roles for all the services in a cluster.
    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.

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:
    # Automatically configures roles and services in a cluster.
    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]

configure_auto_tls_services_command

ApiCommand configure_auto_tls_services_command(cluster_name)

Configures all services in a cluster to use Auto-TLS.

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:
    # Configures all services in a cluster to use Auto-TLS.
    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.

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:
    # Command to configure the cluster to use Kerberos for authentication.
    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.

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:
    # Creates a collection of clusters.
    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.

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:
    # Deletes a cluster.
    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.

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:
    # Delete existing Kerberos credentials for the cluster.
    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.

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:
    # Remove the tags associated with the cluster.
    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.

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:
    # Deploy the cluster-wide client configuration.
    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.

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:
    # 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.
    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 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:
    # Deploy the Cluster's Kerberos client configuration.
    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.

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:
    # Disables TLS settings on a cluster.
    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]

enter_maintenance_mode

ApiCommand enter_maintenance_mode(cluster_name)

Put the cluster into maintenance mode.

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:
    # Put the cluster into maintenance mode.
    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.

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:
    # Take the cluster out of maintenance mode.
    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)

Remove backup and disaster related log files in hdfs.

Remove backup and disaster related log files in hdfs.

Available since API v31.

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 = 3.4 # float | logs more than these many days old are purged. -2 to use the existing setting (optional)

try:
    # Remove backup and disaster related log files in hdfs.
    api_response = api_instance.expire_logs(cluster_name, days=days)
    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 float logs more than these many days old are purged. -2 to use the existing setting [optional]

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.

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:
    # Export the cluster template for the given cluster.
    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.

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:
    # Prepare and start services in a cluster.
    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

file get_client_config(cluster_name)

Download a zip-compressed archive of the client configuration, of a specific cluster.

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:
    # Download a zip-compressed archive of the client configuration, of a specific cluster.
    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

file

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.

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:
    # Provides Cluster Kerberos information.
    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_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.

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 = 23 # 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) (default to 23)
_from = '_from_example' # str | Start of the time range to report utilization in ISO 8601 format. (optional)
start_hour_of_day = 0 # 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) (default to 0)
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:
    # Provides the resource utilization of the entire cluster as well as the resource utilization per tenant.
    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] [default to 23]
_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] [default to 0]
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.

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:
    # Runs the host inspector on the configured hosts in the specified cluster.
    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.

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:
    # Returns whether a cluster has any TLS settings enabled.
    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, view=view)

List active cluster commands.

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

try:
    # List active cluster commands.
    api_response = api_instance.list_active_commands(cluster_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 name of the cluster.
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.

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:
    # List the services that can provide distributed file system (DFS) capabilities in this cluster.
    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

ApiHostRefList list_hosts(cluster_name, config_name=config_name, config_value=config_value)

Returns the hosts associated with the cluster filtered by optional host configuration parameter, if specified.

Returns the hosts associated with the cluster filtered by optional host configuration parameter, 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 | 
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)

try:
    # Returns the hosts associated with the cluster filtered by optional host configuration parameter, if specified.
    api_response = api_instance.list_hosts(cluster_name, config_name=config_name, config_value=config_value)
    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
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]

Return type

ApiHostRefList

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.

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:
    # List the supported service types for a cluster.
    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.

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:
    # Returns the Upgrade Domains associated with the cluster and the host names that belong to each Upgrade Domain.
    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.

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:
    # Run cluster performance diagnostics test.
    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.

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:
    # Updates all refreshable configuration files for services with Dynamic Resource Pools.
    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]

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.

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:
    # Run cluster pre-upgrade check(s) when upgrading from specified version of CDH to the other.
    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)

Reads information about a cluster.

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.

try:
    # Reads information about a cluster.
    api_response = api_instance.read_cluster(cluster_name)
    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.

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.

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\" or \"compute\". 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:
    # List all known clusters.
    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" or "compute". 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.

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 = 10 # int | Number of tags (optional) (default to 10)
offset = 0 # int | Index of the first tag to retrieve (optional) (default to 0)

try:
    # Returns the tags associated with this cluster.
    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] [default to 10]
offset int Index of the first tag to retrieve [optional] [default to 0]

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.

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:
    # Updates all refreshable configuration files in the cluster.
    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.

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:
    # Restart all services in the cluster.
    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.

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:
    # Command to do a \"best-effort\" rolling restart of the given cluster, i.
    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.

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:
    # 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.
    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]

start_command

ApiCommand start_command(cluster_name)

Start all services in the cluster.

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:
    # Start all services in the cluster.
    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.

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:
    # Stop all services in the cluster.
    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]

update_cluster

ApiCluster update_cluster(cluster_name, body=body)

Update an existing cluster.

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:
    # Update an existing cluster.
    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.

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:
    # Perform CDH upgrade to the specified version.
    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.

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:
    # Upgrades the services in the cluster to the CDH5 version.
    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]