All URIs are relative to https://localhost/api/v54
Method | HTTP request | Description |
---|---|---|
format_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsFormat | Format HDFS NameNodes. |
hdfs_bootstrap_stand_by_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsBootstrapStandBy | Bootstrap HDFS stand-by NameNodes. |
hdfs_enter_safemode | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsEnterSafemode | Enter safemode for namenodes. |
hdfs_finalize_metadata_upgrade | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsFinalizeMetadataUpgrade | Finalize HDFS NameNode metadata upgrade. |
hdfs_initialize_auto_failover_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsInitializeAutoFailover | Initialize HDFS HA failover controller metadata. |
hdfs_initialize_shared_dir_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsInitializeSharedDir | Initialize HDFS NameNodes' shared edit directory. |
hdfs_leave_safemode | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsLeaveSafemode | Leave safemode for namenodes. |
hdfs_save_namespace | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsSaveNamespace | Save namespace for namenodes. |
jmap_dump | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/jmapDump | Run the jmapDump diagnostic command. |
jmap_histo | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/jmapHisto | Run the jmapHisto diagnostic command. |
jstack | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/jstack | Run the jstack diagnostic command. |
lsof | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/lsof | Run the lsof diagnostic command. |
refresh_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/refresh | Refresh a role's data. |
restart_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/restart | Restart a set of role instances. |
role_command_by_name | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/{commandName} | Execute a role command by name. |
start_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/start | Start a set of role instances. |
stop_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/stop | Stop a set of role instances. |
sync_hue_db_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/hueSyncDb | Create / update the Hue database schema. |
zoo_keeper_cleanup_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/zooKeeperCleanup | Cleanup a list of ZooKeeper server roles. |
zoo_keeper_init_command | POST /clusters/{clusterName}/services/{serviceName}/roleCommands/zooKeeperInit | Initialize a list of ZooKeeper server roles. |
ApiBulkCommandList format_command(cluster_name, service_name, body=body)
Format HDFS NameNodes.
Format HDFS NameNodes.
Submit a format request to a list of NameNodes on a service. Note that trying to format a previously formatted NameNode will fail.
Note about high availability: when two NameNodes are working in an HA pair, only one of them should be formatted.
Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the NameNodes to format. (optional)
try:
# Format HDFS NameNodes.
api_response = api_instance.format_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->format_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the NameNodes to format. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_bootstrap_stand_by_command(cluster_name, service_name, body=body)
Bootstrap HDFS stand-by NameNodes.
Bootstrap HDFS stand-by NameNodes.
Submit a request to synchronize HDFS NameNodes with their assigned HA partners. The command requires that the target NameNodes are part of existing HA pairs, which can be accomplished by setting the nameservice configuration parameter in the NameNode's configuration.
The HA partner must already be formatted and running for this command to run.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the stand-by NameNodes to bootstrap. (optional)
try:
# Bootstrap HDFS stand-by NameNodes.
api_response = api_instance.hdfs_bootstrap_stand_by_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_bootstrap_stand_by_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the stand-by NameNodes to bootstrap. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_enter_safemode(cluster_name, service_name, body=body)
Enter safemode for namenodes.
Enter safemode for namenodes
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | NameNodes for which to enter safemode. (optional)
try:
# Enter safemode for namenodes.
api_response = api_instance.hdfs_enter_safemode(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_enter_safemode: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | NameNodes for which to enter safemode. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_finalize_metadata_upgrade(cluster_name, service_name, body=body)
Finalize HDFS NameNode metadata upgrade.
Finalize HDFS NameNode metadata upgrade.
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | NameNodes for which to finalize the upgrade. (optional)
try:
# Finalize HDFS NameNode metadata upgrade.
api_response = api_instance.hdfs_finalize_metadata_upgrade(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_finalize_metadata_upgrade: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | NameNodes for which to finalize the upgrade. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_initialize_auto_failover_command(cluster_name, service_name, body=body)
Initialize HDFS HA failover controller metadata.
Initialize HDFS HA failover controller metadata.
The controllers being initialized must already exist and be properly configured. The command will make sure the needed data is initialized for the controller to work.
Only one controller per nameservice needs to be initialized.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the controllers to initialize. (optional)
try:
# Initialize HDFS HA failover controller metadata.
api_response = api_instance.hdfs_initialize_auto_failover_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_initialize_auto_failover_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the controllers to initialize. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_initialize_shared_dir_command(cluster_name, service_name, body=body)
Initialize HDFS NameNodes' shared edit directory.
Initialize HDFS NameNodes' shared edit directory.
Shared edit directories are used when two HDFS NameNodes are operating as a high-availability pair. This command initializes the shared directory to include the necessary metadata.
The provided role names should reflect one of the NameNodes in the respective HA pair; the role must be stopped and its data directory must already have been formatted. The shared edits directory must be empty for this command to succeed.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the NameNodes. (optional)
try:
# Initialize HDFS NameNodes' shared edit directory.
api_response = api_instance.hdfs_initialize_shared_dir_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_initialize_shared_dir_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the NameNodes. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_leave_safemode(cluster_name, service_name, body=body)
Leave safemode for namenodes.
Leave safemode for namenodes
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | NameNodes for which to leave safemode. (optional)
try:
# Leave safemode for namenodes.
api_response = api_instance.hdfs_leave_safemode(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_leave_safemode: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | NameNodes for which to leave safemode. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList hdfs_save_namespace(cluster_name, service_name, body=body)
Save namespace for namenodes.
Save namespace for namenodes
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | NameNodes for which to save namespace. (optional)
try:
# Save namespace for namenodes.
api_response = api_instance.hdfs_save_namespace(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->hdfs_save_namespace: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | NameNodes for which to save namespace. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList jmap_dump(cluster_name, service_name, body=body)
Run the jmapDump diagnostic command.
Run the jmapDump diagnostic command. The command runs the jmap utility to capture a dump of the role's java heap.
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | the names of the roles to jmap. (optional)
try:
# Run the jmapDump diagnostic command.
api_response = api_instance.jmap_dump(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->jmap_dump: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | the names of the roles to jmap. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList jmap_histo(cluster_name, service_name, body=body)
Run the jmapHisto diagnostic command.
Run the jmapHisto diagnostic command. The command runs the jmap utility to capture a histogram of the objects on the role's java heap.
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | the names of the roles to jmap. (optional)
try:
# Run the jmapHisto diagnostic command.
api_response = api_instance.jmap_histo(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->jmap_histo: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | the names of the roles to jmap. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList jstack(cluster_name, service_name, body=body)
Run the jstack diagnostic command.
Run the jstack diagnostic command. The command runs the jstack utility to capture a role's java thread stacks.
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | the names of the roles to jstack. (optional)
try:
# Run the jstack diagnostic command.
api_response = api_instance.jstack(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->jstack: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | the names of the roles to jstack. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList lsof(cluster_name, service_name, body=body)
Run the lsof diagnostic command.
Run the lsof diagnostic command. This command runs the lsof utility to list a role's open files.
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | the names of the roles to lsof. (optional)
try:
# Run the lsof diagnostic command.
api_response = api_instance.lsof(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->lsof: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | the names of the roles to lsof. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList refresh_command(cluster_name, service_name, body=body)
Refresh a role's data.
Refresh a role's data.
For MapReduce services, this command should be executed on JobTracker roles. It refreshes the role's queue and node information.
For HDFS services, this command should be executed on NameNode or DataNode roles. For NameNodes, it refreshes the role's node list. For DataNodes, it refreshes the role's data directory list and other configuration.
For YARN services, this command should be executed on ResourceManager roles. It refreshes the role's queue and node information.
Available since API v1. DataNode data directories refresh 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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the roles. (optional)
try:
# Refresh a role's data.
api_response = api_instance.refresh_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->refresh_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the roles. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList restart_command(cluster_name, service_name, body=body)
Restart a set of role instances.
Restart a set of role instances
Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The name of the roles to restart. (optional)
try:
# Restart a set of role instances.
api_response = api_instance.restart_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->restart_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The name of the roles to restart. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList role_command_by_name(cluster_name, command_name, service_name, body=body)
Execute a role command by name.
Execute a role command 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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
command_name = 'command_name_example' # str | the name of command to execute.
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | the roles to run this command on. (optional)
try:
# Execute a role command by name.
api_response = api_instance.role_command_by_name(cluster_name, command_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->role_command_by_name: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
command_name | str | the name of command to execute. | |
service_name | str | ||
body | ApiRoleNameList | the roles to run this command on. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList start_command(cluster_name, service_name, body=body)
Start a set of role instances.
Start a set of role instances.
Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the roles to start. (optional)
try:
# Start a set of role instances.
api_response = api_instance.start_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->start_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the roles to start. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList stop_command(cluster_name, service_name, body=body)
Stop a set of role instances.
Stop a set of role instances.
Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The role type. (optional)
try:
# Stop a set of role instances.
api_response = api_instance.stop_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->stop_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The role type. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList sync_hue_db_command(cluster_name, service_name, body=body)
Create / update the Hue database schema.
Create / update the Hue database schema.
This command is to be run whenever a new database has been specified or, as necessary, after an upgrade.
This request should be sent to Hue servers only.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the Hue server roles. (optional)
try:
# Create / update the Hue database schema.
api_response = api_instance.sync_hue_db_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->sync_hue_db_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the Hue server roles. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList zoo_keeper_cleanup_command(cluster_name, service_name, body=body)
Cleanup a list of ZooKeeper server roles.
Cleanup a list of ZooKeeper server roles.
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.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the roles. (optional)
try:
# Cleanup a list of ZooKeeper server roles.
api_response = api_instance.zoo_keeper_cleanup_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->zoo_keeper_cleanup_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the roles. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiBulkCommandList zoo_keeper_init_command(cluster_name, service_name, body=body)
Initialize a list of ZooKeeper server roles.
Initialize a list of ZooKeeper server roles.
This applies to ZooKeeper services from CDH4. Before ZooKeeper server roles can be used, they need to be initialized.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RoleCommandsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | The names of the roles. (optional)
try:
# Initialize a list of ZooKeeper server roles.
api_response = api_instance.zoo_keeper_init_command(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RoleCommandsResourceApi->zoo_keeper_init_command: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cluster_name | str | ||
service_name | str | ||
body | ApiRoleNameList | The names of the roles. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]