Ejemplo n.º 1
0
    def submit_app(self,
                   filename,
                   app_name,
                   gearpump_app_config=None,
                   force=False):
        print "Gearpump rule engine config"
        print str(gearpump_app_config)

        self.gearpump_app_config = util.json_dict_to_string(
            gearpump_app_config).replace(" ", "")

        if self.gearpump_credentials is not None:
            self.__get_gearpump_user_cookies()

        if force:
            try:
                self.__kill_app(self.__find_active_app_id_by_name(app_name))
            except URLError as e:
                print e.errno
                print app_name + " was not running"
            else:
                print app_name + " was running and got killed"

        response = self.__submit_app_jar(filename=filename)

        print 'Gearpump response:'
        print response.text
Ejemplo n.º 2
0
    def submit_app(self, filename, app_name, flink_app_config=None, force=False):
        print "Flink rule engine config"
        print str(flink_app_config)

        self.flink_app_config = util.json_dict_to_string(flink_app_config).replace(" ", "")

        response = self.__submit_app_jar(filename=filename)
        
        print 'Flink response: ' + response;
    def get_token_for_rule_engine_from_dashboard(self, username, password):

        payload = {
            "username": username,
            "password": password
        }

        content_type = {'Content-Type': 'application/json'}

        string_json = util.json_dict_to_string(payload)

        url = self.dashboard_url + "/" + DashboardApiConfig.dashboard_call_auth_token

        response = requests.request('POST', url, data=string_json, headers=content_type, verify=False)

        return self.__parse_token_from_reponse(response)
    def get_token_for_rule_engine_from_dashboard(self, username, password):

        payload = {
            "username": username,
            "password": password
        }

        content_type = {'Content-Type': 'application/json'}

        string_json = util.json_dict_to_string(payload)

        url = self.dashboard_url + "/" + DashboardApiConfig.dashboard_call_auth_token

        response = requests.request('POST', url, data=string_json, headers=content_type, verify=False)

        return self.__parse_token_from_reponse(response)
    def submit_app(self, filename, app_name, gearpump_app_config=None, force=False):
        print "Gearpump rule engine config - " + str(gearpump_app_config)
        self.gearpump_app_config = util.json_dict_to_string(gearpump_app_config).replace(" ", "")

        if self.gearpump_credentials is not None:
            self.__get_gearpump_user_cookies()

        if force:
            try:
                self.__kill_app(self.__find_active_app_id_by_name(app_name))
            except URLError as e:
                print e.errno
                print app_name + " was not running"
            else:
                print app_name + " was running and got killed"

        self.__submit_app_jar(filename=filename)

        print 'OK'
Ejemplo n.º 6
0
 def __encode_flink_app_config(self, flink_app_config):
     return urllib.quote(util.json_dict_to_string(flink_app_config).replace(" ", ""))
Ejemplo n.º 7
0
 def __encode_gearpump_app_config(self, gearpump_app_config):
     return urllib.quote(
         util.json_dict_to_string(gearpump_app_config).replace(" ", ""))
 def __encode_gearpump_app_config(self, gearpump_app_config):
     return urllib.quote(util.json_dict_to_string(gearpump_app_config).replace(" ", ""))