All URIs are relative to /api/v58
| Method | HTTP request | Description |
|---|---|---|
| add_tags | PUT /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/tags | |
| bulk_delete_roles | POST /clusters/{clusterName}/services/{serviceName}/roles/bulkDelete | |
| create_roles | POST /clusters/{clusterName}/services/{serviceName}/roles | |
| delete_force_role | DELETE /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/forceDelete | |
| delete_role | DELETE /clusters/{clusterName}/services/{serviceName}/roles/{roleName} | |
| delete_tags | DELETE /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/tags | |
| enter_maintenance_mode | POST /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/enterMaintenanceMode | |
| exit_maintenance_mode | POST /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/exitMaintenanceMode | |
| get_full_log | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/full | |
| get_metrics | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/metrics | |
| get_stacks_log | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stacks | |
| get_stacks_logs_bundle | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stacksBundle | |
| get_standard_error | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stderr | |
| get_standard_output | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stdout | |
| impala_diagnostics | POST /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/impalaDiagnostics | |
| list_active_commands | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands | |
| list_commands | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commandsByName | |
| read_role | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName} | |
| read_role_config | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/config | |
| read_roles | GET /clusters/{clusterName}/services/{serviceName}/roles | |
| read_roles_config | GET /clusters/{clusterName}/services/{serviceName}/roles/configs | |
| read_tags | GET /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/tags | |
| update_role_config | PUT /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/config |
list[ApiEntityTag] add_tags(cluster_name, role_name, service_name, body=body)
Attach tags to the role. 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | Name of the role
service_name = 'service_name_example' # str |
body = [cm_client.ApiEntityTag()] # list[ApiEntityTag] | List of tags to add to the role (optional)
try:
api_response = api_instance.add_tags(cluster_name, role_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->add_tags: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | Name of the role | |
| service_name | str | ||
| body | list[ApiEntityTag] | List of tags to add to the role | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRoleList bulk_delete_roles(cluster_name, service_name, body=body)
Bulk delete roles in a particular service by name. Fails if any role cannot be found.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleNameList() # ApiRoleNameList | list of role names to be deleted (optional)
try:
api_response = api_instance.bulk_delete_roles(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->bulk_delete_roles: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiRoleNameList | list of role names to be deleted | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRoleList create_roles(cluster_name, service_name, body=body)
Create new roles in a given service.
| Service Type | Available Role Types |
|---|---|
| HDFS (CDH3) | NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, GATEWAY |
| HDFS (CDH4) | NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, HTTPFS, FAILOVERCONTROLLER, GATEWAY, JOURNALNODE |
| HDFS (CDH5) | NAMENODE, DATANODE, SECONDARYNAMENODE, BALANCER, HTTPFS, FAILOVERCONTROLLER, GATEWAY, JOURNALNODE, NFSGATEWAY | MAPREDUCE | JOBTRACKER, TASKTRACKER, GATEWAY, FAILOVERCONTROLLER, | HBASE | MASTER, REGIONSERVER, GATEWAY, HBASETHRIFTSERVER, HBASERESTSERVER |
| YARN | RESOURCEMANAGER, NODEMANAGER, JOBHISTORY, GATEWAY |
| OOZIE | OOZIE_SERVER |
| ZOOKEEPER | SERVER |
| HUE (CDH3) | HUE_SERVER, BEESWAX_SERVER, KT_RENEWER, JOBSUBD |
| HUE (CDH4) | HUE_SERVER, BEESWAX_SERVER, KT_RENEWER |
| HUE (CDH5) | HUE_SERVER, KT_RENEWER |
| HUE (CDH5 5.5+) | HUE_SERVER, KT_RENEWER, HUE_LOAD_BALANCER |
| FLUME | AGENT |
| IMPALA (CDH4) | IMPALAD, STATESTORE, CATALOGSERVER |
| IMPALA (CDH5) | IMPALAD, STATESTORE, CATALOGSERVER |
| HIVE | HIVESERVER2, HIVEMETASTORE, WEBHCAT, GATEWAY |
| SOLR | SOLR_SERVER, GATEWAY |
| SQOOP | SQOOP_SERVER |
| SQOOP_CLIENT | GATEWAY |
| SENTRY | SENTRY_SERVER |
| ACCUMULO16 | GARBAGE_COLLECTOR, GATEWAY, ACCUMULO16_MASTER, MONITOR, ACCUMULO16_TSERVER, TRACER |
| KMS | KMS |
| KS_INDEXER | HBASE_INDEXER |
| SPARK_ON_YARN | GATEWAY, SPARK_YARN_HISTORY_SERVER |
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
body = cm_client.ApiRoleList() # ApiRoleList | Roles to create. (optional)
try:
api_response = api_instance.create_roles(cluster_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->create_roles: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| body | ApiRoleList | Roles to create. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRole delete_force_role(cluster_name, role_name, service_name)
Force deletes a role from a given 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role name.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.delete_force_role(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->delete_force_role: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role name. | |
| service_name | str |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRole delete_role(cluster_name, role_name, service_name)
Deletes a role from a given 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role name.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.delete_role(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->delete_role: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role name. | |
| service_name | str |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[ApiEntityTag] delete_tags(cluster_name, role_name, service_name, body=body)
Remove the tags associated with the role. 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | Name of the role to remove tags from
service_name = 'service_name_example' # str |
body = [cm_client.ApiEntityTag()] # list[ApiEntityTag] | A list of tags to remove from the role (optional)
try:
api_response = api_instance.delete_tags(cluster_name, role_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->delete_tags: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | Name of the role to remove tags from | |
| service_name | str | ||
| body | list[ApiEntityTag] | A list of tags to remove from the role | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enter_maintenance_mode(cluster_name, role_name, service_name)
Put the role 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role name.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.enter_maintenance_mode(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->enter_maintenance_mode: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role name. | |
| service_name | str |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand exit_maintenance_mode(cluster_name, role_name, service_name)
Take the role 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role name.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.exit_maintenance_mode(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->exit_maintenance_mode: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role name. | |
| service_name | str |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_full_log(cluster_name, role_name, service_name)
Retrieves the log file for the role's main process.
If the role is not started, this will be the log file associated with the last time the role was run.
Log files are returned as plain text (type "text/plain").
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to fetch logs from.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.get_full_log(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->get_full_log: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to fetch logs from. | |
| service_name | str |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiMetricList get_metrics(cluster_name, role_name, service_name, _from=_from, metrics=metrics, to=to, view=view)
Fetch metric readings for a particular role.
By default, this call will look up all metrics available for the role. 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 role, even if no readings are available in the requested window.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The name of the role.
service_name = 'service_name_example' # str |
_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, role_name, service_name, _from=_from, metrics=metrics, to=to, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->get_metrics: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The name of the role. | |
| service_name | str | ||
| _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]
str get_stacks_log(cluster_name, role_name, service_name)
Retrieves the stacks log file, if any, for the role's main process. Note that not all roles support periodic stacks collection. The log files are returned as plain text (type "text/plain").
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to fetch stacks logs from.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.get_stacks_log(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->get_stacks_log: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to fetch stacks logs from. | |
| service_name | str |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_stacks_logs_bundle(cluster_name, role_name, service_name)
Download a zip-compressed archive of role stacks logs. Note that not all roles support periodic stacks collection.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to fetch the stacks logs bundle from.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.get_stacks_logs_bundle(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->get_stacks_logs_bundle: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to fetch the stacks logs bundle from. | |
| service_name | str |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_standard_error(cluster_name, role_name, service_name)
Retrieves the role's standard error output.
If the role is not started, this will be the output associated with the last time the role was run.
Log files are returned as plain text (type "text/plain").
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to fetch stderr from.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.get_standard_error(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->get_standard_error: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to fetch stderr from. | |
| service_name | str |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_standard_output(cluster_name, role_name, service_name)
Retrieves the role's standard output.
If the role is not started, this will be the output associated with the last time the role was run.
Log files are returned as plain text (type "text/plain").
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to fetch stdout from.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.get_standard_output(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->get_standard_output: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to fetch stdout from. | |
| service_name | str |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand impala_diagnostics(cluster_name, role_name, service_name, body=body)
Collects diagnostics data for an Impala role.
Available since API v31.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role name.
service_name = 'service_name_example' # str |
body = cm_client.ApiImpalaRoleDiagnosticsArgs() # ApiImpalaRoleDiagnosticsArgs | (optional)
try:
api_response = api_instance.impala_diagnostics(cluster_name, role_name, service_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->impala_diagnostics: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role name. | |
| service_name | str | ||
| body | ApiImpalaRoleDiagnosticsArgs | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommandList list_active_commands(cluster_name, role_name, service_name, view=view)
List active role 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to start.
service_name = 'service_name_example' # str |
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, role_name, service_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->list_active_commands: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to start. | |
| service_name | str | ||
| 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]
ApiCommandMetadataList list_commands(cluster_name, role_name, service_name)
Lists all the commands that can be executed by name on the provided role.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | the role name.
service_name = 'service_name_example' # str |
try:
api_response = api_instance.list_commands(cluster_name, role_name, service_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->list_commands: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | the role name. | |
| service_name | str |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRole read_role(cluster_name, role_name, service_name, view=view)
Retrieves detailed information about a role.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role name.
service_name = 'service_name_example' # str |
view = 'full' # str | The view to materialize. Defaults to 'full'. (optional) (default to full)
try:
api_response = api_instance.read_role(cluster_name, role_name, service_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->read_role: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role name. | |
| service_name | str | ||
| view | str | The view to materialize. Defaults to 'full'. | [optional] [default to full] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiConfigList read_role_config(cluster_name, role_name, service_name, view=view)
Retrieves the configuration of a specific role. Note that the "full" view 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to look up.
service_name = 'service_name_example' # str |
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)
try:
api_response = api_instance.read_role_config(cluster_name, role_name, service_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->read_role_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to look up. | |
| service_name | str | ||
| 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]
ApiRoleList read_roles(cluster_name, service_name, filter=filter, view=view)
Lists all roles of a given 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
filter = '' # str | Optional query to filter the roles by. <p> The query specifies the intersection of a list of constraints, joined together with semicolons (without spaces). For example: hostname==host1.abc.com;type==DATANODE </p> Currently supports filtering by: <ul> <li>hostname: The hostname of the host the role is running on.</li> <li>hostId: The unique identifier of the host the role is running on.</li> <li>type: The role's type.</li> </ul> (optional)
view = 'summary' # str | DataView for getting roles. Defaults to 'summary'. (optional) (default to summary)
try:
api_response = api_instance.read_roles(cluster_name, service_name, filter=filter, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->read_roles: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| filter | str | Optional query to filter the roles by. The query specifies the intersection of a list of constraints, joined together with semicolons (without spaces). For example: hostname==host1.abc.com;type==DATANODE Currently supports filtering by:
| [optional] |
| view | str | DataView for getting roles. Defaults to 'summary'. | [optional] [default to summary] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRoleConfigList read_roles_config(cluster_name, service_name, limit=limit, offset=offset, view=view)
Retrieves all the roles in the service, including all the configurations for each role. This API does not retrieve the configs for the service,only the configs in the roles in 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
service_name = 'service_name_example' # str |
limit = 56 # int | Maximum size of list of roles configuration parameters (optional)
offset = 56 # int | Index of first role configuration parameters (optional)
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)
try:
api_response = api_instance.read_roles_config(cluster_name, service_name, limit=limit, offset=offset, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->read_roles_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| service_name | str | ||
| limit | int | Maximum size of list of roles configuration parameters | [optional] |
| offset | int | Index of first role configuration parameters | [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]
list[ApiEntityTag] read_tags(cluster_name, role_name, service_name, limit=limit, offset=offset)
Returns the tags associated with this role. 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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The name of the role
service_name = 'service_name_example' # str |
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, role_name, service_name, limit=limit, offset=offset)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->read_tags: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The name of the role | |
| service_name | str | ||
| 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]
ApiConfigList update_role_config(cluster_name, role_name, service_name, body=body, message=message)
Updates the role configuration with the given values.
If a value is set in the given configuration, it will be added to the role'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.RolesResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str |
role_name = 'role_name_example' # str | The role to modify.
service_name = 'service_name_example' # str |
body = cm_client.ApiConfigList() # ApiConfigList | Configuration changes. (optional)
message = 'message_example' # str | Optional message describing the changes. (optional)
try:
api_response = api_instance.update_role_config(cluster_name, role_name, service_name, body=body, message=message)
pprint(api_response)
except ApiException as e:
print("Exception when calling RolesResourceApi->update_role_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| cluster_name | str | ||
| role_name | str | The role to modify. | |
| service_name | str | ||
| body | ApiConfigList | 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]