예제 #1
0
파일: Common.py 프로젝트: momo050200/Qos
def delete_speeding_tencent(self, speed_id, head, req_id=None, results=None):
    if req_id == None:
        req_id = IniReader(file_path).get_value('url',
                                                'delete_speeding_tencent')
    url = base_url + req_id + speed_id
    result = C.delete(self, url, headers=head, results=results)
    return result
예제 #2
0
파일: Common.py 프로젝트: momo050200/Qos
def remove_product(self, product_key, results=None):
    remove_product = IniReader(file_path).get_value('url', 'remove_product')
    url = base_url + remove_product
    body = {
        'key': product_key,
    }
    result = C.post(self, url, data=body, results=results)
    return result
예제 #3
0
파일: Common.py 프로젝트: momo050200/Qos
def speeding(self, head, security_token, dst_info=None, results=None):
    speeding_xunyou = IniReader(file_path).get_value('url', 'speeding_xunyou')
    url = base_url + speeding_xunyou
    body = eval(IniReader(file_path).get_value('speeding_xunyou_body', 'body'))
    body["security_token"] = security_token
    if dst_info != None:
        body["dst_info"] = dst_info
    result = C.post(self, url, data=body, headers=head, results=results)
    return result
예제 #4
0
파일: Common.py 프로젝트: momo050200/Qos
def get_token(self, head, req_id=None, results=None):
    global file_path, base_url
    file_path = '.\common\cfginfo.ini'
    base_url = IniReader(file_path).get_value('url', 'base_url')
    if req_id == None:
        req_id = IniReader(file_path).get_value('url', 'get_token')
    url = base_url + req_id
    result = C.get(self, url, data=None, headers=head, results=results)
    return result
예제 #5
0
파일: Common.py 프로젝트: momo050200/Qos
def add_product(self,
                results=None,
                node_ip_port=None,
                remote_ip_port=None,
                remote_hostname=None):
    add_product = IniReader(file_path).get_value('url', 'add_product')
    url = base_url + add_product
    body = eval(IniReader(file_path).get_value('add_product_body', 'body'))
    if node_ip_port != None:
        body["node_ip_port"] = node_ip_port
    if remote_ip_port != None:
        body["remote_ip_port"] = remote_ip_port
    if remote_hostname != None:
        body["remote_hostname"] = remote_hostname
    result = C.post(self, url, data=body, results=results)
    return result
예제 #6
0
파일: Common.py 프로젝트: momo050200/Qos
def speeding_tencent(
    self,
    head,
    security_token,
    results=None,
    dst_info_ip=None,
):
    speeding_tencent = IniReader(file_path).get_value('url',
                                                      'speeding_tencent')
    url = base_url + speeding_tencent
    body = eval(
        IniReader(file_path).get_value('speeding_tencent_body', 'body'))
    body["security_token"] = security_token
    if dst_info_ip != None:
        body["ResourceFeatureProperties"][0]["FlowProperties"][0][
            "DestinationIpAdress"] = dst_info_ip
    body = json.dumps(body)
    result = C.post(self, url, data=body, headers=head, results=results)
    return result
예제 #7
0
파일: Common.py 프로젝트: momo050200/Qos
def check_tencent(self, speed_id, head, results=None):
    check = IniReader(file_path).get_value('url', 'check_tencent')
    url = base_url + check + speed_id
    result = C.get(self, url, headers=head, results=results)
    return result