def METHOD_NAME(self):
    # "http://localhost:18443/api/v1/namespaces/namespace-name2"
    # parse url - either /api/v1/namespaces/$ns_name
    # or
    # /api/v1/namespaces/$ns_name/pods/$pod_name
    global is_busy
    comps = self.path.split('/')
    status = 400
    if len(comps) >= 5 and comps[1] == 'api' and comps[2] == 'v1' and comps[3] == 'namespaces':
        resp = None
        hsh = {'namespace_name':comps[4],'objectname':comps[4],'kind':'namespace'}
        if len(comps) == 5: # namespace
            resp_template = ns_template
            status = 200
        elif len(comps) == 7 and comps[5] == 'pods': # pod
            hsh['pod_name'] = comps[6]
            hsh['kind'] = 'pods'
            hsh['objectname'] = hsh['pod_name']
            resp_template = pod_template
            status = 200
        else:
            resp = '{{"error":"do not recognize {0}"}}'.format(self.path)
        if hsh['objectname'].endswith('not-found'):
            status = 404
            hsh['reason'] = 'NotFound'
            hsh['err'] = 'not found'
            resp_template = err_template
        elif hsh['objectname'].endswith('busy'):
            is_busy = not is_busy
            if is_busy:
                status = 429
                hsh['reason'] = 'Busy'
                hsh['err'] = 'server is too busy'
                resp_template = err_template
        elif hsh['objectname'].endswith('error'):
            status = 500
            hsh['reason'] = 'Error'
            hsh['err'] = 'server is failing'
            resp_template = err_template
        if not resp:
            hsh['code'] = status
            resp = resp_template.format(**hsh)
    else:
        resp = '{{"error":"do not recognize {0}"}}'.format(self.path)
    if not status == 200:
        self.log_error(resp)
    self.send_response(status)
    self.end_headers()
    self.wfile.write(json.dumps(json.loads(resp), separators=(',',':')).encode())