Beispiel #1
0
    def process_get(self, request, vars):
        """

        :param request:
        :param vars:
        :return:
        """
        ret = HaloResponse(HaloRequest(request.path, vars, request.headers))
        response_html = "generation failed. please try again"
        name = None
        headers = {}
        if 'sd_id' in vars:
            sd_id = vars['sd_id']
            if sd_id:
                if 'ver' in vars:
                    ver = vars['ver']
                    if ver:
                        if 'cb' in vars:
                            cb = vars['cb']
                            if cb:
                                #name = self.get_sd_name(sd_id,ver)
                                name = self.get_json_name(sd_id, ver)
                                no_seg = True
                                if cb == 'false':
                                    no_seg = False
                                if 'lite' in vars:
                                    lite = vars['lite']
                                    if lite == 'false':
                                        lite_var = False
                                    else:
                                        lite_var = True
                                #swagger_file_path = self.get_swagger_file_path(name,no_seg)
                                swagger_file_path = self.get_swagger_file_path(
                                    name, ver, lite_var)
                                return send_file(swagger_file_path)
Beispiel #2
0
    def process_get(self, request, vars):
        """

        :param request:
        :param vars:
        :return:
        """
        import prometheus_client
        return Response(prometheus_client.generate_latest(),
                        mimetype=self.CONTENT_TYPE_LATEST)

        ret = HaloResponse(HaloRequest(request))
Beispiel #3
0
    def process_get(self, request, vars):
        """

        :param request:
        :param vars:
        :return:
        """
        ret = HaloResponse(HaloRequest(request))
        content = ""
        for item in settings.BIAN_CONFIG:
            data = settings.BIAN_CONFIG[item]
            line = '"id' + item + '": "' + data[
                'fill'] + '","underline' + item + '":"' + str(
                    data['underline']
                ) + '","url' + item + '":"/' + settings.ENV_NAME + '/detail/' + item + '",'
            content = content + line
        final_str = "{" + content + '"zz":"zz"}'
        the_content = json.loads(final_str)
        #the_content = {
        #    'id': 'zz','underline':'underline','url':'/'+settings.ENV_NAME+'/abc',
        #    'id444': 'green','underline444':'underline','url444':'/'+settings.ENV_NAME+'/abcd'
        #}
        html = render_template("matrix.html", fill=the_content)
        ret.payload = html
        ret.code = 200
        ret.headers = {}
        ret.type = "html"
        return ret
Beispiel #4
0
 def process_get(self, request, vars):
     ret = HaloResponse(HaloRequest(request))
     html = render_template("500.html")
     ret.payload = html
     ret.code = 200
     ret.headers = {}
     ret.type = "html"
     return ret
Beispiel #5
0
    def process_get(self, request, vars):
        """

                :param request:
                :param vars:
                :return:
                """
        ret = HaloResponse(HaloRequest(request))
        html = render_template("trans.html")
        ret.payload = html
        ret.code = 200
        ret.headers = {}
        ret.type = "html"
        return ret
Beispiel #6
0
    def process_get(self, request, vars):
        """

                :param request:
                :param vars:
                :return:
                """
        ret = HaloResponse(HaloRequest(request.path, vars, request.headers))
        option_list = self.get_option_list()
        html = render_template("editor.html", option_list=option_list)
        ret.payload = html
        ret.code = 200
        ret.headers = {}
        ret.type = "html"
        return ret
Beispiel #7
0
 def process_get(self, request, vars):
     ret = HaloResponse(HaloRequest(request))
     sd_id = vars["sd"]
     data = settings.BIAN_CONFIG[sd_id]
     sd = {"sd_name": data["name"]}
     from ..apis import SSM_APP_CONFIG
     print(str(SSM_APP_CONFIG))
     for item in SSM_APP_CONFIG.cache.items:
         if item not in ['DEFAULT']:
             app = SSM_APP_CONFIG.get_param(item)
             app_url = app["url"]
     html = render_template("sd.html", sd=sd)
     ret.payload = html
     ret.code = 200
     ret.headers = {}
     ret.type = "html"
     return ret
Beispiel #8
0
    def process_get(self, request, vars):
        """

        :param request:
        :param vars:
        :return:
        """
        ret = HaloResponse(HaloRequest(request))
        response_html = "generation failed. please try again"
        name = None
        headers = {}
        if 'sd_id' in vars:
            sd_id = vars['sd_id']
            if sd_id:
                if 'ver' in vars:
                    ver = vars['ver']
                    if ver:
                        if 'cb' in vars:
                            cb = vars['cb']
                            if cb:
                                name = self.get_sd_name(sd_id, ver, cb)
                                swagger_file_path = self.get_swagger_file_path(
                                    name)
                                return send_file(swagger_file_path)
Beispiel #9
0
    def process_get(self, request, vars):
        """

        :param request:
        :param vars:
        :return:
        """
        ret = HaloResponse(HaloRequest(request))
        the_content = []
        for item in settings.BIAN_CONFIG:
            data = settings.BIAN_CONFIG[item]
            if data["service_domain"] == True and data["swagger"] == True:
                the_content.append({"id": item, "name": data["name"]})
        html = render_template(
            "index.html",
            sds=the_content,
        )
        ret.payload = html
        ret.code = 200
        ret.headers = {}
        ret.type = "html"
        return ret