Package cm_api :: Package endpoints :: Module cms :: Class ClouderaManager
[hide private]
[frames] | no frames]

Class ClouderaManager

source code

         object --+        
                  |        
types.BaseApiObject --+    
                      |    
  types.BaseApiResource --+
                          |
                         ClouderaManager

The Cloudera Manager instance.

Provides access to CM configuration and services.

Instance Methods [hide private]
 
__init__(self, resource_root)
Initializes internal state and sets all known writable properties of the object to None.
source code
 
_path(self)
Returns the path to the resource.
source code
 
get_commands(self, view=None)
Retrieve a list of running global commands.
source code
 
create_mgmt_service(self, service_setup_info)
Setup the Cloudera Management Service.
source code
 
delete_mgmt_service(self)
Delete the Cloudera Management Service.
source code
 
get_service(self)
Return the Cloudera Management Services instance.
source code
 
get_license(self)
Return information about the currently installed license.
source code
 
update_license(self, license_text)
Install or update the Cloudera Manager license.
source code
 
get_config(self, view=None)
Retrieve the Cloudera Manager configuration.
source code
 
update_config(self, config)
Update the CM configuration.
source code
 
generate_credentials(self)
Generate credentials for services configured with Kerberos.
source code
 
inspect_hosts(self)
Runs the host inspector on the configured hosts.
source code
 
collect_diagnostic_data(self, start_datetime, end_datetime, includeInfoLog=False)
This method is deprecated as of CM 4.5.
source code
 
collect_diagnostic_data_45(self, end_datetime, bundle_size_bytes, cluster_name=None)
Issue the command to collect diagnostic data.
source code
 
hosts_decommission(self, host_names)
Decommission the specified hosts by decommissioning the slave roles and stopping the remaining ones.
source code
 
hosts_recommission(self, host_names)
Recommission the specified hosts by recommissioning the slave roles.
source code
 
hosts_start_roles(self, host_names)
Start all the roles on the specified hosts.
source code
 
create_peer(self, name, url, username, password)
Create a new peer for replication.
source code
 
delete_peer(self, name)
Delete a replication peer.
source code
 
update_peer(self, current_name, new_name, new_url, username, password)
Update a replication peer.
source code
 
get_peers(self)
Retrieve a list of replication peers.
source code
 
get_peer(self, name)
Retrieve a replication peer by name.
source code
 
test_peer_connectivity(self, name)
Test connectivity for a replication peer.
source code
 
get_all_hosts_config(self, view=None)
Retrieve the default configuration for all hosts.
source code
 
update_all_hosts_config(self, config)
Update the default configuration for all hosts.
source code
 
auto_assign_roles(self)
Automatically assign roles to hosts and create the roles for the Cloudera Management Service.
source code
 
auto_configure(self)
Automatically configures roles of the Cloudera Management Service.
source code
 
host_install(self, user_name, host_names, ssh_port=None, password=None, private_key=None, passphrase=None, parallel_install_count=None, cm_repo_url=None, gpg_key_custom_url=None)
Install Cloudera Manager Agent on a set of hosts.
source code

Inherited from types.BaseApiObject: __setattr__, __str__, to_json_dict

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from types.BaseApiObject: from_json_dict

Inherited from types.BaseApiObject (private): _get_attributes

Static Methods [hide private]

Inherited from types.BaseApiObject: init

Class Variables [hide private]

Inherited from types.BaseApiObject (private): _ATTRIBUTES, _WHITELIST

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, resource_root)
(Constructor)

source code 

Initializes internal state and sets all known writable properties of the object to None. Then initializes the properties given in the provided attributes dictionary.

Parameters:
  • resource_root - API resource object.
  • attrs - optional dictionary of attributes to set. This should only contain r/w attributes.
Overrides: object.__init__
(inherited documentation)

_path(self)

source code 

Returns the path to the resource.

e.g., for a service 'foo' in cluster 'bar', this should return '/clusters/bar/services/foo'.

Overrides: types.BaseApiResource._path
(inherited documentation)

get_commands(self, view=None)

source code 

Retrieve a list of running global commands.

Parameters:
  • view - View to materialize ('full' or 'summary')
Returns:
A list of running commands.

create_mgmt_service(self, service_setup_info)

source code 

Setup the Cloudera Management Service.

Parameters:
  • service_setup_info - ApiServiceSetupInfo object.
Returns:
The management service instance.

delete_mgmt_service(self)

source code 

Delete the Cloudera Management Service.

Returns:
The deleted management service instance.

get_service(self)

source code 

Return the Cloudera Management Services instance.

Returns:
An ApiService instance.

get_license(self)

source code 

Return information about the currently installed license.

Returns:
License information.

update_license(self, license_text)

source code 

Install or update the Cloudera Manager license.

Parameters:
  • license_text - the license in text form

get_config(self, view=None)

source code 

Retrieve the Cloudera Manager configuration.

The 'summary' view contains strings as the dictionary values. The full view contains ApiConfig instances as the values.

Parameters:
  • view - View to materialize ('full' or 'summary')
Returns:
Dictionary with configuration data.

update_config(self, config)

source code 

Update the CM configuration.

Parameters:
  • config - Dictionary with configuration to update.
Returns:
Dictionary with updated configuration.

generate_credentials(self)

source code 

Generate credentials for services configured with Kerberos.

Returns:
Information about the submitted command.

inspect_hosts(self)

source code 

Runs the host inspector on the configured hosts.

Returns:
Information about the submitted command.

collect_diagnostic_data(self, start_datetime, end_datetime, includeInfoLog=False)

source code 

This method is deprecated as of CM 4.5. You should use collect_diagnostic_data_45. Issue the command to collect diagnostic data.

Parameters:
  • start_datetime - The start of the collection period. Type datetime.
  • end_datetime - The end of the collection period. Type datetime.
  • includeInfoLog - Whether to include INFO level log messages.

collect_diagnostic_data_45(self, end_datetime, bundle_size_bytes, cluster_name=None)

source code 

Issue the command to collect diagnostic data.

Parameters:
  • end_datetime - The end of the collection period. Type datetime.
  • bundle_size_bytes - The target size for the support bundle in bytes
  • cluster_name - The cluster to collect or None for all clusters

hosts_decommission(self, host_names)

source code 

Decommission the specified hosts by decommissioning the slave roles and stopping the remaining ones.

Parameters:
  • host_names - List of names of hosts to be decommissioned.
Returns:
Information about the submitted command.

Since: API v2

hosts_recommission(self, host_names)

source code 

Recommission the specified hosts by recommissioning the slave roles. This command doesn't start the roles. Use hosts_start_roles for that.

Parameters:
  • host_names - List of names of hosts to be recommissioned.
Returns:
Information about the submitted command.

Since: API v2

hosts_start_roles(self, host_names)

source code 

Start all the roles on the specified hosts.

Parameters:
  • host_names - List of names of hosts on which to start all roles.
Returns:
Information about the submitted command.

Since: API v2

create_peer(self, name, url, username, password)

source code 

Create a new peer for replication.

Parameters:
  • name - The name of the peer.
  • url - The url of the peer.
  • username - The admin username to use to setup the remote side of the peer connection.
  • password - The password of the admin user.
Returns:
The newly created peer.

Since: API v3

delete_peer(self, name)

source code 

Delete a replication peer.

Parameters:
  • name - The name of the peer.
Returns:
The deleted peer.

Since: API v3

update_peer(self, current_name, new_name, new_url, username, password)

source code 

Update a replication peer.

Parameters:
  • current_name - The name of the peer to updated.
  • new_name - The new name for the peer.
  • new_url - The new url for the peer.
  • username - The admin username to use to setup the remote side of the peer connection.
  • password - The password of the admin user.
Returns:
The updated peer.

Since: API v3

get_peers(self)

source code 

Retrieve a list of replication peers.

Returns:
A list of replication peers.

Since: API v3

get_peer(self, name)

source code 

Retrieve a replication peer by name.

Parameters:
  • name - The name of the peer.
Returns:
The peer.

Since: API v3

test_peer_connectivity(self, name)

source code 

Test connectivity for a replication peer.

Parameters:
  • name - The name of the peer to test.
Returns:
The command representing the test.

Since: API v3

get_all_hosts_config(self, view=None)

source code 

Retrieve the default configuration for all hosts.

Parameters:
  • view - View to materialize.
  • view - View to materialize ('full' or 'summary')
Returns:
Dictionary with configuration data.

update_all_hosts_config(self, config)

source code 

Update the default configuration for all hosts.

Parameters:
  • config - Dictionary with configuration to update.
Returns:
Dictionary with updated configuration.

auto_assign_roles(self)

source code 

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. 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.

Since: API v6

auto_configure(self)

source code 

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.

Since: API v6

host_install(self, user_name, host_names, ssh_port=None, password=None, private_key=None, passphrase=None, parallel_install_count=None, cm_repo_url=None, gpg_key_custom_url=None)

source code 

Install Cloudera Manager Agent on a set of hosts.

Parameters:
  • user_name - The username used to authenticate with the hosts. Root access to your hosts is required to install Cloudera packages. The installer will connect to your hosts via SSH and log in either directly as root or as another user with password-less sudo privileges to become root.
  • host_names - List of names of hosts to configure for use with Cloudera Manager. A host may be specified by a hostname(FQDN) or an IP address.
  • ssh_port - SSH port. If unset, defaults to 22.
  • password - The password used to authenticate with the hosts. Specify either this or a private key. For password-less login, use an empty string as password.
  • private_key - The private key to authenticate with the hosts. Specify either this or a password.
  • passphrase - The passphrase associated with the private key used to authenticate with the hosts (optional).
  • parallel_install_count - Number of simultaneous installations. Defaults to 10. Running a large number of installations at once can consume large amounts of network bandwidth and other system resources.
  • cm_repo_url - The Cloudera Manager repository URL to use (optional). Example for SLES, Redhat or other RPM based distributions: http://archive-primary.cloudera.com/cm5/redhat/6/x86_64/cm/5/ Example for Ubuntu or other Debian based distributions: "deb http://archive.cloudera.com/cm5/ubuntu/lucid/amd64/cm/ lucid-cm5 contrib"
  • gpg_key_custom_url - The Cloudera Manager public GPG key (optional). Example for SLES, Redhat or other RPM based distributions: http://archive-primary.cloudera.com/cm5/redhat/6/x86_64/cm/RPM-GPG-KEY-cloudera Example for Ubuntu or other Debian based distributions: http://archive.cloudera.com/debian/archive.key
Returns:
Information about the submitted command.

Since: API v6