cm_client.MgmtServiceResourceApi

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

Method HTTP request Description
auto_assign_roles PUT /cm/service/autoAssignRoles Automatically assign roles to hosts and create the roles for the Cloudera Management Service.
auto_configure PUT /cm/service/autoConfigure Automatically configures roles of the Cloudera Management Service.
delete_cms DELETE /cm/service Delete the Cloudera Management Services.
enter_maintenance_mode POST /cm/service/commands/enterMaintenanceMode Put Cloudera Management Service into maintenance mode.
exit_maintenance_mode POST /cm/service/commands/exitMaintenanceMode Take Cloudera Management Service out of maintenance mode.
list_active_commands GET /cm/service/commands List active Cloudera Management Services commands.
list_role_types GET /cm/service/roleTypes List the supported role types for the Cloudera Management Services.
read_service GET /cm/service Retrieve information about the Cloudera Management Services.
read_service_config GET /cm/service/config Retrieve the configuration of the Cloudera Management Services.
restart_command POST /cm/service/commands/restart Restart the Cloudera Management Services.
setup_cms PUT /cm/service Setup the Cloudera Management Services.
start_command POST /cm/service/commands/start Start the Cloudera Management Services.
stop_command POST /cm/service/commands/stop Stop the Cloudera Management Services.
update_service_config PUT /cm/service/config Update the Cloudera Management Services configuration.

auto_assign_roles

auto_assign_roles()

Automatically assign roles to hosts and create the roles for the Cloudera Management Service.

Automatically assign roles to hosts and create the roles for the Cloudera Management Service.

Assignments are done based on number of hosts in the deployment and hardware specifications. If no hosts are part of the deployment, an exception will be thrown preventing any role assignments. Existing roles will be taken into account and their assignments will be not be modified. The deployment should not have any clusters when calling this endpoint. If it does, an exception will be thrown preventing any role assignments.

Available since API v6.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Automatically assign roles to hosts and create the roles for the Cloudera Management Service.
    api_instance.auto_assign_roles()
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->auto_assign_roles: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

auto_configure

auto_configure()

Automatically configures roles of the Cloudera Management Service.

Automatically configures roles of the Cloudera Management Service.

Overwrites some existing configurations. Only default role config groups must exist before calling this endpoint. Other role config groups must not exist. If they do, an exception will be thrown preventing any configuration. Ignores any clusters (and their services and roles) colocated with the Cloudera Management Service. To avoid over-committing the heap on hosts, place the Cloudera Management Service roles on machines not used by any of the clusters.

Available since API v6.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Automatically configures roles of the Cloudera Management Service.
    api_instance.auto_configure()
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->auto_configure: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_cms

ApiService delete_cms()

Delete the Cloudera Management Services.

Delete the Cloudera Management Services.

This method will fail if a CMS instance doesn't already exist.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Delete the Cloudera Management Services.
    api_response = api_instance.delete_cms()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->delete_cms: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiService

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

enter_maintenance_mode

ApiCommand enter_maintenance_mode()

Put Cloudera Management Service into maintenance mode.

Put Cloudera Management Service into maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v18.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Put Cloudera Management Service into maintenance mode.
    api_response = api_instance.enter_maintenance_mode()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->enter_maintenance_mode: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

exit_maintenance_mode

ApiCommand exit_maintenance_mode()

Take Cloudera Management Service out of maintenance mode.

Take Cloudera Management Service out of maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v18.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Take Cloudera Management Service out of maintenance mode.
    api_response = api_instance.exit_maintenance_mode()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->exit_maintenance_mode: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_active_commands

ApiCommandList list_active_commands(view=view)

List active Cloudera Management Services commands.

List active Cloudera Management Services commands.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    # List active Cloudera Management Services commands.
    api_response = api_instance.list_active_commands(view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->list_active_commands: %s\n" % e)

Parameters

Name Type Description Notes
view str The view of the data to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiCommandList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_role_types

ApiRoleTypeList list_role_types()

List the supported role types for the Cloudera Management Services.

List the supported role types for the Cloudera Management Services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # List the supported role types for the Cloudera Management Services.
    api_response = api_instance.list_role_types()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->list_role_types: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiRoleTypeList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_service

ApiService read_service(view=view)

Retrieve information about the Cloudera Management Services.

Retrieve information about the Cloudera Management Services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))
view = 'summary' # str |  (optional) (default to summary)

try:
    # Retrieve information about the Cloudera Management Services.
    api_response = api_instance.read_service(view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->read_service: %s\n" % e)

Parameters

Name Type Description Notes
view str [optional] [default to summary]

Return type

ApiService

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_service_config

ApiServiceConfig read_service_config(view=view)

Retrieve the configuration of the Cloudera Management Services.

Retrieve the configuration of the Cloudera Management Services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))
view = 'summary' # str | The view of the data to materialize, either \"summary\" or \"full\". (optional) (default to summary)

try:
    # Retrieve the configuration of the Cloudera Management Services.
    api_response = api_instance.read_service_config(view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->read_service_config: %s\n" % e)

Parameters

Name Type Description Notes
view str The view of the data to materialize, either "summary" or "full". [optional] [default to summary]

Return type

ApiServiceConfig

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

restart_command

ApiCommand restart_command()

Restart the Cloudera Management Services.

Restart the Cloudera Management Services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Restart the Cloudera Management Services.
    api_response = api_instance.restart_command()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->restart_command: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

setup_cms

ApiService setup_cms(body=body)

Setup the Cloudera Management Services.

Setup the Cloudera Management Services.

Configure the CMS instance and create all the management roles. The provided configuration data can be used to set up host mappings for each role, and required configuration such as database connection information for specific roles.

Regardless of the list of roles provided in the input data, all management roles are created by this call. The input is used to override any default settings for the specific roles.

This method needs a valid CM license to be installed beforehand.

This method does not start any services or roles.

This method will fail if a CMS instance already exists.

Available role types:

REPORTSMANAGER, NAVIGATOR and NAVIGATORMETASERVER are only available with Cloudera Manager Enterprise Edition.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiService() # ApiService | Role configuration overrides. (optional)

try:
    # Setup the Cloudera Management Services.
    api_response = api_instance.setup_cms(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->setup_cms: %s\n" % e)

Parameters

Name Type Description Notes
body ApiService Role configuration overrides. [optional]

Return type

ApiService

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

start_command

ApiCommand start_command()

Start the Cloudera Management Services.

Start the Cloudera Management Services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Start the Cloudera Management Services.
    api_response = api_instance.start_command()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->start_command: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

stop_command

ApiCommand stop_command()

Stop the Cloudera Management Services.

Stop the Cloudera Management Services.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))

try:
    # Stop the Cloudera Management Services.
    api_response = api_instance.stop_command()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->stop_command: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiCommand

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_service_config

ApiServiceConfig update_service_config(message=message, body=body)

Update the Cloudera Management Services configuration.

Update the Cloudera Management Services configuration.

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.

Example

from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.MgmtServiceResourceApi(cm_client.ApiClient(configuration))
message = 'message_example' # str | Optional message describing the changes. (optional)
body = cm_client.ApiServiceConfig() # ApiServiceConfig | Configuration changes. (optional)

try:
    # Update the Cloudera Management Services configuration.
    api_response = api_instance.update_service_config(message=message, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MgmtServiceResourceApi->update_service_config: %s\n" % e)

Parameters

Name Type Description Notes
message str Optional message describing the changes. [optional]
body ApiServiceConfig Configuration changes. [optional]

Return type

ApiServiceConfig

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]