def examine_details(self): api_url = HOST + "/api/LocationStatic/ExamineDetail" header = { 'content-type': CONTENT_TYPE, 'Authorization': TOKEN, 'userinfo': REGINFO } from register.proto_pb.OrderSearchRequestPb_pb2 import OrderSearchRequestPb body = OrderSearchRequestPb() body.regStartDate = within3days().split("|")[0] # 三天前 body.regEndDate = within3days().split("|")[-1] # 今天23点 body.observationLocationID = PROCINFO['observationLocationID'] # 检查机房 # body.resultStatus = 0 body.currentPage = 1 body.pageSize = 10 body = body.SerializeToString() res = self.client.request(method='POST', path=api_url, data=body, headers=header, name='s机房统计详情') # from register.proto_pb.PageResponsePb_pb2 import PageResponsePb # data = PageResponsePb() # data.ParseFromString(res.content) # from google.protobuf.json_format import MessageToJson # from register.proto_pb.OrderResponsePb_pb2 import OrderResponsePb # res_json = MessageToJson(data) # print(res.status_code) # print(res_json.encode('utf-8').decode("unicode_escape")) print(res.status_code, res.content)
def examine_count(self): api_url = HOST + "/api/LocationStatic/ExamineCount" header = { 'content-type': CONTENT_TYPE, 'Authorization': TOKEN, 'userInfo': REGINFO } from register.proto_pb.OrderSearchRequestPb_pb2 import OrderSearchRequestPb body = OrderSearchRequestPb() body.regStartDate = within3days().split("|")[0] # 三天前 body.regEndDate = within3days().split("|")[-1] # 今天23点 # body.serviceSectID = 'CT' body = body.SerializeToString() res = self.client.request(method='POST', path=api_url, data=body, headers=header, name='s机房统计') # from register.proto_pb.PageResponsePb_pb2 import PageResponsePb # data = PageResponsePb() # data.ParseFromString(res.content) # from google.protobuf.json_format import MessageToJson # from register.proto_pb.LocationExamineCountListResponsePb_pb2 import LocationExamineCountListResponsePb # res_json = MessageToJson(data) # print(res.status_code) # print(res_json.encode('utf-8').decode("unicode_escape")) print(res.status_code, res.content)
def manual_timeout_list(self): api_url = HOST + "/api/TimeoutReport/PageList" from report.proto_pb.ReportConditionRequestPb_pb2 import ReportConditionRequestPb body = ReportConditionRequestPb() """对象入参赋值""" body.initiative = 1 body.pageSize = 10 body.pageIndex = 1 body.gapTime = 30 body.regDate = within3days() body = body.SerializeToString() res = self.client.request(method='POST', path=api_url, data=body, headers=header, name='手动超时报告') print("manual_timeout_list返回------------") print(res.status_code, res.content)