All URIs are relative to /api/v58
| Method | HTTP request | Description |
|---|---|---|
| add_tags | PUT /clusters/{clusterName}/services/{serviceName}/tags | |
| collect_yarn_application_diagnostics | POST /clusters/{clusterName}/services/{serviceName}/commands/yarnApplicationDiagnosticsCollection | |
| copy_hdfs_file | POST /clusters/{clusterName}/services/{serviceName}/commands/copyHdfsFile | |
| create_beeswax_warehouse_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hueCreateHiveWarehouse | |
| create_h_base_root_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseCreateRoot | |
| create_hdfs_file | POST /clusters/{clusterName}/services/{serviceName}/commands/createHdfsFile | |
| create_hive_user_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveUserDir | |
| create_hive_warehouse_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveWarehouse | |
| create_hive_warehouse_external_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveWarehouseExternal | |
| create_impala_user_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaCreateUserDir | |
| create_oozie_db | POST /clusters/{clusterName}/services/{serviceName}/commands/createOozieDb | |
| create_services | POST /clusters/{clusterName}/services | |
| create_solr_hdfs_home_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/createSolrHdfsHomeDir | |
| create_sqoop_user_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/createSqoopUserDir | |
| create_yarn_cm_container_usage_input_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/yarnCreateCmContainerUsageInputDirCommand | |
| create_yarn_job_history_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/yarnCreateJobHistoryDirCommand | |
| create_yarn_node_manager_remote_app_log_dir_command | POST /clusters/{clusterName}/services/{serviceName}/commands/yarnNodeManagerRemoteAppLogDirCommand | |
| decommission_command | POST /clusters/{clusterName}/services/{serviceName}/commands/decommission | |
| delete_hdfs_path | DELETE /clusters/{clusterName}/services/{serviceName}/commands/deleteHdfsPath | |
| delete_service | DELETE /clusters/{clusterName}/services/{serviceName} | |
| delete_tags | DELETE /clusters/{clusterName}/services/{serviceName}/tags | |
| deploy_client_config_command | POST /clusters/{clusterName}/services/{serviceName}/commands/deployClientConfig | |
| disable_catalog_statestore_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/disableCatalogStatestoreHa | |
| disable_jt_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/disableJtHa | |
| disable_llama_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaDisableLlamaHa | |
| disable_llama_rm_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaDisableLlamaRm | |
| disable_oozie_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/oozieDisableHa | |
| disable_rm_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/disableRmHa | |
| disable_sentry_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/disableSentryHa | |
| ecs_upgrade_audit | POST /clusters/{clusterName}/services/{serviceName}/commands/ecsUpgradeAudit | |
| enable_catalog_statestore_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/enableCatalogStatestoreHa | |
| enable_jt_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/enableJtHa | |
| enable_llama_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaEnableLlamaHa | |
| enable_llama_rm_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaEnableLlamaRm | |
| enable_oozie_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/oozieEnableHa | |
| enable_rm_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/enableRmHa | |
| enable_sentry_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/enableSentryHa | |
| enter_maintenance_mode | POST /clusters/{clusterName}/services/{serviceName}/commands/enterMaintenanceMode | |
| exit_maintenance_mode | POST /clusters/{clusterName}/services/{serviceName}/commands/exitMaintenanceMode | |
| export_sentry_permissions_command | POST /clusters/{clusterName}/services/{serviceName}/commands/exportSentryPermissions | |
| first_run | POST /clusters/{clusterName}/services/{serviceName}/commands/firstRun | |
| get_client_config | GET /clusters/{clusterName}/services/{serviceName}/clientConfig | |
| get_entity_types_from_atlas | GET /clusters/{clusterName}/services/{serviceName}/commands/getEntityTypesFromAtlas | |
| get_hdfs_usage_report | GET /clusters/{clusterName}/services/{serviceName}/reports/hdfsUsageReport | |
| get_impala_utilization | GET /clusters/{clusterName}/services/{serviceName}/impalaUtilization | |
| get_metrics | GET /clusters/{clusterName}/services/{serviceName}/metrics | |
| get_mr_usage_report | GET /clusters/{clusterName}/services/{serviceName}/reports/mrUsageReport | |
| get_policies_from_ranger | GET /clusters/{clusterName}/services/{serviceName}/commands/getPoliciesFromRanger | |
| get_services_from_ranger | GET /clusters/{clusterName}/services/{serviceName}/commands/getServicesFromRanger | |
| get_users_from_ranger | GET /clusters/{clusterName}/services/{serviceName}/commands/getUsersFromRanger | |
| get_yarn_utilization | GET /clusters/{clusterName}/services/{serviceName}/yarnUtilization | |
| hbase_replication_create_user_directory | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseCreateUserDirectory | |
| hbase_replication_first_time_setup_automatic | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupAutomatic | |
| hbase_replication_first_time_setup_clean_and_reset | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupCleanAndReset | |
| hbase_replication_first_time_setup_for_already_paired_clusters | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForAlreadyPairedClusters | |
| hbase_replication_first_time_setup_for_source_only | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForSourceOnly | |
| hbase_replication_first_time_setup_for_target_only | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForTargetOnly | |
| hbase_replication_first_time_setup_force_ready | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupForceReady | |
| hbase_replication_first_time_setup_manual | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupManual | |
| hbase_replication_first_time_setup_manual_continue | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupManualContinue | |
| hbase_replication_first_time_setup_reset | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupReset | |
| hbase_replication_first_time_setup_status | GET /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationFirstTimeSetupStatus | |
| hbase_replication_setup | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationSetup | |
| hbase_replication_setup_admin | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseReplicationSetupAdmin | |
| hbase_shell_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseShellCommand | |
| hbase_upgrade_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hbaseUpgrade | |
| hdfs_add_sbnnto_ns_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsAddSBNNToNS | |
| hdfs_create_tmp_dir | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsCreateTmpDir | |
| hdfs_disable_auto_failover_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableAutoFailover | |
| hdfs_disable_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableHa | |
| hdfs_disable_nn_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableNnHa | |
| hdfs_enable_auto_failover_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableAutoFailover | |
| hdfs_enable_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableHa | |
| hdfs_enable_nn_ha_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableNnHa | |
| hdfs_failover_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsFailover | |
| hdfs_finalize_rolling_upgrade | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsFinalizeRollingUpgrade | |
| hdfs_roll_edits_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsRollEdits | |
| hdfs_upgrade_metadata_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hdfsUpgradeMetadata | |
| hive_create_metastore_database_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateMetastoreDatabase | |
| hive_create_metastore_database_tables_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateMetastoreDatabaseTables | |
| hive_update_metastore_namenodes_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveUpdateMetastoreNamenodes | |
| hive_upgrade_metastore_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveUpgradeMetastore | |
| hive_validate_metastore_schema_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hiveValidateMetastoreSchema | |
| hue_dump_db_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hueDumpDb | |
| hue_load_db_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hueLoadDb | |
| hue_sync_db_command | POST /clusters/{clusterName}/services/{serviceName}/commands/hueSyncDb | |
| iceberg_replication_test_access | POST /clusters/{clusterName}/services/{serviceName}/commands/icebergReplicationTestAccess | |
| impala_create_catalog_database_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaCreateCatalogDatabase | |
| impala_create_catalog_database_tables_command | POST /clusters/{clusterName}/services/{serviceName}/commands/impalaCreateCatalogDatabaseTables | |
| import_mr_configs_into_yarn | POST /clusters/{clusterName}/services/{serviceName}/commands/importMrConfigsIntoYarn | |
| init_solr_command | POST /clusters/{clusterName}/services/{serviceName}/commands/initSolr | |
| install_mr_framework_jars | POST /clusters/{clusterName}/services/{serviceName}/commands/installMrFrameworkJars | |
| install_oozie_share_lib | POST /clusters/{clusterName}/services/{serviceName}/commands/installOozieShareLib | |
| ks_migrate_to_sentry | POST /clusters/{clusterName}/services/{serviceName}/commands/migrateToSentry | |
| list_active_commands | GET /clusters/{clusterName}/services/{serviceName}/commands | |
| list_role_types | GET /clusters/{clusterName}/services/{serviceName}/roleTypes | |
| list_service_commands | GET /clusters/{clusterName}/services/{serviceName}/commandsByName | |
| offline_command | POST /clusters/{clusterName}/services/{serviceName}/commands/offline | |
| oozie_create_embedded_database_command | POST /clusters/{clusterName}/services/{serviceName}/commands/oozieCreateEmbeddedDatabase | |
| oozie_dump_database_command | POST /clusters/{clusterName}/services/{serviceName}/commands/oozieDumpDatabase | |
| oozie_load_database_command | POST /clusters/{clusterName}/services/{serviceName}/commands/oozieLoadDatabase | |
| oozie_upgrade_db_command | POST /clusters/{clusterName}/services/{serviceName}/commands/oozieUpgradeDb | |
| read_service | GET /clusters/{clusterName}/services/{serviceName} | |
| read_service_config | GET /clusters/{clusterName}/services/{serviceName}/config | |
| read_services | GET /clusters/{clusterName}/services | |
| read_tags | GET /clusters/{clusterName}/services/{serviceName}/tags | |
| recommission_command | POST /clusters/{clusterName}/services/{serviceName}/commands/recommission | |
| recommission_with_start_command | POST /clusters/{clusterName}/services/{serviceName}/commands/recommissionWithStart | |
| restart_command | POST /clusters/{clusterName}/services/{serviceName}/commands/restart | |
| rolling_restart | POST /clusters/{clusterName}/services/{serviceName}/commands/rollingRestart | |
| rotate_ecs_certificates | POST /clusters/{clusterName}/services/{serviceName}/commands/rotateEcsCertificates | |
| sentry_create_database_command | POST /clusters/{clusterName}/services/{serviceName}/commands/sentryCreateDatabase | |
| sentry_create_database_tables_command | POST /clusters/{clusterName}/services/{serviceName}/commands/sentryCreateDatabaseTables | |
| sentry_upgrade_database_tables_command | POST /clusters/{clusterName}/services/{serviceName}/commands/sentryUpgradeDatabaseTables | |
| service_command_by_name | POST /clusters/{clusterName}/services/{serviceName}/commands/{commandName} | |
| solr_bootstrap_collections_command | POST /clusters/{clusterName}/services/{serviceName}/commands/solrBootstrapCollections | |
| solr_bootstrap_config_command | POST /clusters/{clusterName}/services/{serviceName}/commands/solrBootstrapConfig | |
| solr_config_backup_command | POST /clusters/{clusterName}/services/{serviceName}/commands/solrConfigBackup | |
| solr_migrate_sentry_privileges_command | POST /clusters/{clusterName}/services/{serviceName}/commands/solrMigrateSentryPrivilegesCommand | |
| solr_reinitialize_state_for_upgrade_command | POST /clusters/{clusterName}/services/{serviceName}/commands/solrReinitializeStateForUpgrade | |
| solr_validate_metadata_command | POST /clusters/{clusterName}/services/{serviceName}/commands/solrValidateMetadata | |
| sqoop_create_database_tables_command | POST /clusters/{clusterName}/services/{serviceName}/commands/sqoopCreateDatabaseTables | |
| sqoop_upgrade_db_command | POST /clusters/{clusterName}/services/{serviceName}/commands/sqoopUpgradeDb | |
| start_command | POST /clusters/{clusterName}/services/{serviceName}/commands/start | |
| stop_command | POST /clusters/{clusterName}/services/{serviceName}/commands/stop | |
| switch_to_mr2 | POST /clusters/{clusterName}/services/{serviceName}/commands/switchToMr2 | |
| update_ecs_ingress_controller_cert | POST /clusters/{clusterName}/services/{serviceName}/commands/updateEcsIngressControllerCert | |
| update_service | PUT /clusters/{clusterName}/services/{serviceName} | |
| update_service_config | PUT /clusters/{clusterName}/services/{serviceName}/config | |
| yarn_format_state_store | POST /clusters/{clusterName}/services/{serviceName}/commands/yarnFormatStateStore | |
| zoo_keeper_cleanup_command | POST /clusters/{clusterName}/services/{serviceName}/commands/zooKeeperCleanup | |
| zoo_keeper_init_command | POST /clusters/{clusterName}/services/{serviceName}/commands/zooKeeperInit |
list[ApiEntityTag] add_tags(cluster_name, service_name, body=body)
Attach tags to the service. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the service
body = [cm_client.ApiEntityTag()] # list[ApiEntityTag] | List of tags to add to the service (optional)
try:
api_response = api_instance.add_tags(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->add_tags: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the service | |
| body | list[ApiEntityTag] | List of tags to add to the service | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand collect_yarn_application_diagnostics(cluster_name, service_name, body=body)
Collect the Diagnostics data for Yarn applications
Available since API v8.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the YARN service on which to run the command.
body = cm_client.ApiYarnApplicationDiagnosticsCollectionArgs() # ApiYarnApplicationDiagnosticsCollectionArgs | Arguments used for collecting diagnostics data for Yarn applications (optional)
try:
api_response = api_instance.collect_yarn_application_diagnostics(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->collect_yarn_application_diagnostics: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the YARN service on which to run the command. | |
| body | ApiYarnApplicationDiagnosticsCollectionArgs | Arguments used for collecting diagnostics data for Yarn applications | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand copy_hdfs_file(cluster_name, service_name, body=body, destination_path=destination_path, source_path=source_path)
Copies source HDFS file to destination cluster HDFS
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The source HDFS service
body = cm_client.ApiServiceRef() # ApiServiceRef | ApiServiceRef for the destination (optional)
destination_path = 'destination_path_example' # str | HDFS full path at destination (optional)
source_path = 'source_path_example' # str | HDFS full path at source (optional)
try:
api_response = api_instance.copy_hdfs_file(cluster_name, service_name, body=body, destination_path=destination_path, source_path=source_path)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->copy_hdfs_file: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The source HDFS service | |
| body | ApiServiceRef | ApiServiceRef for the destination | [optional] |
| destination_path | str | HDFS full path at destination | [optional] |
| source_path | str | HDFS full path at source | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_beeswax_warehouse_command(cluster_name, service_name)
Create the Beeswax role's Hive warehouse directory, on Hue services.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Hue service name.
try:
api_response = api_instance.create_beeswax_warehouse_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_beeswax_warehouse_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Hue service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_h_base_root_command(cluster_name, service_name)
Creates the root directory of an HBase service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HBase service name.
try:
api_response = api_instance.create_h_base_root_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_h_base_root_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HBase service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str create_hdfs_file(cluster_name, service_name, body=body, overwrite=overwrite, path=path)
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name
body = 'body_example' # str | Content to be put in the file to be created (optional)
overwrite = false # bool | If true overwrite the file (optional) (default to false)
path = 'path_example' # str | full path to the HDFS file to be created (optional)
try:
api_response = api_instance.create_hdfs_file(cluster_name, service_name, body=body, overwrite=overwrite, path=path)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_hdfs_file: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name | |
| body | str | Content to be put in the file to be created | [optional] |
| overwrite | bool | If true overwrite the file | [optional] [default to false] |
| path | str | full path to the HDFS file to be created | [optional] |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_hive_user_dir_command(cluster_name, service_name)
Create the Hive user directory
Available since API v4.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Hive service name.
try:
api_response = api_instance.create_hive_user_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_hive_user_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Hive service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_hive_warehouse_command(cluster_name, service_name)
Create the Hive warehouse directory, on Hive services.
Available since API v3.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Hive service name.
try:
api_response = api_instance.create_hive_warehouse_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_hive_warehouse_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Hive service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_hive_warehouse_external_command(cluster_name, service_name, directory=directory)
Create the Hive warehouse external directory for Private Cloud.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Hive service name.
directory = 'directory_example' # str | Name of the warehouse external directory. (optional)
try:
api_response = api_instance.create_hive_warehouse_external_command(cluster_name, service_name, directory=directory)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_hive_warehouse_external_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Hive service name. | |
| directory | str | Name of the warehouse external directory. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_impala_user_dir_command(cluster_name, service_name)
Create the Impala user directory
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Impala service name.
try:
api_response = api_instance.create_impala_user_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_impala_user_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Impala service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_oozie_db(cluster_name, service_name)
Creates the Oozie Database Schema in the configured database. This command does not create database. This command creates only tables required by Oozie. To create database, please refer to oozieCreateEmbeddedDatabase()
Available since API v2.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Oozie service on which to run the command.
try:
api_response = api_instance.create_oozie_db(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_oozie_db: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Oozie service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiServiceList create_services(cluster_name, body=body)
Creates a list of services.
There are typically two service creation strategies:
| Cluster Version | Available Service Types |
|---|---|
| CDH4 | HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER |
| CDH5 | HDFS, MAPREDUCE, HBASE, OOZIE, ZOOKEEPER, HUE, YARN, IMPALA, FLUME, HIVE, SOLR, SQOOP, KS_INDEXER, SQOOP_CLIENT, SENTRY, ACCUMULO16, KMS, SPARK_ON_YARN, KAFKA |
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
body = cm_client.ApiServiceList() # ApiServiceList | Details of the services to create. (optional)
try:
api_response = api_instance.create_services(cluster_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_services: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| body | ApiServiceList | Details of the services to create. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_solr_hdfs_home_dir_command(cluster_name, service_name)
Creates the home directory of a Solr service in HDFS.
Available since API v4.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Solr service name.
try:
api_response = api_instance.create_solr_hdfs_home_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_solr_hdfs_home_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_sqoop_user_dir_command(cluster_name, service_name)
Creates the user directory of a Sqoop service in HDFS.
Available since API v4.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Sqoop service name.
try:
api_response = api_instance.create_sqoop_user_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_sqoop_user_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Sqoop service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_yarn_cm_container_usage_input_dir_command(cluster_name, service_name)
Creates the HDFS directory where YARN container usage metrics are stored by NodeManagers for CM to read and aggregate into app usage metrics.
Available since API v13.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The YARN service name.
try:
api_response = api_instance.create_yarn_cm_container_usage_input_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_yarn_cm_container_usage_input_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The YARN service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_yarn_job_history_dir_command(cluster_name, service_name)
Create the Yarn job history directory
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The YARN service name.
try:
api_response = api_instance.create_yarn_job_history_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_yarn_job_history_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The YARN service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand create_yarn_node_manager_remote_app_log_dir_command(cluster_name, service_name)
Create the Yarn NodeManager remote application log directory
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The YARN service name.
try:
api_response = api_instance.create_yarn_node_manager_remote_app_log_dir_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->create_yarn_node_manager_remote_app_log_dir_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The YARN service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand decommission_command(cluster_name, service_name, body=body)
Decommission roles of a service.
For HBase services, the list should contain names of RegionServers to decommission.
For HDFS services, the list should contain names of DataNodes to decommission.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HBase service name.
body = cm_client.ApiRoleNameList() # ApiRoleNameList | List of role names to decommision. (optional)
try:
api_response = api_instance.decommission_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->decommission_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HBase service name. | |
| body | ApiRoleNameList | List of role names to decommision. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteHdfsPathResult delete_hdfs_path(cluster_name, service_name, path=path, recursive=recursive)
Deletes the file or directory, specified by the given path, on the given HDFS service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name
path = 'path_example' # str | path of the file or directory to be deleted (optional)
recursive = false # bool | If the path is a directory and this is set to true, then deletes the directory and its contents, otherwise the call will fail if the directory is not empty (optional) (default to false)
try:
api_response = api_instance.delete_hdfs_path(cluster_name, service_name, path=path, recursive=recursive)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->delete_hdfs_path: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name | |
| path | str | path of the file or directory to be deleted | [optional] |
| recursive | bool | If the path is a directory and this is set to true, then deletes the directory and its contents, otherwise the call will fail if the directory is not empty | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiService delete_service(cluster_name, service_name)
Deletes a service from the system.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service to delete.
try:
api_response = api_instance.delete_service(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->delete_service: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service to delete. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ApiEntityTag] delete_tags(cluster_name, service_name, body=body)
Remove the tags associated with the service. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the service to remove tags from
body = [cm_client.ApiEntityTag()] # list[ApiEntityTag] | List of tags to remove from the service (optional)
try:
api_response = api_instance.delete_tags(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->delete_tags: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the service to remove tags from | |
| body | list[ApiEntityTag] | List of tags to remove from the service | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand deploy_client_config_command(cluster_name, service_name, body=body)
Deploy a service's client configuration.
The client configuration is deployed to the hosts where the given roles are running.
Added in v3: passing null for the role name list will deploy client configs to all known service roles. Added in v6: passing an empty role name list will deploy client configs to all known service roles. In Cloudera Manager 5.3 and newer, client configurations are fully managed, meaning that the server maintains state about which client configurations should exist and be managed by alternatives, and the agents actively rectify their hosts with this state. Consequently, if this API call is made with a specific set of roles, Cloudera Manager will deactivate, from alternatives, any deployed client configs from any non-gateway roles that are not specified as arguments. Gateway roles are always preserved, and calling this API with an empty or null argument continues to deploy to all roles.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiRoleNameList() # ApiRoleNameList | List of role names. (optional)
try:
api_response = api_instance.deploy_client_config_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->deploy_client_config_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. | |
| body | ApiRoleNameList | List of role names. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_catalog_statestore_ha_command(cluster_name, service_name, body=body)
Disable high availability (HA) for Catalog and Statestore service.
This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services.
The command will keep exactly one Catalog and Statestore server on the specified host.
All services that depend on Impala will be restarted after disabling Catalog and Statestore HA.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Impala service name.
body = cm_client.ApiDisableCatalogStatestoreHaArguments() # ApiDisableCatalogStatestoreHaArguments | An instance of ApiDisableCatalogStatestoreHaArguments representing the arguments to the command. (optional)
try:
api_response = api_instance.disable_catalog_statestore_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_catalog_statestore_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Impala service name. | |
| body | ApiDisableCatalogStatestoreHaArguments | An instance of ApiDisableCatalogStatestoreHaArguments representing the arguments to the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_jt_ha_command(cluster_name, service_name, body=body)
Disable high availability (HA) for JobTracker. As part of disabling HA, any services that depend on the MapReduce service being modified will be stopped. The command arguments provide options to specify name of JobTracker that will be preserved. The Command will redeploy the client configurations for services of the cluster after HA has been disabled.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The MapReduce service name.
body = cm_client.ApiDisableJtHaArguments() # ApiDisableJtHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.disable_jt_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_jt_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The MapReduce service name. | |
| body | ApiDisableJtHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_llama_ha_command(cluster_name, service_name, body=body)
Not Supported. Llama was removed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiDisableLlamaHaArguments() # ApiDisableLlamaHaArguments | (optional)
try:
api_response = api_instance.disable_llama_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_llama_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiDisableLlamaHaArguments | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_llama_rm_command(cluster_name, service_name)
Not Supported. Llama was removed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
try:
api_response = api_instance.disable_llama_rm_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_llama_rm_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_oozie_ha_command(cluster_name, service_name, body=body)
Disable high availability (HA) for Oozie. As part of disabling HA, any services that depend on the Oozie service being modified will be stopped. The command arguments provide options to specify name of Oozie Server that will be preserved. After deleting, other Oozie servers, all the services that were stopped are restarted.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Oozie service name.
body = cm_client.ApiDisableOozieHaArguments() # ApiDisableOozieHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.disable_oozie_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_oozie_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Oozie service name. | |
| body | ApiDisableOozieHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_rm_ha_command(cluster_name, service_name, body=body)
Disable high availability (HA) for ResourceManager. As part of disabling HA, any services that depend on the YARN service being modified will be stopped. The command arguments provide options to specify name of ResourceManager that will be preserved. The command will redeploy the client configurations for services of the cluster after HA has been disabled.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The YARN service name.
body = cm_client.ApiDisableRmHaArguments() # ApiDisableRmHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.disable_rm_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_rm_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The YARN service name. | |
| body | ApiDisableRmHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand disable_sentry_ha_command(cluster_name, service_name, body=body)
Disable high availability (HA) for Sentry service.
This command only applies to CDH 5.13+ Sentry services.
The command will keep exactly one Sentry server, on the specified host, and update the ZooKeeper configs needed for Sentry.
All services that depend on HDFS will be restarted after enabling Sentry HA.
Note: Sentry doesn't support Rolling Restart.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Sentry service name.
body = cm_client.ApiDisableSentryHaArgs() # ApiDisableSentryHaArgs | An instance of ApiDisableSentryHaArgs representing the arguments to the command. (optional)
try:
api_response = api_instance.disable_sentry_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->disable_sentry_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Sentry service name. | |
| body | ApiDisableSentryHaArgs | An instance of ApiDisableSentryHaArgs representing the arguments to the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand ecs_upgrade_audit(cluster_name, service_name, body=body)
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiStringList() # ApiStringList | (optional)
try:
api_response = api_instance.ecs_upgrade_audit(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->ecs_upgrade_audit: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiStringList | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_catalog_statestore_ha_command(cluster_name, service_name, body=body)
Enable high availability (HA) for Catalog and Statestore service.
This command only applies to CDH 7.1.9SP1+ Impala Catalog and Statestore services.
The command will create a new Catalog and Statestore server on the specified host for Catalog and Statestore HA.
All services that depend on Impala will be restarted after enabling Catalog and Statestore HA.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Impala service name.
body = cm_client.ApiEnableCatalogStatestoreHaArguments() # ApiEnableCatalogStatestoreHaArguments | An instance of ApiEnableCatalogStatestoreHaArguments representing the arguments to the command. (optional)
try:
api_response = api_instance.enable_catalog_statestore_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_catalog_statestore_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Impala service name. | |
| body | ApiEnableCatalogStatestoreHaArguments | An instance of ApiEnableCatalogStatestoreHaArguments representing the arguments to the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_jt_ha_command(cluster_name, service_name, body=body)
Enable high availability (HA) for a JobTracker.
This command only applies to CDH4 MapReduce services.
The command will create a new JobTracker on the specified host and then create an active/standby pair with the existing JobTracker. Autofailover will be enabled using ZooKeeper. A ZNode will be created for this purpose. Command arguments provide option to forcefully create this ZNode if one already exists. A node may already exists if JobTracker was previously enabled in HA mode but HA mode was disabled later on. The ZNode is not deleted when HA is disabled.
As part of enabling HA, any services that depends on the MapReduce service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The MapReduce service name.
body = cm_client.ApiEnableJtHaArguments() # ApiEnableJtHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.enable_jt_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_jt_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The MapReduce service name. | |
| body | ApiEnableJtHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_llama_ha_command(cluster_name, service_name, body=body)
Not Supported. Llama was removed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiEnableLlamaHaArguments() # ApiEnableLlamaHaArguments | (optional)
try:
api_response = api_instance.enable_llama_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_llama_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiEnableLlamaHaArguments | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_llama_rm_command(cluster_name, service_name, body=body)
Not Supported. Llama was removed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiEnableLlamaRmArguments() # ApiEnableLlamaRmArguments | (optional)
try:
api_response = api_instance.enable_llama_rm_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_llama_rm_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiEnableLlamaRmArguments | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_oozie_ha_command(cluster_name, service_name, body=body)
Enable high availability (HA) for Oozie service.
This command only applies to CDH5+ Oozie services.
The command will create new Oozie Servers on the specified hosts and set the ZooKeeper and Load Balancer configs needed for Oozie HA.
As part of enabling HA, any services that depends on the Oozie service being modified will be stopped and restarted after enabling Oozie HA.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Oozie service name.
body = cm_client.ApiEnableOozieHaArguments() # ApiEnableOozieHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.enable_oozie_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_oozie_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Oozie service name. | |
| body | ApiEnableOozieHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_rm_ha_command(cluster_name, service_name, body=body)
Enable high availability (HA) for a YARN ResourceManager.
This command only applies to CDH5+ YARN services.
The command will create a new ResourceManager on the specified host and then create an active/standby pair with the existing ResourceManager. Autofailover will be enabled using ZooKeeper.
As part of enabling HA, any services that depends on the YARN service being modified will be stopped. Command will redeploy the client configurations for services of the cluster after HA has been enabled.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The YARN service name.
body = cm_client.ApiEnableRmHaArguments() # ApiEnableRmHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.enable_rm_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_rm_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The YARN service name. | |
| body | ApiEnableRmHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enable_sentry_ha_command(cluster_name, service_name, body=body)
Enable high availability (HA) for Sentry service.
This command only applies to CDH 5.13+ Sentry services.
The command will create a new Sentry server on the specified host and set the ZooKeeper configs needed for Sentry HA.
As part of enabling HA, all services that depend on HDFS will be restarted after enabling Sentry HA.
Note: Sentry doesn't support Rolling Restart.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Sentry service name.
body = cm_client.ApiEnableSentryHaArgs() # ApiEnableSentryHaArgs | An instance of ApiEnableSentryHaArgs representing the arguments to the command. (optional)
try:
api_response = api_instance.enable_sentry_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enable_sentry_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Sentry service name. | |
| body | ApiEnableSentryHaArgs | An instance of ApiEnableSentryHaArgs representing the arguments to the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enter_maintenance_mode(cluster_name, service_name)
Put the service into maintenance mode. This is a synchronous command. The result is known immediately upon return.
Available since API v2.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.enter_maintenance_mode(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->enter_maintenance_mode: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand exit_maintenance_mode(cluster_name, service_name)
Take the service out of maintenance mode. This is a synchronous command. The result is known immediately upon return.
Available since API v2.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.exit_maintenance_mode(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->exit_maintenance_mode: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand export_sentry_permissions_command(cluster_name, service_name)
Export Sentry Permissions.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.export_sentry_permissions_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->export_sentry_permissions_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand first_run(cluster_name, service_name)
Prepare and start a service.
Perform all the steps needed to prepare the service and start it.
Available since API v7.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the cluster.
try:
api_response = api_instance.first_run(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->first_run: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the cluster. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_client_config(cluster_name, service_name)
Download a zip-compressed archive of the client configuration, of a specific service. This resource does not require any authentication.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.get_client_config(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_client_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ApiAtlasEntityTypes] get_entity_types_from_atlas(cluster_name, service_name)
Retrieves the atlas entities from a cluster. Only available with Cloudera Manager Enterprise Edition.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.get_entity_types_from_atlas(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_entity_types_from_atlas: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiHdfsUsageReport get_hdfs_usage_report(cluster_name, service_name, aggregation=aggregation, _from=_from, nameservice=nameservice, to=to)
Fetch the HDFS usage report. For the requested time range, at the specified aggregation intervals, the report shows HDFS disk usages per user.
This call supports returning JSON or CSV, as determined by the "Accept" header of application/json or text/csv.
Available since API v4. Only available with Cloudera Manager Enterprise Edition.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
aggregation = 'daily' # str | The (optional) aggregation period for the data. Supports \"hourly\", \"daily\" (default) and \"weekly\". (optional) (default to daily)
_from = '_from_example' # str | The (optional) start time of the report in ISO 8601 format ( defaults to 24 hours before \"to\" time). (optional)
nameservice = 'nameservice_example' # str | The (optional) HDFS nameservice. Required for HA setup. (optional)
to = 'now' # str | The (optional) end time of the report in ISO 8601 format ( defaults to now). (optional) (default to now)
try:
api_response = api_instance.get_hdfs_usage_report(cluster_name, service_name, aggregation=aggregation, _from=_from, nameservice=nameservice, to=to)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_hdfs_usage_report: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| aggregation | str | The (optional) aggregation period for the data. Supports "hourly", "daily" (default) and "weekly". | [optional] [default to daily] |
| _from | str | The (optional) start time of the report in ISO 8601 format ( defaults to 24 hours before "to" time). | [optional] |
| nameservice | str | The (optional) HDFS nameservice. Required for HA setup. | [optional] |
| to | str | The (optional) end time of the report in ISO 8601 format ( defaults to now). | [optional] [default to now] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiImpalaUtilization get_impala_utilization(cluster_name, service_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 Impala service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | service 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 Mon. and 7 corresponds to Sun. 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_impala_utilization(cluster_name, service_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 ServicesResourceApi->get_impala_utilization: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | service 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 Mon. and 7 corresponds to Sun. 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] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiMetricList get_metrics(cluster_name, service_name, _from=_from, metrics=metrics, to=to, view=view)
Fetch metric readings for a particular service.
By default, this call will look up all metrics available for the service. If only specific metrics are desired, use the metrics parameter.
By default, the returned results correspond to a 5 minute window based on the provided end time (which defaults to the current server time). The from and to parameters can be used to control the window being queried. A maximum window of 3 hours is enforced.
When requesting a "full" view, aside from the extended properties of the returned metric data, the collection will also contain information about all metrics available for the service, even if no readings are available in the requested window.
HDFS services that have more than one nameservice will not expose any metrics. Instead, the nameservices should be queried separately.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service.
_from = '_from_example' # str | Start of the period to query. (optional)
metrics = ['metrics_example'] # list[str] | Filter for which metrics to query. (optional)
to = 'now' # str | End of the period to query. (optional) (default to now)
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)
try:
api_response = api_instance.get_metrics(cluster_name, service_name, _from=_from, metrics=metrics, to=to, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_metrics: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service. | |
| _from | str | Start of the period to query. | [optional] |
| metrics | list[str] | Filter for which metrics to query. | [optional] |
| to | str | End of the period to query. | [optional] [default to now] |
| view | str | The view of the data to materialize, either "summary" or "full". | [optional] [default to summary] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiMrUsageReport get_mr_usage_report(cluster_name, service_name, aggregation=aggregation, _from=_from, to=to)
Fetch the MR usage report. For the requested time range, at the specified aggregation intervals, the report shows job CPU usages (and other metrics) per user.
This call supports returning JSON or CSV, as determined by the "Accept" header of application/json or text/csv.
Available since API v4. Only available with Cloudera Manager Enterprise Edition.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The MR service name.
aggregation = 'daily' # str | The (optional) aggregation period for the data. Supports \"hourly\", \"daily\" (default) and \"weekly\". (optional) (default to daily)
_from = '_from_example' # str | The (optional) start time of the report in ISO 8601 format (defaults to 24 hours before \"to\" time). (optional)
to = 'now' # str | The (optional) end time of the report in ISO 8601 format (defaults to now). (optional) (default to now)
try:
api_response = api_instance.get_mr_usage_report(cluster_name, service_name, aggregation=aggregation, _from=_from, to=to)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_mr_usage_report: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The MR service name. | |
| aggregation | str | The (optional) aggregation period for the data. Supports "hourly", "daily" (default) and "weekly". | [optional] [default to daily] |
| _from | str | The (optional) start time of the report in ISO 8601 format (defaults to 24 hours before "to" time). | [optional] |
| to | str | The (optional) end time of the report in ISO 8601 format (defaults to now). | [optional] [default to now] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRangerPolicyList get_policies_from_ranger(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
Collects information about the policies defined in the local Ranger service.
Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerPolicyList#getPolicies()) and remote (ApiRangerPolicyList#getPolicies()) Ranger policies.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | the name of the local Ranger service.
source_cluster = 'source_cluster_example' # str | optional: the source CM cluster name. (optional)
source_peer = 'source_peer_example' # str | optional: the source CM peer name. (optional)
source_service = 'source_service_example' # str | optional: the Ranger service name on the source CM. (optional)
try:
api_response = api_instance.get_policies_from_ranger(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_policies_from_ranger: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | the name of the local Ranger service. | |
| source_cluster | str | optional: the source CM cluster name. | [optional] |
| source_peer | str | optional: the source CM peer name. | [optional] |
| source_service | str | optional: the Ranger service name on the source CM. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRangerServiceList get_services_from_ranger(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
Collects information about the services defined in the local Ranger service.
Optionally if sourcePeer, sourceCluster, sourceService are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerServiceList#getServices()) and remote (ApiRangerServiceList#getRemoteServices()) Ranger services.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | the name of the local Ranger service.
source_cluster = 'source_cluster_example' # str | optional: the source CM cluster name. (optional)
source_peer = 'source_peer_example' # str | optional: the source CM peer name. (optional)
source_service = 'source_service_example' # str | optional: the Ranger service name on the source CM. (optional)
try:
api_response = api_instance.get_services_from_ranger(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_services_from_ranger: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | the name of the local Ranger service. | |
| source_cluster | str | optional: the source CM cluster name. | [optional] |
| source_peer | str | optional: the source CM peer name. | [optional] |
| source_service | str | optional: the Ranger service name on the source CM. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRangerUserList get_users_from_ranger(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
Collects information about the users defined in the local Ranger service.
Optionally if sourcePeer, sourceCluster, sourceUser are provided, then it will call the same API endpoint on that given source CM peer, and merges the result of the local (ApiRangerUserList#getUsers()) and remote (ApiRangerUserList#getRemoteUsers()) Ranger users.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | the name of the local Ranger service.
source_cluster = 'source_cluster_example' # str | optional: the source CM cluster name. (optional)
source_peer = 'source_peer_example' # str | optional: the source CM peer name. (optional)
source_service = 'source_service_example' # str | optional: the Ranger service name on the source CM. (optional)
try:
api_response = api_instance.get_users_from_ranger(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->get_users_from_ranger: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | the name of the local Ranger service. | |
| source_cluster | str | optional: the source CM cluster name. | [optional] |
| source_peer | str | optional: the source CM peer name. | [optional] |
| source_service | str | optional: the Ranger service name on the source CM. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiYarnUtilization get_yarn_utilization(cluster_name, service_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 yarn service as well as the resource utilization per tenant. Only available with Cloudera Manager Enterprise Edition.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | service 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 Mon. and 7 corresponds to Sun. 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_yarn_utilization(cluster_name, service_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 ServicesResourceApi->get_yarn_utilization: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | service 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 Mon. and 7 corresponds to Sun. 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] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_create_user_directory(cluster_name, service_name)
Create the HBase user directory (usually /user/hbase).
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
try:
api_response = api_instance.hbase_replication_create_user_directory(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_create_user_directory: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_automatic(cluster_name, service_name, body=body, force=force)
Starts an automatic HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts both the source and target clusters.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiHBaseReplicationSetupCommandArgs() # ApiHBaseReplicationSetupCommandArgs | Replication setup parameters such as the source peer, source service, passphrase for the keystore, and optionally the RestartType for both source and target (default is rolling restart) (optional)
force = false # bool | If true, perform setup even if already setup. (Default false) (optional) (default to false)
try:
api_response = api_instance.hbase_replication_first_time_setup_automatic(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_automatic: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiHBaseReplicationSetupCommandArgs | Replication setup parameters such as the source peer, source service, passphrase for the keystore, and optionally the RestartType for both source and target (default is rolling restart) | [optional] |
| force | bool | If true, perform setup even if already setup. (Default false) | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_clean_and_reset(cluster_name, service_name, body=body)
Cleans and resets the HBase replication first time setup on the given source and target:
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiHBaseReplicationSetupCleanAndResetArgs() # ApiHBaseReplicationSetupCleanAndResetArgs | contains the source peer, source cluster, source service, and the restart type of source and target HBase services. Also, if user wants to reset the HBase replication first time setup status on the source, then the cmPeerNameOnRemote field should be provided: The peer name of the local CM in the given source CM peer (optional)
try:
api_response = api_instance.hbase_replication_first_time_setup_clean_and_reset(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_clean_and_reset: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiHBaseReplicationSetupCleanAndResetArgs | contains the source peer, source cluster, source service, and the restart type of source and target HBase services. Also, if user wants to reset the HBase replication first time setup status on the source, then the cmPeerNameOnRemote field should be provided: The peer name of the local CM in the given source CM peer | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_for_already_paired_clusters(cluster_name, service_name, body=body, force=force)
Starts an HBase replication first time setup for the source and target.
Before using this API endpoint, it's assumed that the source and target (local) HBase services already have the HBase replication first time setup executed but with different peers. It starts a command, that checks if the necessary configurations are in place on both source and target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)). If everything matches, then it sets the setup status to READY.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local (target) HBase service name
body = cm_client.ApiServiceRef() # ApiServiceRef | contains the source peer, source cluster, source HBase service name (optional)
force = false # bool | If true, perform setup even if already setup. (Default false) (optional) (default to false)
try:
api_response = api_instance.hbase_replication_first_time_setup_for_already_paired_clusters(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_for_already_paired_clusters: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local (target) HBase service name | |
| body | ApiServiceRef | contains the source peer, source cluster, source HBase service name | [optional] |
| force | bool | If true, perform setup even if already setup. (Default false) | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_for_source_only(cluster_name, service_name, body=body, force=force)
Starts an HBase replication first time setup for the source only.
Before using this API endpoint, it's assumed that the target (local) HBase service already has HBase replication first time setup executed with another peer's HBase. It starts a command, that does some configuration only on the source (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts source HBase service if needed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local (target) HBase service name
body = cm_client.ApiHBaseReplicationSetupOneClusterOnlyCmdArgs() # ApiHBaseReplicationSetupOneClusterOnlyCmdArgs | Replication setup parameters such as the source peer, source cluster, source service, HBase replication user, and optionally the RestartType for the source HBase service. If RestartType is: <ul> <li> <b>provided</b>, then restarts source HBase service accordingly. This is equivalent to the automatic first time setup: #hbaseReplicationFirstTimeSetupAutomatic(String, boolean, ApiHBaseReplicationSetupCommandArgs) </li> <li> <b>not provided</b>, then the source HBase service must be restarted manually. This is equivalent to the manual first time setup: #hbaseReplicationFirstTimeSetupManual(String, boolean, ApiHBaseReplicationSetupCommandArgs). Similarly, after the source HBase service has been restarted, the first time setup can be finished by calling: #hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef) </li> </ul> (optional)
force = false # bool | If true, perform setup even if already setup. (Default false) (optional) (default to false)
try:
api_response = api_instance.hbase_replication_first_time_setup_for_source_only(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_for_source_only: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local (target) HBase service name | |
| body | ApiHBaseReplicationSetupOneClusterOnlyCmdArgs | Replication setup parameters such as the source peer, source cluster, source service, HBase replication user, and optionally the RestartType for the source HBase service. If RestartType is:
| [optional] |
| force | bool | If true, perform setup even if already setup. (Default false) | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_for_target_only(cluster_name, service_name, body=body, force=force)
Starts an HBase replication first time setup for the target only.
Before using this API endpoint, it's assumed that the given source HBase service, given by ApiHBaseReplicationSetupOneClusterOnlyCmdArgs, already has HBase replication first time setup executed with another peer's HBase. It starts a command, that does some configuration only on the target (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), then restarts target HBase service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiHBaseReplicationSetupOneClusterOnlyCmdArgs() # ApiHBaseReplicationSetupOneClusterOnlyCmdArgs | Replication setup parameters such as the source peer, source cluster, source service, HBase replication user, and optionally the RestartType for the local HBase service (default is rolling restart) (optional)
force = false # bool | If true, perform setup even if already setup. (Default false) (optional) (default to false)
try:
api_response = api_instance.hbase_replication_first_time_setup_for_target_only(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_for_target_only: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiHBaseReplicationSetupOneClusterOnlyCmdArgs | Replication setup parameters such as the source peer, source cluster, source service, HBase replication user, and optionally the RestartType for the local HBase service (default is rolling restart) | [optional] |
| force | bool | If true, perform setup even if already setup. (Default false) | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hbase_replication_first_time_setup_force_ready(cluster_name, service_name, body=body)
Force sets the HBase replication first time setup status to be READY for the given source and target. Note that after this operation, the pending HBase replication policies, which have the waitForHBaseReplicationSetup flag set to true, will NOT be completed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiServiceRef() # ApiServiceRef | contains the source peer, source cluster, source sourceService (optional)
try:
api_instance.hbase_replication_first_time_setup_force_ready(cluster_name, service_name, body=body)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_force_ready: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiServiceRef | contains the source peer, source cluster, source sourceService | [optional] |
void (empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_manual(cluster_name, service_name, body=body, force=force)
Starts a manual HBase replication first time setup. After doing some configuration (see #hbaseReplicationSetup(String, boolean, ApiHBaseReplicationSetupCommandArgs)), it restarts the target cluster only. Source cluster has to be restarted manually, after which the #hbaseReplicationFirstTimeSetupManualContinue(String, ApiServiceRef) API endpoint should be called to finish the HBase replication first time setup.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiHBaseReplicationSetupCommandArgs() # ApiHBaseReplicationSetupCommandArgs | Replication setup parameters such as the source peer, source service, passphrase for the keystore, and optionally the RestartType for the target (default is rolling restart) (optional)
force = false # bool | If true, perform setup even if already setup. (Default false) (optional) (default to false)
try:
api_response = api_instance.hbase_replication_first_time_setup_manual(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_manual: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiHBaseReplicationSetupCommandArgs | Replication setup parameters such as the source peer, source service, passphrase for the keystore, and optionally the RestartType for the target (default is rolling restart) | [optional] |
| force | bool | If true, perform setup even if already setup. (Default false) | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_first_time_setup_manual_continue(cluster_name, service_name, body=body)
Should be called after #hbaseReplicationFirstTimeSetupManual(String, ApiHBaseReplicationSetupCommandArgs) to finish the manual HBase replication first time setup.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiServiceRef() # ApiServiceRef | contains the source peer, source cluster, source service (optional)
try:
api_response = api_instance.hbase_replication_first_time_setup_manual_continue(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_manual_continue: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiServiceRef | contains the source peer, source cluster, source service | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
hbase_replication_first_time_setup_reset(cluster_name, service_name, body=body)
Resets/removes the HBase replication first time setup status for the given source and target.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
body = cm_client.ApiServiceRef() # ApiServiceRef | contains the source peer, source cluster, source sourceService (optional)
try:
api_instance.hbase_replication_first_time_setup_reset(cluster_name, service_name, body=body)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_reset: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| body | ApiServiceRef | contains the source peer, source cluster, source sourceService | [optional] |
void (empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiHBaseReplicationSetupStatus hbase_replication_first_time_setup_status(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The local HBase service name
source_cluster = 'source_cluster_example' # str | The source cluster's name (optional)
source_peer = 'source_peer_example' # str | The source peer's name (optional)
source_service = 'source_service_example' # str | The source service's name (optional)
try:
api_response = api_instance.hbase_replication_first_time_setup_status(cluster_name, service_name, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_first_time_setup_status: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The local HBase service name | |
| source_cluster | str | The source cluster's name | [optional] |
| source_peer | str | The source peer's name | [optional] |
| source_service | str | The source service's name | [optional] |
ApiHBaseReplicationSetupStatus
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_setup(cluster_name, service_name, body=body, force=force)
Perform one time setup for HBase replication. Generate the a keystore to HDFS for use by replication and transfer the keystore to HDFS on the the peer.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiHBaseReplicationSetupCommandArgs() # ApiHBaseReplicationSetupCommandArgs | (optional)
force = false # bool | If true, perform setup even if already setup. (Default false) (optional) (default to false)
try:
api_response = api_instance.hbase_replication_setup(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_setup: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. | |
| body | ApiHBaseReplicationSetupCommandArgs | [optional] | |
| force | bool | If true, perform setup even if already setup. (Default false) | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_replication_setup_admin(cluster_name, service_name, cm_peer_definition=cm_peer_definition, op=op, path=path, user=user)
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
cm_peer_definition = 'cm_peer_definition_example' # str | (optional)
op = 'op_example' # str | (optional)
path = 'path_example' # str | (optional)
user = 'user_example' # str | (optional)
try:
api_response = api_instance.hbase_replication_setup_admin(cluster_name, service_name, cm_peer_definition=cm_peer_definition, op=op, path=path, user=user)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_replication_setup_admin: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| cm_peer_definition | str | [optional] | |
| op | str | [optional] | |
| path | str | [optional] | |
| user | str | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_shell_command(cluster_name, service_name, body=body)
Execute a hbase shell command
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HBase service name
body = cm_client.ApiHBaseShellCommand() # ApiHBaseShellCommand | hbase shell command to be executed (optional)
try:
api_response = api_instance.hbase_shell_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_shell_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HBase service name | |
| body | ApiHBaseShellCommand | hbase shell command to be executed | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hbase_upgrade_command(cluster_name, service_name)
Upgrade HBase data in HDFS and ZooKeeper as part of upgrade from CDH4 to CDH5.
This is required in order to run HBase after upgrade. Available since API v6.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HBase service name.
try:
api_response = api_instance.hbase_upgrade_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hbase_upgrade_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HBase service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_add_sbnnto_ns_command(cluster_name, service_name, body=body)
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiAddSBNNToNSArguments() # ApiAddSBNNToNSArguments | (optional)
try:
api_response = api_instance.hdfs_add_sbnnto_ns_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_add_sbnnto_ns_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiAddSBNNToNSArguments | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_create_tmp_dir(cluster_name, service_name)
Creates a tmp directory on the HDFS filesystem.
Available since API v2.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the HDFS service on which to run the command.
try:
api_response = api_instance.hdfs_create_tmp_dir(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_create_tmp_dir: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the HDFS service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_disable_auto_failover_command(cluster_name, service_name, body=body)
Disable auto-failover for a highly available HDFS nameservice.
The command will modify the nameservice's NameNodes configuration to disable automatic failover, and delete the existing failover controllers.
The ZooKeeper dependency of the service will not be removed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = 'body_example' # str | The nameservice name. (optional)
try:
api_response = api_instance.hdfs_disable_auto_failover_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_disable_auto_failover_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | str | The nameservice name. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_disable_ha_command(cluster_name, service_name, body=body)
Disable high availability (HA) for an HDFS NameNode.
The NameNode to be kept must be running before HA can be disabled.
As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been disabled.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiHdfsDisableHaArguments() # ApiHdfsDisableHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.hdfs_disable_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_disable_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiHdfsDisableHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_disable_nn_ha_command(cluster_name, service_name, body=body)
Disable High Availability (HA) with Automatic Failover for an HDFS NameNode.
As part of disabling HA, any services that depend on the HDFS service being modified will be stopped. The command will delete the Standby NameNode associated with the specified NameNode. Any FailoverControllers associated with the NameNode's nameservice are also deleted. A SecondaryNameNode is created on the host specified by the arugments.
If no nameservices uses Quorum Journal after HA is disabled for the specified nameservice, then all JournalNodes are also deleted.
Then, HDFS service is restarted and all services that were stopped are started again afterwards. Finally, client configs for HDFS and its depedents will be re-deployed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiDisableNnHaArguments() # ApiDisableNnHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.hdfs_disable_nn_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_disable_nn_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiDisableNnHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_enable_auto_failover_command(cluster_name, service_name, body=body)
Enable auto-failover for an HDFS nameservice.
This command requires that the nameservice exists, and HA has been configured for that nameservice.
The command will create the needed failover controllers, perform the needed initialization and configuration, and will start the new roles. The existing NameNodes which are part of the nameservice will be re-started in the process.
This process may require changing the service's configuration, to add a dependency on the provided ZooKeeper service. This will be done if such a dependency has not been configured yet, and will cause roles that are not affected by this command to show an "outdated configuration" status.
If a ZooKeeper dependency has already been set up by some other means, it does not need to be provided in the command arguments.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiHdfsFailoverArguments() # ApiHdfsFailoverArguments | Arguments for the command. (optional)
try:
api_response = api_instance.hdfs_enable_auto_failover_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_enable_auto_failover_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiHdfsFailoverArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_enable_ha_command(cluster_name, service_name, body=body)
Enable high availability (HA) for an HDFS NameNode.
The command will set up the given "active" and "stand-by" NameNodes as an HA pair. Both nodes need to already exist.
If there is a SecondaryNameNode associated with either given NameNode instance, it will be deleted.
Note that while the shared edits path may be different for both nodes, they need to point to the same underlying storage (e.g., an NFS share).
As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. The command arguments provide options to re-start these services and to re-deploy the client configurations for services of the cluster after HA has been enabled.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiHdfsHaArguments() # ApiHdfsHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.hdfs_enable_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_enable_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiHdfsHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_enable_nn_ha_command(cluster_name, service_name, body=body)
Enable High Availability (HA) with Automatic Failover for an HDFS NameNode.
The command will create a Standby NameNode for the given nameservice and create FailoverControllers for both Active and Standby NameNodes. The SecondaryNameNode associated with the Active NameNode will be deleted.
The command will also create JournalNodes needed for HDFS HA if they do not already exist.
As part of enabling HA, any services that depend on the HDFS service being modified will be stopped. They will be restarted after HA has been enabled. Finally, client configs for HDFS and its depedents will be re-deployed.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiEnableNnHaArguments() # ApiEnableNnHaArguments | Arguments for the command. (optional)
try:
api_response = api_instance.hdfs_enable_nn_ha_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_enable_nn_ha_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiEnableNnHaArguments | Arguments for the command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_failover_command(cluster_name, service_name, body=body, force=force)
Initiate a failover in an HDFS HA NameNode pair.
The arguments should contain the names of the two NameNodes in the HA pair. The first one should be the currently active NameNode, the second one the NameNode to be made active.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiRoleNameList() # ApiRoleNameList | Names of the NameNodes in the HA pair. (optional)
force = false # bool | Whether to force failover. (optional) (default to false)
try:
api_response = api_instance.hdfs_failover_command(cluster_name, service_name, body=body, force=force)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_failover_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiRoleNameList | Names of the NameNodes in the HA pair. | [optional] |
| force | bool | Whether to force failover. | [optional] [default to false] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_finalize_rolling_upgrade(cluster_name, service_name)
Finalizes the rolling upgrade for HDFS by updating the NameNode metadata permanently to the next version. Should be done after doing a rolling upgrade to a CDH version >= 5.2.0.
Available since API v8.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
try:
api_response = api_instance.hdfs_finalize_rolling_upgrade(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_finalize_rolling_upgrade: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_roll_edits_command(cluster_name, service_name, body=body)
Roll the edits of an HDFS NameNode or Nameservice.
Available since API v3.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
body = cm_client.ApiRollEditsArgs() # ApiRollEditsArgs | Arguments to the Roll Edits command. (optional)
try:
api_response = api_instance.hdfs_roll_edits_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_roll_edits_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. | |
| body | ApiRollEditsArgs | Arguments to the Roll Edits command. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hdfs_upgrade_metadata_command(cluster_name, service_name)
Upgrade HDFS Metadata as part of a major version upgrade.
When doing a major version upgrade for HDFS, it is necessary to start HDFS in a special mode where it will do any necessary upgrades of stored metadata. Trying to start HDFS normally will result in an error message and the NameNode(s) failing to start. The metadata upgrade must eventually be finalized, using the hdfsFinalizeMetadataUpgrade command on the NameNode. Available since API v6.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The HDFS service name.
try:
api_response = api_instance.hdfs_upgrade_metadata_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hdfs_upgrade_metadata_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The HDFS service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hive_create_metastore_database_command(cluster_name, service_name)
Create the Hive Metastore Database. Only works with embedded postgresql database.
This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for a Hive service. This command should usually be followed by a call to hiveCreateMetastoreDatabaseTables.
Available since API v4.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Hive service on which to run the command.
try:
api_response = api_instance.hive_create_metastore_database_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hive_create_metastore_database_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Hive service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hive_create_metastore_database_tables_command(cluster_name, service_name)
Create the Hive Metastore Database tables.
This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when all Hive Metastore Servers are stopped.
Available since API v3.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Hive service on which to run the command.
try:
api_response = api_instance.hive_create_metastore_database_tables_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hive_create_metastore_database_tables_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Hive service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hive_update_metastore_namenodes_command(cluster_name, service_name)
Update Hive Metastore to point to a NameNode's Nameservice name instead of hostname.
Back up the Hive Metastore Database before running this command.
This command is to be run after enabling HDFS High Availability. Only available when all Hive Metastore Servers are stopped.
Available since API v4.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Hive service on which to run the command.
try:
api_response = api_instance.hive_update_metastore_namenodes_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hive_update_metastore_namenodes_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Hive service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hive_upgrade_metastore_command(cluster_name, service_name)
Upgrade Hive Metastore as part of a major version upgrade.
When doing a major version upgrade for Hive, it is necessary to upgrade data in the metastore database. Available since API v6.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Hive service name.
try:
api_response = api_instance.hive_upgrade_metastore_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hive_upgrade_metastore_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Hive service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hive_validate_metastore_schema_command(cluster_name, service_name)
Validate the Hive Metastore Schema.
This command checks the Hive metastore schema for any errors and corruptions. This command is to be run on two instances:
Available since API v17.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Hive service on which to run the command.
try:
api_response = api_instance.hive_validate_metastore_schema_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hive_validate_metastore_schema_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Hive service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hue_dump_db_command(cluster_name, service_name)
Runs Hue's dumpdata command. Available since API v10.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service
try:
api_response = api_instance.hue_dump_db_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hue_dump_db_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hue_load_db_command(cluster_name, service_name)
Runs Hue's loaddata command. Available since API v10.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service
try:
api_response = api_instance.hue_load_db_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hue_load_db_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand hue_sync_db_command(cluster_name, service_name)
Runs Hue's syncdb command. Available since API v10.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service
try:
api_response = api_instance.hue_sync_db_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->hue_sync_db_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand iceberg_replication_test_access(cluster_name, service_name, body=body, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
Executes IcebergReplicationTestAccess command for the given path.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the ICEBERG_REPLICATION service.
body = cm_client.ApiIcebergReplicationTestAccessPaths() # ApiIcebergReplicationTestAccessPaths | An instance of ApiIcebergReplicationTestAccessPaths (optional)
source_cluster = 'source_cluster_example' # str | The name of the cluster on remote. (optional)
source_peer = 'source_peer_example' # str | The name of the peer. (optional)
source_service = 'source_service_example' # str | The name of the ICEBERG_REPLICATION service on remote. (optional)
try:
api_response = api_instance.iceberg_replication_test_access(cluster_name, service_name, body=body, source_cluster=source_cluster, source_peer=source_peer, source_service=source_service)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->iceberg_replication_test_access: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the ICEBERG_REPLICATION service. | |
| body | ApiIcebergReplicationTestAccessPaths | An instance of ApiIcebergReplicationTestAccessPaths | [optional] |
| source_cluster | str | The name of the cluster on remote. | [optional] |
| source_peer | str | The name of the peer. | [optional] |
| source_service | str | The name of the ICEBERG_REPLICATION service on remote. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand impala_create_catalog_database_command(cluster_name, service_name)
Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release. Create the Impala Catalog Database. Only works with embedded postgresql database.
This command is to be run whenever a new user and database needs to be created in the embedded postgresql database for the Impala Catalog Server. This command should usually be followed by a call to impalaCreateCatalogDatabaseTables.
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Impala service on which to run the command.
try:
api_response = api_instance.impala_create_catalog_database_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->impala_create_catalog_database_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Impala service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand impala_create_catalog_database_tables_command(cluster_name, service_name)
Not needed in CM 5.0.0 Release, since Impala Catalog Database is not yet available in CDH as of this release. Create the Impala Catalog Database tables.
This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when all Impala Catalog Servers are stopped.
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Impala service on which to run the command.
try:
api_response = api_instance.impala_create_catalog_database_tables_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->impala_create_catalog_database_tables_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Impala service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand import_mr_configs_into_yarn(cluster_name, service_name)
Import MapReduce configuration into Yarn, overwriting Yarn configuration.
You will lose existing Yarn configuration. Read all MapReduce configuration, role assignments, and role configuration groups and update Yarn with corresponding values. MR1 configuration will be converted into the equivalent MR2 configuration.
Before running this command, Yarn must be stopped and MapReduce must exist with valid configuration.
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Yarn service on which to run the command.
try:
api_response = api_instance.import_mr_configs_into_yarn(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->import_mr_configs_into_yarn: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Yarn service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand init_solr_command(cluster_name, service_name)
Initializes the Solr service in Zookeeper.
Available since API v4.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Solr service name.
try:
api_response = api_instance.init_solr_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->init_solr_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand install_mr_framework_jars(cluster_name, service_name)
Creates an HDFS directory to hold the MapReduce2 framework JARs (if necessary), and uploads the framework JARs to it.
This command is run automatically when starting a YARN service for the first time, or when upgrading an existing YARN service. It can also be run manually to ensure that the latest version of the framework JARS is installed.
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the YARN service on which to run the command.
try:
api_response = api_instance.install_mr_framework_jars(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->install_mr_framework_jars: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the YARN service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand install_oozie_share_lib(cluster_name, service_name)
Creates directory for Oozie user in HDFS and installs the ShareLib in it.
This command should be re-run after a major version upgrade to refresh the ShareLib to the latest version. Available since API v3.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Oozie service on which to run the command.
try:
api_response = api_instance.install_oozie_share_lib(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->install_oozie_share_lib: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Oozie service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand ks_migrate_to_sentry(cluster_name, service_name)
Migrates the HBase Indexer policy-based permissions to Sentry, by invoking the SentryConfigToolIndexer.
Note:
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the KeyStore Indexer service name.
try:
api_response = api_instance.ks_migrate_to_sentry(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->ks_migrate_to_sentry: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the KeyStore Indexer service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommandList list_active_commands(cluster_name, service_name, command_name=command_name, view=view)
List active service commands.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to which the role belongs.
command_name = 'command_name_example' # str | the command name, unique for the command class HdfsCreateSnapshotCommand#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, service_name, command_name=command_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->list_active_commands: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to which the role belongs. | |
| command_name | str | the command name, unique for the command class HdfsCreateSnapshotCommand#COMMAND_NAME | [optional] |
| view | str | The view of the data to materialize, either "summary" or "full". | [optional] [default to summary] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRoleTypeList list_role_types(cluster_name, service_name)
List the supported role types for a service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to modify.
try:
api_response = api_instance.list_role_types(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->list_role_types: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to modify. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommandMetadataList list_service_commands(cluster_name, service_name)
Lists all the commands (for CSD based services only) that can be executed by name on the provided service.
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.list_service_commands(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->list_service_commands: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand offline_command(cluster_name, service_name, body=body, timeout=timeout)
Offline roles of a service.
Currently the offline operation is only supported by HDFS.
For HDFS, the offline operation will put DataNodes into HDFS IN MAINTENANCE state which prevents unnecessary re-replication which could occur if decommissioned.
The timeout parameter is used to specify a timeout for offline. For HDFS, when the timeout expires, the DataNode will automatically transition out of HDFS IN MAINTENANCE state, back to HDFS IN SERVICE state.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiRoleNameList() # ApiRoleNameList | List of role names to offline. (optional)
timeout = 789 # int | Offline timeout in seconds. Offlined roles will automatically transition from offline state to normal state after timeout. Specify as null to get the default timeout (4 hours). (optional)
try:
api_response = api_instance.offline_command(cluster_name, service_name, body=body, timeout=timeout)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->offline_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. | |
| body | ApiRoleNameList | List of role names to offline. | [optional] |
| timeout | int | Offline timeout in seconds. Offlined roles will automatically transition from offline state to normal state after timeout. Specify as null to get the default timeout (4 hours). | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand oozie_create_embedded_database_command(cluster_name, service_name)
Create the Oozie Server Database. Only works with embedded postgresql database.
This command is to be run whenever a new user and database need to be created in the embedded postgresql database for an Oozie service. This command should usually be followed by a call to createOozieDb.
Available since API v10.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Oozie service on which to run the command.
try:
api_response = api_instance.oozie_create_embedded_database_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->oozie_create_embedded_database_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Oozie service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand oozie_dump_database_command(cluster_name, service_name)
Dump the Oozie Server Database.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service
try:
api_response = api_instance.oozie_dump_database_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->oozie_dump_database_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand oozie_load_database_command(cluster_name, service_name)
Load the Oozie Server Database from dump.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service
try:
api_response = api_instance.oozie_load_database_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->oozie_load_database_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand oozie_upgrade_db_command(cluster_name, service_name)
Upgrade Oozie Database schema as part of a major version upgrade.
When doing a major version upgrade for Oozie, it is necessary to upgrade the schema of its database before Oozie can run successfully. Available since API v6.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Oozie service name.
try:
api_response = api_instance.oozie_upgrade_db_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->oozie_upgrade_db_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Oozie service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiService read_service(cluster_name, service_name, view=view)
Retrieves details information about a service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
view = 'full' # str | DataView to materialize. Defaults to 'full'. (optional) (default to full)
try:
api_response = api_instance.read_service(cluster_name, service_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->read_service: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. | |
| view | str | DataView to materialize. Defaults to 'full'. | [optional] [default to full] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiServiceConfig read_service_config(cluster_name, service_name, view=view)
Retrieves the configuration of a specific service.
The "summary" view contains only the configured parameters, and configuration for role types that contain configured parameters.
The "full" view contains all available configuration parameters for the service and its role types. This mode performs validation on the configuration, which could take a few seconds on a large cluster (around 500 nodes or more).
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to query.
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)
try:
api_response = api_instance.read_service_config(cluster_name, service_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->read_service_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to query. | |
| view | str | The view of the data to materialize, either "summary" or "full". | [optional] [default to summary] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiServiceList read_services(cluster_name, view=view)
Lists all services registered in the cluster.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
view = 'summary' # str | (optional) (default to summary)
try:
api_response = api_instance.read_services(cluster_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->read_services: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| view | str | [optional] [default to summary] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ApiEntityTag] read_tags(cluster_name, service_name, limit=limit, offset=offset)
Returns the tags associated with this service. Tag names beginning with the prefix cldr (case insensitive) are reserved for internal use by Cloudera.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the service
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, service_name, limit=limit, offset=offset)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->read_tags: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the service | |
| limit | int | Number of tags | [optional] |
| offset | int | Index of the first tag to retrieve | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand recommission_command(cluster_name, service_name, body=body)
Recommission roles of a service.
The list should contain names of slave roles to recommission.
Available since API v2.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the service on which to run the command.
body = cm_client.ApiRoleNameList() # ApiRoleNameList | List of role names to recommision. (optional)
try:
api_response = api_instance.recommission_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->recommission_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the service on which to run the command. | |
| body | ApiRoleNameList | List of role names to recommision. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand recommission_with_start_command(cluster_name, service_name, body=body)
Start and recommission roles of a service.
The list should contain names of slave roles to start and recommission.
Warning: Evolving. This method may change in the future and does not offer standard compatibility guarantees. Only support by HDFS. Do not use without guidance from Cloudera.
Available since API v15.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the service on which to run the command.
body = cm_client.ApiRoleNameList() # ApiRoleNameList | List of role names to recommision. (optional)
try:
api_response = api_instance.recommission_with_start_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->recommission_with_start_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the service on which to run the command. | |
| body | ApiRoleNameList | List of role names to recommision. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand restart_command(cluster_name, service_name)
Restart the service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to start.
try:
api_response = api_instance.restart_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->restart_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to start. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand rolling_restart(cluster_name, service_name, body=body)
Command to run rolling restart of roles in a service. The sequence is:
Available since API v3. Only available with Cloudera Manager Enterprise Edition.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRollingRestartArgs() # ApiRollingRestartArgs | (optional)
try:
api_response = api_instance.rolling_restart(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->rolling_restart: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiRollingRestartArgs | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand rotate_ecs_certificates(cluster_name, service_name)
Rotate ECS Internal Certificates.
This command will rotate the TLS/SSL certificates used by Vault, Embedded DB, and Tolerations Webhook. It also rotates the ingress controller certificate if it is using the default certificate.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | the name of the ECS service
try:
api_response = api_instance.rotate_ecs_certificates(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->rotate_ecs_certificates: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | the name of the ECS service |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand sentry_create_database_command(cluster_name, service_name)
Create the Sentry Server Database. Only works with embedded postgresql database.
This command is to be run whenever a new user and database need to be created in the embedded postgresql database for a Sentry service. This command should usually be followed by a call to sentryCreateDatabaseTables.
Available since API v7.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Sentry service on which to run the command.
try:
api_response = api_instance.sentry_create_database_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->sentry_create_database_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Sentry service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand sentry_create_database_tables_command(cluster_name, service_name)
Create the Sentry Server Database tables.
This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only Available when Sentry Server is stopped.
Available since API v7.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Sentry service on which to run the command.
try:
api_response = api_instance.sentry_create_database_tables_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->sentry_create_database_tables_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Sentry service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand sentry_upgrade_database_tables_command(cluster_name, service_name)
Upgrade the Sentry Server Database tables.
This command is to be run whenever Sentry requires an upgrade to its database tables.
Available since API v8.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Sentry service on which to run the command.
try:
api_response = api_instance.sentry_upgrade_database_tables_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->sentry_upgrade_database_tables_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Sentry service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand service_command_by_name(cluster_name, command_name, service_name)
Executes a command on the service specified by name.
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
command_name = 'command_name_example' # str | The command name.
service_name = 'service_name_example' # str | The service name.
try:
api_response = api_instance.service_command_by_name(cluster_name, command_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->service_command_by_name: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| command_name | str | The command name. | |
| service_name | str | The service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand solr_bootstrap_collections_command(cluster_name, service_name)
Bootstraps Solr Collections after the CDH upgrade.
Note: This is only needed for upgrading to CDH6.0.
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Solr service name.
try:
api_response = api_instance.solr_bootstrap_collections_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->solr_bootstrap_collections_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand solr_bootstrap_config_command(cluster_name, service_name)
Bootstraps Solr config during the CDH upgrade.
Note: This is only needed for upgrading to CDH6.0.
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Solr service name.
try:
api_response = api_instance.solr_bootstrap_config_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->solr_bootstrap_config_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand solr_config_backup_command(cluster_name, service_name)
Backs up Solr configuration metadata before CDH upgrade.
Note:
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Solr service name.
try:
api_response = api_instance.solr_config_backup_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->solr_config_backup_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand solr_migrate_sentry_privileges_command(cluster_name, service_name)
Migrates Sentry privileges to new model compatible to support more granular permissions if Solr is configured with a Sentry service.
Note:
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Solr service name.
try:
api_response = api_instance.solr_migrate_sentry_privileges_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->solr_migrate_sentry_privileges_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand solr_reinitialize_state_for_upgrade_command(cluster_name, service_name)
Reinitializes the Solr state by clearing the Solr HDFS data directory, the Solr data directory, and the Zookeeper state.
Note:
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Solr service name.
try:
api_response = api_instance.solr_reinitialize_state_for_upgrade_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->solr_reinitialize_state_for_upgrade_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand solr_validate_metadata_command(cluster_name, service_name)
Validates Solr metadata and configurations.
Note: This is only needed for upgrading to CDH6.0.
Available since API v30.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | A String representing the Solr service name.
try:
api_response = api_instance.solr_validate_metadata_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->solr_validate_metadata_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | A String representing the Solr service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand sqoop_create_database_tables_command(cluster_name, service_name)
Create the Sqoop2 Server Database tables.
This command is to be run whenever a new database has been specified. Will do nothing if tables already exist. Will not perform an upgrade. Only available when Sqoop2 Server is stopped.
Available since API v10.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Sentry service on which to run the command.
try:
api_response = api_instance.sqoop_create_database_tables_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->sqoop_create_database_tables_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Sentry service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand sqoop_upgrade_db_command(cluster_name, service_name)
Upgrade Sqoop Database schema as part of a major version upgrade.
When doing a major version upgrade for Sqoop, it is necessary to upgrade the schema of its database before Sqoop can run successfully. Available since API v6.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The Sqoop service name.
try:
api_response = api_instance.sqoop_upgrade_db_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->sqoop_upgrade_db_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The Sqoop service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand start_command(cluster_name, service_name)
Start the service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to start.
try:
api_response = api_instance.start_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->start_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to start. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand stop_command(cluster_name, service_name)
Stop the service.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to stop.
try:
api_response = api_instance.stop_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->stop_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to stop. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand switch_to_mr2(cluster_name, service_name)
Change the cluster to use MR2 instead of MR1. Services will be restarted.
Will perform the following steps:
Available since API v6.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | Name of the Yarn service on which to run the command.
try:
api_response = api_instance.switch_to_mr2(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->switch_to_mr2: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | Name of the Yarn service on which to run the command. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand update_ecs_ingress_controller_cert(cluster_name, service_name)
Updates the certificate used by the ECS Ingress Controller.
This API facilitates the updating of the certificate utilized by the ECS Ingress Controller, enabling automation of certificate pipelines.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The name of the ECS service.
try:
api_response = api_instance.update_ecs_ingress_controller_cert(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->update_ecs_ingress_controller_cert: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The name of the ECS service. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiService update_service(cluster_name, service_name, body=body)
Updates service information.
This method will update only writable fields of the service information. Currently this only includes the service display name. Available since API v3.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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiService() # ApiService | Updated service information. (optional)
try:
api_response = api_instance.update_service(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->update_service: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service name. | |
| body | ApiService | Updated service information. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiServiceConfig update_service_config(cluster_name, service_name, body=body, message=message)
Updates the service configuration with the given values.
If a value is set in the given configuration, it will be added to the service's configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any.
Attributes that are not listed in the input will maintain their current values in the configuration.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to modify.
body = cm_client.ApiServiceConfig() # ApiServiceConfig | Configuration changes. (optional)
message = 'message_example' # str | Optional message describing the changes. (optional)
try:
api_response = api_instance.update_service_config(cluster_name, service_name, body=body, message=message)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->update_service_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to modify. | |
| body | ApiServiceConfig | Configuration changes. | [optional] |
| message | str | Optional message describing the changes. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand yarn_format_state_store(cluster_name, service_name)
Formats the state store in ZooKeeper used for Resource Manager High Availability. Typically used while moving from non-secure to secure cluster or vice-versa.
Available since API v8.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The YARN service name.
try:
api_response = api_instance.yarn_format_state_store(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->yarn_format_state_store: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The YARN service name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand zoo_keeper_cleanup_command(cluster_name, service_name)
Clean up all running server instances of a ZooKeeper service.
This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to start.
try:
api_response = api_instance.zoo_keeper_cleanup_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->zoo_keeper_cleanup_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to start. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand zoo_keeper_init_command(cluster_name, service_name)
Initializes all the server instances of a ZooKeeper service.
ZooKeeper server roles need to be initialized before they can be used.
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.ServicesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str | The service to start.
try:
api_response = api_instance.zoo_keeper_init_command(cluster_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ServicesResourceApi->zoo_keeper_init_command: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | The service to start. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]