def set_configuration_roles(service_name, cluster_name, configuration_file, api_object): for role in get_all_role_config_groups(api_object, service_name, cluster_name): for value in role.get_config(view='full'): if value in configuration_file: role.update_config({value: configuration_file[value]})
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())
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())
def _get_all_role_config_groups(self): return role_config_groups.get_all_role_config_groups( self.cmapi_resource_root, self.cmapi_service.name, self.cluster.name)
cluster = c if cluster: services = cluster.get_all_services() else: print "Couldn't find node in any cluster" exit(1) groups = None if args.service: service = find_service(services, args.service) roles = find_service_roles(service.get_all_roles(), args.role) if args.hostnames: hostnames = get_role_host_names(api, roles) print " ".join(hostnames) else: groups = role_config_groups.get_all_role_config_groups( api, service.name, cluster.name) config, config_group = find_config(groups, args.config_group, args.config) if args.classpath: print "setting classpath" if update_spark_env( config_group, config) and args.restart.strip().lower() == "yes": deploy_config(service, roles) restart_service(service) elif args.set and args.value: print "settting" config_group.update_config({args.config: args.value}) if args.restart.strip().lower() == "yes":
cluster = c if cluster: services = cluster.get_all_services() else: print "Couldn't find node in any cluster" exit(1) groups = None if args.service: service = find_service(services, args.service) roles = find_service_roles(service.get_all_roles(), args.role) if args.hostnames: hostnames = get_role_host_names(api, roles) print " ".join(hostnames) else: groups = role_config_groups.get_all_role_config_groups(api, service.name, cluster.name) config, config_group = find_config(groups, args.config_group, args.config) if args.classpath: print "setting classpath" if update_spark_env(config_group, config) and args.restart.strip().lower() == "yes": deploy_config(service, roles) restart_service(service) elif args.set and args.value: print "settting" config_group.update_config({args.config: args.value}) if args.restart.strip().lower() == "yes": deploy_config(service, roles) restart_service(service) else: