_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q36500
get_external_account
train
def get_external_account(resource_root, name, view=None): """ Lookup an external account by name @param resource_root: The root Resource object. @param name: Account name @param view: View @return: An ApiExternalAccount object """ return call(resource_root.get, EXTERNAL_ACCOUNT_FETCH_PATH % ("acco...
python
{ "resource": "" }
q36501
get_external_account_by_display_name
train
def get_external_account_by_display_name(resource_root, display_name, view=None): """ Lookup an external account by display name @param resource_root: The root Resource object. @param display_name: Account display name @param view: View @return: An ApiExternalAccount...
python
{ "resource": "" }
q36502
get_all_external_accounts
train
def get_all_external_accounts(resource_root, type_name, view=None): """ Lookup all external accounts of a particular type, by type name. @param resource_root: The root Resource object. @param type_name: Type name @param view: View @return: An ApiList of ApiExternalAccount objects matching the specified type...
python
{ "resource": "" }
q36503
update_external_account
train
def update_external_account(resource_root, account): """ Update an external account @param resource_root: The root Resource object. @param account: Account to update, account name must be specified. @return: An ApiExternalAccount object, representing the updated external account """ return call(resource_r...
python
{ "resource": "" }
q36504
delete_external_account
train
def delete_external_account(resource_root, name): """ Delete an external account by name @param resource_root: The root Resource object. @param name: Account name @return: The deleted ApiExternalAccount object """ return call(resource_root.delete, EXTERNAL_ACCOUNT_FETCH_PATH % ("delete", name,), ...
python
{ "resource": "" }
q36505
ApiExternalAccount.external_account_cmd_by_name
train
def external_account_cmd_by_name(self, command_name): """ Executes a command on the external account specified by name. @param command_name: The name of the command. @return: Reference to the submitted command. @since: API v16 """ return self._cmd(command_name, data=self.name, api_versi...
python
{ "resource": "" }
q36506
create_dashboards
train
def create_dashboards(resource_root, dashboard_list): """ Creates the list of dashboards. If any of the dashboards already exist this whole command will fail and no dashboards will be created. @since: API v6 @return: The list of dashboards created. """ return call(resource_root.post, DASHBOARDS_PATH, ApiD...
python
{ "resource": "" }
q36507
create_cluster
train
def create_cluster(resource_root, name, version=None, fullVersion=None): """ Create a cluster @param resource_root: The root Resource object. @param name: Cluster name @param version: Cluster CDH major version (eg: "CDH4") - The CDH minor version will be assumed to be the ...
python
{ "resource": "" }
q36508
get_all_clusters
train
def get_all_clusters(resource_root, view=None): """ Get all clusters @param resource_root: The root Resource object. @return: A list of ApiCluster objects. """ return call(resource_root.get, CLUSTERS_PATH, ApiCluster, True, params=view and dict(view=view) or None)
python
{ "resource": "" }
q36509
ApiCluster._put_cluster
train
def _put_cluster(self, dic, params=None): """Change cluster attributes""" cluster = self._put('', ApiCluster, data=dic, params=params) self._update(cluster) return self
python
{ "resource": "" }
q36510
ApiCluster.get_service_types
train
def get_service_types(self): """ Get all service types supported by this cluster. @return: A list of service types (strings) """ resp = self._get_resource_root().get(self._path() + '/serviceTypes') return resp[ApiList.LIST_KEY]
python
{ "resource": "" }
q36511
ApiCluster.rename
train
def rename(self, newname): """ Rename a cluster. @param newname: New cluster name @return: An ApiCluster object @since: API v2 """ dic = self.to_json_dict() if self._get_resource_root().version < 6: dic['name'] = newname else: dic['displayName'] = newname return self...
python
{ "resource": "" }
q36512
ApiCluster.update_cdh_version
train
def update_cdh_version(self, new_cdh_version): """ Manually set the CDH version. @param new_cdh_version: New CDH version, e.g. 4.5.1 @return: An ApiCluster object @since: API v6 """ dic = self.to_json_dict() dic['fullVersion'] = new_cdh_version return self._put_cluster(dic)
python
{ "resource": "" }
q36513
ApiCluster.delete_service
train
def delete_service(self, name): """ Delete a service by name. @param name: Service name @return: The deleted ApiService object """ return services.delete_service(self._get_resource_root(), name, self.name)
python
{ "resource": "" }
q36514
ApiCluster.get_service
train
def get_service(self, name): """ Lookup a service by name. @param name: Service name @return: An ApiService object """ return services.get_service(self._get_resource_root(), name, self.name)
python
{ "resource": "" }
q36515
ApiCluster.get_all_services
train
def get_all_services(self, view = None): """ Get all services in this cluster. @return: A list of ApiService objects. """ return services.get_all_services(self._get_resource_root(), self.name, view)
python
{ "resource": "" }
q36516
ApiCluster.get_parcel
train
def get_parcel(self, product, version): """ Lookup a parcel by product and version. @param product: the product name @param version: the product version @return: An ApiParcel object """ return parcels.get_parcel(self._get_resource_root(), product, version, self.name)
python
{ "resource": "" }
q36517
ApiCluster.get_all_parcels
train
def get_all_parcels(self, view = None): """ Get all parcels in this cluster. @return: A list of ApiParcel objects. """ return parcels.get_all_parcels(self._get_resource_root(), self.name, view)
python
{ "resource": "" }
q36518
ApiCluster.add_hosts
train
def add_hosts(self, hostIds): """ Adds a host to the cluster. @param hostIds: List of IDs of hosts to add to cluster. @return: A list of ApiHostRef objects of the new hosts that were added to the cluster @since: API v3 """ hostRefList = [ApiHostRef(self._get_resource_root(), x)...
python
{ "resource": "" }
q36519
ApiCluster.restart
train
def restart(self, restart_only_stale_services=None, redeploy_client_configuration=None, restart_service_names=None): """ Restart all services in the cluster. Services are restarted in the appropriate order given their dependencies. @param restart_only_stale_services: Only restart services that ...
python
{ "resource": "" }
q36520
ApiCluster.enter_maintenance_mode
train
def enter_maintenance_mode(self): """ Put the cluster in maintenance mode. @return: Reference to the completed command. @since: API v2 """ cmd = self._cmd('enterMaintenanceMode') if cmd.success: self._update(get_cluster(self._get_resource_root(), self.name)) return cmd
python
{ "resource": "" }
q36521
ApiCluster.get_host_template
train
def get_host_template(self, name): """ Retrieves a host templates by name. @param name: Host template name. @return: An ApiHostTemplate object. """ return host_templates.get_host_template(self._get_resource_root(), name, self.name)
python
{ "resource": "" }
q36522
ApiCluster.create_host_template
train
def create_host_template(self, name): """ Creates a host template. @param name: Name of the host template to create. @return: An ApiHostTemplate object. """ return host_templates.create_host_template(self._get_resource_root(), name, self.name)
python
{ "resource": "" }
q36523
ApiCluster.delete_host_template
train
def delete_host_template(self, name): """ Deletes a host template. @param name: Name of the host template to delete. @return: An ApiHostTemplate object. """ return host_templates.delete_host_template(self._get_resource_root(), name, self.name)
python
{ "resource": "" }
q36524
ApiCluster.rolling_restart
train
def rolling_restart(self, slave_batch_size=None, slave_fail_count_threshold=None, sleep_seconds=None, stale_configs_only=None, unupgraded_only=None, roles_to_include=None, restart_service_...
python
{ "resource": "" }
q36525
ApiCluster.rolling_upgrade
train
def rolling_upgrade(self, upgrade_from_cdh_version, upgrade_to_cdh_version, upgrade_service_names, slave_batch_size=None, slave_fail_count_threshold=None, sleep_seconds=None): """ Command to do a rollin...
python
{ "resource": "" }
q36526
ApiCluster.configure_for_kerberos
train
def configure_for_kerberos(self, datanode_transceiver_port=None, datanode_web_port=None): """ Command to configure the cluster to use Kerberos for authentication. This command will configure all relevant services on a cluster for Kerberos usage. This command will trigger a GenerateCredentials comm...
python
{ "resource": "" }
q36527
ApiCluster.export
train
def export(self, export_auto_config=False): """ Export the cluster template for the given cluster. ccluster must have host templates defined. It cluster does not have host templates defined it will export host templates based on roles assignment. @param export_auto_config: Also export auto configur...
python
{ "resource": "" }
q36528
check_api_version
train
def check_api_version(resource_root, min_version): """ Checks if the resource_root's API version it at least the given minimum version. """ if resource_root.version < min_version: raise Exception("API version %s is required but %s is in use." % (min_version, resource_root.version))
python
{ "resource": "" }
q36529
call
train
def call(method, path, ret_type, ret_is_list=False, data=None, params=None, api_version=1): """ Generic function for calling a resource method and automatically dealing with serialization of parameters and deserialization of return values. @param method: method to call (must be bound to a resource; ...
python
{ "resource": "" }
q36530
config_to_api_list
train
def config_to_api_list(dic): """ Converts a python dictionary into a list containing the proper ApiConfig encoding for configuration data. @param dic: Key-value pairs to convert. @return: JSON dictionary of an ApiConfig list (*not* an ApiList). """ config = [ ] for k, v in dic.iteritems(): config.a...
python
{ "resource": "" }
q36531
json_to_config
train
def json_to_config(dic, full = False): """ Converts a JSON-decoded config dictionary to a python dictionary. When materializing the full view, the values in the dictionary will be instances of ApiConfig, instead of strings. @param dic: JSON-decoded config dictionary. @param full: Whether to materialize th...
python
{ "resource": "" }
q36532
Attr.to_json
train
def to_json(self, value, preserve_ro): """ Returns the JSON encoding of the given attribute value. If the value has a 'to_json_dict' object, that method is called. Otherwise, the following values are returned for each input type: - datetime.datetime: string with the API representation of a date. ...
python
{ "resource": "" }
q36533
Attr.from_json
train
def from_json(self, resource_root, data): """ Parses the given JSON value into an appropriate python object. This means: - a datetime.datetime if 'atype' is datetime.datetime - a converted config dictionary or config list if 'atype' is ApiConfig - if the attr is an API list, an ApiList with ...
python
{ "resource": "" }
q36534
BaseApiObject._update
train
def _update(self, api_obj): """Copy state from api_obj to this object.""" if not isinstance(self, api_obj.__class__): raise ValueError( "Class %s does not derive from %s; cannot update attributes." % (self.__class__, api_obj.__class__)) for name in self._get_attributes().keys(): ...
python
{ "resource": "" }
q36535
BaseApiResource._require_min_api_version
train
def _require_min_api_version(self, version): """ Raise an exception if the version of the api is less than the given version. @param version: The minimum required version. """ actual_version = self._get_resource_root().version version = max(version, self._api_version()) if actual_version < ...
python
{ "resource": "" }
q36536
BaseApiResource._get_config
train
def _get_config(self, rel_path, view, api_version=1): """ Retrieves an ApiConfig list from the given relative path. """ self._require_min_api_version(api_version) params = view and dict(view=view) or None resp = self._get_resource_root().get(self._path() + '/' + rel_path, params=params) ...
python
{ "resource": "" }
q36537
ApiCommand.fetch
train
def fetch(self): """ Retrieve updated data about the command from the server. @return: A new ApiCommand object. """ if self.id == ApiCommand.SYNCHRONOUS_COMMAND_ID: return self resp = self._get_resource_root().get(self._path()) return ApiCommand.from_json_dict(resp, self._get_resourc...
python
{ "resource": "" }
q36538
ApiCommand.wait
train
def wait(self, timeout=None): """ Wait for command to finish. @param timeout: (Optional) Max amount of time (in seconds) to wait. Wait forever by default. @return: The final ApiCommand object, containing the last known state. The command may still be running in case of ...
python
{ "resource": "" }
q36539
ApiCommand.abort
train
def abort(self): """ Abort a running command. @return: A new ApiCommand object with the updated information. """ if self.id == ApiCommand.SYNCHRONOUS_COMMAND_ID: return self path = self._path() + '/abort' resp = self._get_resource_root().post(path) return ApiCommand.from_json_dic...
python
{ "resource": "" }
q36540
ApiCommand.retry
train
def retry(self): """ Retry a failed or aborted command. @return: A new ApiCommand object with the updated information. """ path = self._path() + '/retry' resp = self._get_resource_root().post(path) return ApiCommand.from_json_dict(resp, self._get_resource_root())
python
{ "resource": "" }
q36541
create_role_config_groups
train
def create_role_config_groups(resource_root, service_name, apigroup_list, cluster_name="default"): """ Create role config groups. @param resource_root: The root Resource object. @param service_name: Service name. @param apigroup_list: List of role config groups to create. @param cluster_name: Cluster na...
python
{ "resource": "" }
q36542
get_role_config_group
train
def get_role_config_group(resource_root, service_name, name, cluster_name="default"): """ Find a role config group by name. @param resource_root: The root Resource object. @param service_name: Service name. @param name: Role config group name. @param cluster_name: Cluster name. @return: An ApiRoleConf...
python
{ "resource": "" }
q36543
get_all_role_config_groups
train
def get_all_role_config_groups(resource_root, service_name, cluster_name="default"): """ Get all role config groups in the specified service. @param resource_root: The root Resource object. @param service_name: Service name. @param cluster_name: Cluster name. @return: A list of ApiRoleConfigGroup object...
python
{ "resource": "" }
q36544
update_role_config_group
train
def update_role_config_group(resource_root, service_name, name, apigroup, cluster_name="default"): """ Update a role config group by name. @param resource_root: The root Resource object. @param service_name: Service name. @param name: Role config group name. @param apigroup: The updated role config grou...
python
{ "resource": "" }
q36545
move_roles
train
def move_roles(resource_root, service_name, name, role_names, cluster_name="default"): """ Moves roles to the specified role config group. The roles can be moved from any role config group belonging to the same service. The role type of the destination group must match the role type of the roles. @par...
python
{ "resource": "" }
q36546
move_roles_to_base_role_config_group
train
def move_roles_to_base_role_config_group(resource_root, service_name, role_names, cluster_name="default"): """ Moves roles to the base role config group. The roles can be moved from any role config group belonging to the same service. The role type of the roles may vary. Each role will be moved to its c...
python
{ "resource": "" }
q36547
ApiRoleConfigGroup.update_config
train
def update_config(self, config): """ Update the group's configuration. @param config: Dictionary with configuration to update. @return: Dictionary with updated configuration. """ path = self._path() + '/config' resp = self._get_resource_root().put(path, data = config_to_json(config)) re...
python
{ "resource": "" }
q36548
ApiRoleConfigGroup.move_roles
train
def move_roles(self, roles): """ Moves roles to this role config group. The roles can be moved from any role config group belonging to the same service. The role type of the destination group must match the role type of the roles. @param roles: The names of the roles to move. @return: List...
python
{ "resource": "" }
q36549
get_role
train
def get_role(resource_root, service_name, name, cluster_name="default"): """ Lookup a role by name @param resource_root: The root Resource object. @param service_name: Service name @param name: Role name @param cluster_name: Cluster name @return: An ApiRole object """ return _get_role(resource_root, _...
python
{ "resource": "" }
q36550
get_all_roles
train
def get_all_roles(resource_root, service_name, cluster_name="default", view=None): """ Get all roles @param resource_root: The root Resource object. @param service_name: Service name @param cluster_name: Cluster name @return: A list of ApiRole objects. """ return call(resource_root.get, _get_roles...
python
{ "resource": "" }
q36551
get_roles_by_type
train
def get_roles_by_type(resource_root, service_name, role_type, cluster_name="default", view=None): """ Get all roles of a certain type in a service @param resource_root: The root Resource object. @param service_name: Service name @param role_type: Role type @param cluster_name: Cluster ...
python
{ "resource": "" }
q36552
delete_role
train
def delete_role(resource_root, service_name, name, cluster_name="default"): """ Delete a role by name @param resource_root: The root Resource object. @param service_name: Service name @param name: Role name @param cluster_name: Cluster name @return: The deleted ApiRole object """ return call(resource_...
python
{ "resource": "" }
q36553
get_all_users
train
def get_all_users(resource_root, view=None): """ Get all users. @param resource_root: The root Resource object @param view: View to materialize ('full' or 'summary'). @return: A list of ApiUser objects. """ return call(resource_root.get, USERS_PATH, ApiUser, True, params=view and dict(view=view) or...
python
{ "resource": "" }
q36554
ApiUser.grant_admin_role
train
def grant_admin_role(self): """ Grant admin access to a user. If the user already has admin access, this does nothing. If the user currently has a non-admin role, it will be replaced with the admin role. @return: An ApiUser object """ apiuser = ApiUser(self._get_resource_root(), self.name, ...
python
{ "resource": "" }
q36555
do_batch
train
def do_batch(resource_root, elements): """ Execute a batch request with one or more elements. If any element fails, the entire request is rolled back and subsequent elements are ignored. @param elements: A list of ApiBatchRequestElements @return: an ApiBatchResponseList @since: API v6 """ return call(r...
python
{ "resource": "" }
q36556
get_all_services
train
def get_all_services(resource_root, cluster_name="default", view=None): """ Get all services @param resource_root: The root Resource object. @param cluster_name: Cluster name @return: A list of ApiService objects. """ return call(resource_root.get, SERVICES_PATH % (cluster_name,), ApiService, ...
python
{ "resource": "" }
q36557
delete_service
train
def delete_service(resource_root, name, cluster_name="default"): """ Delete a service by name @param resource_root: The root Resource object. @param name: Service name @param cluster_name: Cluster name @return: The deleted ApiService object """ return call(resource_root.delete, "%s/%s" % (SERVICES...
python
{ "resource": "" }
q36558
ApiService._parse_svc_config
train
def _parse_svc_config(self, json_dic, view = None): """ Parse a json-decoded ApiServiceConfig dictionary into a 2-tuple. @param json_dic: The json dictionary with the config data. @param view: View to materialize. @return: 2-tuple (service config dictionary, role type configurations) """ sv...
python
{ "resource": "" }
q36559
ApiService.add_watched_directory
train
def add_watched_directory(self, dir_path): """ Adds a directory to the watching list. @param dir_path: The path of the directory to be added to the watching list @return: The added directory, or null if failed @since: API v14 """ req = ApiWatchedDir(self._get_resource_root(), path=dir_path)...
python
{ "resource": "" }
q36560
ApiService.get_impala_queries
train
def get_impala_queries(self, start_time, end_time, filter_str="", limit=100, offset=0): """ Returns a list of queries that satisfy the filter @type start_time: datetime.datetime. Note that the datetime must either be time zone aware or specified in the server time zone. See ...
python
{ "resource": "" }
q36561
ApiService.get_query_details
train
def get_query_details(self, query_id, format='text'): """ Get the query details @param query_id: The query ID @param format: The format of the response ('text' or 'thrift_encoded') @return: The details text @since: API v4 """ return self._get("impalaQueries/" + query_id, ApiImpalaQueryD...
python
{ "resource": "" }
q36562
ApiService.enable_llama_rm
train
def enable_llama_rm(self, llama1_host_id, llama1_role_name=None, llama2_host_id=None, llama2_role_name=None, zk_service_name=None, skip_restart=False): """ Enable Llama-based resource management for Impala. This command only applies to CDH 5.1+ Impala services. ...
python
{ "resource": "" }
q36563
ApiService.enable_llama_ha
train
def enable_llama_ha(self, new_llama_host_id, zk_service_name=None, new_llama_role_name=None): """ Enable high availability for an Impala Llama ApplicationMaster. This command only applies to CDH 5.1+ Impala services. @param new_llama_host_id: id of the host where the second Llama...
python
{ "resource": "" }
q36564
ApiService.get_yarn_applications
train
def get_yarn_applications(self, start_time, end_time, filter_str="", limit=100, offset=0): """ Returns a list of YARN applications that satisfy the filter @type start_time: datetime.datetime. Note that the datetime must either be time zone aware or specified in the server time zo...
python
{ "resource": "" }
q36565
ApiService.create_yarn_application_diagnostics_bundle
train
def create_yarn_application_diagnostics_bundle(self, application_ids, ticket_number=None, comments=None): """ Collects the Diagnostics data for Yarn applications. @param application_ids: An array of strings containing the ids of the yarn applications. @param ticket_number: I...
python
{ "resource": "" }
q36566
ApiService.get_config
train
def get_config(self, view = None): """ Retrieve the service's configuration. Retrieves both the service configuration and role type configuration for each of the service's supported role types. The role type configurations are returned as a dictionary, whose keys are the role type name, and val...
python
{ "resource": "" }
q36567
ApiService.update_config
train
def update_config(self, svc_config, **rt_configs): """ Update the service's configuration. @param svc_config: Dictionary with service configuration to update. @param rt_configs: Dict of role type configurations to update. @return: 2-tuple (service config dictionary, role type configurations) ""...
python
{ "resource": "" }
q36568
ApiService.create_role
train
def create_role(self, role_name, role_type, host_id): """ Create a role. @param role_name: Role name @param role_type: Role type @param host_id: ID of the host to assign the role to @return: An ApiRole object """ return roles.create_role(self._get_resource_root(), self.name, role_type, ...
python
{ "resource": "" }
q36569
ApiService.delete_role
train
def delete_role(self, name): """ Delete a role by name. @param name: Role name @return: The deleted ApiRole object """ return roles.delete_role(self._get_resource_root(), self.name, name, self._get_cluster_name())
python
{ "resource": "" }
q36570
ApiService.get_role
train
def get_role(self, name): """ Lookup a role by name. @param name: Role name @return: An ApiRole object """ return roles.get_role(self._get_resource_root(), self.name, name, self._get_cluster_name())
python
{ "resource": "" }
q36571
ApiService.get_all_roles
train
def get_all_roles(self, view = None): """ Get all roles in the service. @param view: View to materialize ('full' or 'summary') @return: A list of ApiRole objects. """ return roles.get_all_roles(self._get_resource_root(), self.name, self._get_cluster_name(), view)
python
{ "resource": "" }
q36572
ApiService.get_roles_by_type
train
def get_roles_by_type(self, role_type, view = None): """ Get all roles of a certain type in a service. @param role_type: Role type @param view: View to materialize ('full' or 'summary') @return: A list of ApiRole objects. """ return roles.get_roles_by_type(self._get_resource_root(), self.na...
python
{ "resource": "" }
q36573
ApiService.get_role_types
train
def get_role_types(self): """ Get a list of role types in a service. @return: A list of role types (strings) """ resp = self._get_resource_root().get(self._path() + '/roleTypes') return resp[ApiList.LIST_KEY]
python
{ "resource": "" }
q36574
ApiService.get_all_role_config_groups
train
def get_all_role_config_groups(self): """ Get a list of role configuration groups in the service. @return: A list of ApiRoleConfigGroup objects. @since: API v3 """ return role_config_groups.get_all_role_config_groups( self._get_resource_root(), self.name, self._get_cluster_name())
python
{ "resource": "" }
q36575
ApiService.get_role_config_group
train
def get_role_config_group(self, name): """ Get a role configuration group in the service by name. @param name: The name of the role config group. @return: An ApiRoleConfigGroup object. @since: API v3 """ return role_config_groups.get_role_config_group( self._get_resource_root(), sel...
python
{ "resource": "" }
q36576
ApiService.update_role_config_group
train
def update_role_config_group(self, name, apigroup): """ Update a role config group. @param name: Role config group name. @param apigroup: The updated role config group. @return: The updated ApiRoleConfigGroup object. @since: API v3 """ return role_config_groups.update_role_config_group(...
python
{ "resource": "" }
q36577
ApiService.disable_hdfs_ha
train
def disable_hdfs_ha(self, active_name, secondary_name, start_dependent_services=True, deploy_client_configs=True, disable_quorum_storage=False): """ Disable high availability for an HDFS NameNode. This command is no longer supported with API v6 onwards. Use disable_nn_ha instead....
python
{ "resource": "" }
q36578
ApiService.enable_hdfs_auto_failover
train
def enable_hdfs_auto_failover(self, nameservice, active_fc_name, standby_fc_name, zk_service): """ Enable auto-failover for an HDFS nameservice. This command is no longer supported with API v6 onwards. Use enable_nn_ha instead. @param nameservice: Nameservice for which to enable auto-failover. ...
python
{ "resource": "" }
q36579
ApiService.enable_hdfs_ha
train
def enable_hdfs_ha(self, active_name, active_shared_path, standby_name, standby_shared_path, nameservice, start_dependent_services=True, deploy_client_configs=True, enable_quorum_storage=False): """ Enable high availability for an HDFS NameNode. This command is no longer supported with API v6 on...
python
{ "resource": "" }
q36580
ApiService.disable_nn_ha
train
def disable_nn_ha(self, active_name, snn_host_id, snn_check_point_dir_list, snn_name=None): """ Disable high availability with automatic failover for an HDFS NameNode. @param active_name: Name of the NamdeNode role that is going to be active after High Availability is disabled...
python
{ "resource": "" }
q36581
ApiService.enable_jt_ha
train
def enable_jt_ha(self, new_jt_host_id, force_init_znode=True, zk_service_name=None, new_jt_name=None, fc1_name=None, fc2_name=None): """ Enable high availability for a MR JobTracker. @param zk_service_name: Name of the ZooKeeper service to use for auto-failover. If MapReduce service depend...
python
{ "resource": "" }
q36582
ApiService.disable_jt_ha
train
def disable_jt_ha(self, active_name): """ Disable high availability for a MR JobTracker active-standby pair. @param active_name: name of the JobTracker that will be active after the disable operation. The other JobTracker and Failover Controllers will be remo...
python
{ "resource": "" }
q36583
ApiService.enable_rm_ha
train
def enable_rm_ha(self, new_rm_host_id, zk_service_name=None): """ Enable high availability for a YARN ResourceManager. @param new_rm_host_id: id of the host where the second ResourceManager will be added. @param zk_service_name: Name of the ZooKeeper service to use for auto-f...
python
{ "resource": "" }
q36584
ApiService.disable_rm_ha
train
def disable_rm_ha(self, active_name): """ Disable high availability for a YARN ResourceManager active-standby pair. @param active_name: name of the ResourceManager that will be active after the disable operation. The other ResourceManager will be removed. ...
python
{ "resource": "" }
q36585
ApiService.enable_oozie_ha
train
def enable_oozie_ha(self, new_oozie_server_host_ids, new_oozie_server_role_names=None, zk_service_name=None, load_balancer_host_port=None): """ Enable high availability for Oozie. @param new_oozie_server_host_ids: List of IDs of the hosts on which new Oozie Servers ...
python
{ "resource": "" }
q36586
ApiService.disable_oozie_ha
train
def disable_oozie_ha(self, active_name): """ Disable high availability for Oozie @param active_name: Name of the Oozie Server that will be active after High Availability is disabled. @return: Reference to the submitted command. @since: API v6 """ args = dict( a...
python
{ "resource": "" }
q36587
ApiService.failover_hdfs
train
def failover_hdfs(self, active_name, standby_name, force=False): """ Initiate a failover of an HDFS NameNode HA pair. This will make the given stand-by NameNode active, and vice-versa. @param active_name: name of currently active NameNode. @param standby_name: name of NameNode currently in stand-b...
python
{ "resource": "" }
q36588
ApiService.roll_edits_hdfs
train
def roll_edits_hdfs(self, nameservice=None): """ Roll the edits of an HDFS NameNode or Nameservice. @param nameservice: Nameservice whose edits should be rolled. Required only with a federated HDFS. @return: Reference to the submitted command. @since: API v3 """ args...
python
{ "resource": "" }
q36589
ApiService.sync_hue_db
train
def sync_hue_db(self, *servers): """ Synchronize the Hue server's database. @param servers: Name of Hue Server roles to synchronize. Not required starting with API v10. @return: List of submitted commands. """ actual_version = self._get_resource_root().version if actual_version < 10: ...
python
{ "resource": "" }
q36590
ApiService.enter_maintenance_mode
train
def enter_maintenance_mode(self): """ Put the service in maintenance mode. @return: Reference to the completed command. @since: API v2 """ cmd = self._cmd('enterMaintenanceMode') if cmd.success: self._update(_get_service(self._get_resource_root(), self._path())) return cmd
python
{ "resource": "" }
q36591
ApiService.create_replication_schedule
train
def create_replication_schedule(self, start_time, end_time, interval_unit, interval, paused, arguments, alert_on_start=False, alert_on_success=False, alert_on_fail=False, alert_on_abort=False): """ Create a new replication schedule for this service. The replication argument type varies pe...
python
{ "resource": "" }
q36592
ApiService.update_replication_schedule
train
def update_replication_schedule(self, schedule_id, schedule): """ Update a replication schedule. @param schedule_id: The id of the schedule to update. @param schedule: The modified schedule. @return: The updated replication schedule. @since: API v3 """ return self._put("replications/%s"...
python
{ "resource": "" }
q36593
ApiService.get_replication_command_history
train
def get_replication_command_history(self, schedule_id, limit=20, offset=0, view=None): """ Retrieve a list of commands for a replication schedule. @param schedule_id: The id of the replication schedule. @param limit: Maximum number of commands to retrieve. @par...
python
{ "resource": "" }
q36594
ApiService.trigger_replication_schedule
train
def trigger_replication_schedule(self, schedule_id, dry_run=False): """ Trigger replication immediately. Start and end dates on the schedule will be ignored. @param schedule_id: The id of the schedule to trigger. @param dry_run: Whether to execute a dry run. @return: The command corresponding t...
python
{ "resource": "" }
q36595
ApiService.get_snapshot_policies
train
def get_snapshot_policies(self, view=None): """ Retrieve a list of snapshot policies. @param view: View to materialize. Valid values are 'full', 'summary', 'export', 'export_redacted'. @return: A list of snapshot policies. @since: API v6 """ return self._get("snapshots/policies", ApiSnapsho...
python
{ "resource": "" }
q36596
ApiService.get_snapshot_policy
train
def get_snapshot_policy(self, name, view=None): """ Retrieve a single snapshot policy. @param name: The name of the snapshot policy to retrieve. @param view: View to materialize. Valid values are 'full', 'summary', 'export', 'export_redacted'. @return: The requested snapshot policy. @since: API...
python
{ "resource": "" }
q36597
ApiService.update_snapshot_policy
train
def update_snapshot_policy(self, name, policy): """ Update a snapshot policy. @param name: The name of the snapshot policy to update. @param policy: The modified snapshot policy. @return: The updated snapshot policy. @since: API v6 """ return self._put("snapshots/policies/%s" % name, Ap...
python
{ "resource": "" }
q36598
ApiService.get_snapshot_command_history
train
def get_snapshot_command_history(self, name, limit=20, offset=0, view=None): """ Retrieve a list of commands triggered by a snapshot policy. @param name: The name of the snapshot policy. @param limit: Maximum number of commands to retrieve. @param offset: Index of first command to retrieve. @pa...
python
{ "resource": "" }
q36599
ApiServiceSetupInfo.set_config
train
def set_config(self, config): """ Set the service configuration. @param config: A dictionary of config key/value """ if self.config is None: self.config = { } self.config.update(config_to_api_list(config))
python
{ "resource": "" }