def getMessageTxtService(token=token,device_id=device_id): tester=httpTester() getMessageTxtService={ "title":"14. 文本消息推送服务接口", "url": "http://211.151.7.140:10006/CommandServer/getMessageTxtService", "data": { "token": token, "device_id": device_id } } return tester.test(getMessageTxtService)
def getLocalService(imei=imei, device_serial_number=device_serial_number): tester=httpTester() getLocalService={ "title":"1. 客户端首次连接TCL云服务器接口", "url":"http://211.151.7.140:10006/CommandServer/getLocalService", "data":{ "imei": imei, "device_serial_number": device_serial_number } } return tester.test(getLocalService)
def getAppListService(token=token,device_id=device_id): tester=httpTester() getAppListService={ "title":"9. 获取设备绑定app应用列表接口(此接口可能不需要)", "url": "http://211.151.7.140:10006/CommandServer/getAppListService", "data": { "token": token, "device_id": device_id } } return tester.test(getAppListService)
def getRegularService(token=token,device_id=device_id): tester=httpTester() getRegularService={ "title":"8. 定期查询服务接口", "url": "http://211.151.7.140:10006/CommandServer/getRegularService", "data": { "token": token, "device_id": device_id } } return tester.test(getRegularService)
def getRegularTimeService(token=token,device_id=device_id): tester=httpTester() getRegularTimeService={ "title":"6. 获取定期/短周期/长周期定期上报时间接口", "url": "http://211.151.7.140:10006/CommandServer/getRegularTimeService", "data": { "token": token, "device_id": device_id } } return tester.test(getRegularTimeService)
def uploadDeviceStatusService(token=token,device_id=device_id,status="1"): tester=httpTester() uploadDeviceStatusService={ "title":"12. 设备状态反馈接口", "url": "http://211.151.7.140:10006/CommandServer/uploadDeviceStatusService", "data": { "token": token, "device_id": device_id, "status":status } } return tester.test(uploadDeviceStatusService)
def uploadFeedbackService(token=token,device_id=device_id,effective_data=[]): tester=httpTester() uploadFeedbackService={ "title":"11. 命令/策略/APP应用执行后反馈接口", "url": "http://211.151.7.140:10006/CommandServer/uploadFeedbackService", "data": { "token": token, "device_id": device_id, "effective_data":effective_data } } return tester.test(uploadFeedbackService)
def getPushService(token=token,device_id=device_id,effective_data="A0001"): tester=httpTester() getPushService={ "title":"10. 下发推送命令/策略/app应用接口", "url": "http://211.151.7.140:10006/CommandServer/getPushService", "data": { "token": token, "device_id": device_id, "effective_data":effective_data } } return tester.test(getPushService)
def uploadDeviceService(token=token,device_id=device_id,imei=imei): tester=httpTester() uploadDeviceService={ "title":"7. 客户端数据上报/更新接口", "url":"http://211.151.7.140:10006/CommandServer/uploadDeviceService", "data": { "token": token, "device_id": device_id, "effective_data": { "sims": [ { "phone_number": "13900000000", "roam": "1", "operator": "1", "num": "1", "iccid": "89860312900100377659", "imei": imei, "data_roam": "1" } ], "total_capacity_rom": "10000", "available_space_sd_card": "10000", "device_serial_number": device_serial_number, "policy_id": "1", "resolution": "800*600", "ram": "1024", "longitude": random.uniform(116.25, 116.50), "latitude": random.uniform(39.954, 39.981), "policy_name": "Chen Long Phone", "policy_status": "2", "power_status": random.uniform(20, 100), "wifi_mac_address": "1", "operating_system": "IOS", "root": "1", "bluetooth_mac_address": "1", "manufacturer": "TCL", "app_list_install": [ { "version": "3.14.0-JB78059", "package_name": "com.shazam.android" } ], "model": "1", "available_space_rom": "1", "capacity_sd_card": "1" } } } return tester.test(uploadDeviceService)
def repeatVerifyService(token=token,device_id=device_id): tester=httpTester() repeatVerifyService={ "title":"5. 客户端重新获取token接口", "url": "http://211.151.7.140:10006/CommandServer/repeatVerifyService", #"url": "http://192.168.1.202:8080/CommandServer/repeatVerifyService", "data": { "token": token, "device_id": device_id } } return tester.test(repeatVerifyService)
def uploadDelAppService(token=token,device_id=device_id,package_name="NULL",push_status="1"): tester=httpTester() uploadDelAppService={ "title":"13. 客户端手动删除app程序上报接口", "url": "http://211.151.7.140:10006/CommandServer/uploadDelAppService", "data": { "token": token, "device_id": device_id, "package_name":package_name, "push_status":push_status } } return tester.test(uploadDelAppService)
def verifyService(imei=imei,password=password,device_serial_number=device_serial_number,email=email): tester=httpTester() verifyService={ "title":"4. 客户端激活验证接口", "url": "http://211.151.7.140:10006/CommandServer/verifyService", #"url": "http://192.168.1.202:8080/CommandServer/verifyService", "data": { "imei": imei, "password": password, "device_serial_number": device_serial_number, "email": email } } return tester.test(verifyService)
def getPasswordService(imei=imei,device_serial_number=device_serial_number,email=email): tester=httpTester() getPasswordService={ "title":"2. 通过邮箱获取密码(验证码)/许可协议接口", "url": "http://211.151.7.140:10006/CommandServer/getPasswordService", "data": { "imei": imei, "device_serial_number": device_serial_number, "email": email } } ret = tester.test(getPasswordService) if ret["code"]=="1": print "Agrement: "+ret["agreement"] return ret