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
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
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
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