All URIs are relative to /api/v58
| Method | HTTP request | Description |
|---|---|---|
| create_roles | POST /cm/service/roles | |
| delete_role | DELETE /cm/service/roles/{roleName} | |
| enter_maintenance_mode | POST /cm/service/roles/{roleName}/commands/enterMaintenanceMode | |
| exit_maintenance_mode | POST /cm/service/roles/{roleName}/commands/exitMaintenanceMode | |
| get_full_log | GET /cm/service/roles/{roleName}/logs/full | |
| get_stacks_log | GET /cm/service/roles/{roleName}/logs/stacks | |
| get_stacks_logs_bundle | GET /cm/service/roles/{roleName}/logs/stacksBundle | |
| get_standard_error | GET /cm/service/roles/{roleName}/logs/stderr | |
| get_standard_output | GET /cm/service/roles/{roleName}/logs/stdout | |
| list_active_commands | GET /cm/service/roles/{roleName}/commands | |
| read_role | GET /cm/service/roles/{roleName} | |
| read_role_config | GET /cm/service/roles/{roleName}/config | |
| read_roles | GET /cm/service/roles | |
| update_role_config | PUT /cm/service/roles/{roleName}/config |
ApiRoleList create_roles(body=body)
Create new roles in the Cloudera Management 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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiRoleList() # ApiRoleList | Roles to create. (optional)
try:
api_response = api_instance.create_roles(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->create_roles: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| body | ApiRoleList | Roles to create. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiRole delete_role(role_name)
Delete a role from the Cloudera Management 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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role name.
try:
api_response = api_instance.delete_role(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->delete_role: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand enter_maintenance_mode(role_name)
Put the Cloudera Management Service role into maintenance mode.This is a synchronous command. The result is known immediately upon return.
Available since API v18.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role name.
try:
api_response = api_instance.enter_maintenance_mode(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->enter_maintenance_mode: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommand exit_maintenance_mode(role_name)
Take the Cloudera Management Service role out of maintenance mode. This is a synchronous command. The result is known immediately upon return.
Available since API v18.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role name.
try:
api_response = api_instance.exit_maintenance_mode(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->exit_maintenance_mode: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_full_log(role_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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to fetch logs from.
try:
api_response = api_instance.get_full_log(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->get_full_log: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to fetch logs from. |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_stacks_log(role_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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to fetch stacks logs from.
try:
api_response = api_instance.get_stacks_log(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->get_stacks_log: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to fetch stacks logs from. |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_stacks_logs_bundle(role_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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to fetch the stacks logs bundle from.
try:
api_response = api_instance.get_stacks_logs_bundle(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->get_stacks_logs_bundle: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to fetch the stacks logs bundle from. |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_standard_error(role_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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to fetch stderr from.
try:
api_response = api_instance.get_standard_error(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->get_standard_error: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to fetch stderr from. |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str get_standard_output(role_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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to fetch stdout from.
try:
api_response = api_instance.get_standard_output(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->get_standard_output: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to fetch stdout from. |
str
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiCommandList list_active_commands(role_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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role name.
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(role_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->list_active_commands: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role name. | |
| 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]
ApiRole read_role(role_name)
Retrieve detailed information about a Cloudera Management Services 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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role name.
try:
api_response = api_instance.read_role(role_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->read_role: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role name. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiConfigList read_role_config(role_name, view=view)
Retrieve the configuration of a specific Cloudera Management Services 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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to look up.
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(role_name, view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->read_role_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to look up. | |
| 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()
List all roles of the Cloudera Management 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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
try:
api_response = api_instance.read_roles()
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->read_roles: %s\n" % e)
This endpoint does not need any parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiConfigList update_role_config(role_name, body=body, message=message)
Update the configuration of a Cloudera Management Services role.
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.MgmtRolesResourceApi(cm_client.ApiClient(configuration))
role_name = 'role_name_example' # str | The role to modify.
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(role_name, body=body, message=message)
pprint(api_response)
except ApiException as e:
print("Exception when calling MgmtRolesResourceApi->update_role_config: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| role_name | str | The role to modify. | |
| 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]