CasperAPI_CLI.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Casper-API-Tools 作者: eventbrite 项目源码 文件源码
def updateMobileDeviceName(mobileSearch, deviceName, username, password):
    print 'Updating Mobile Device name for mobile device ' + mobileSearch + ' to ' + deviceName + '...'
    newDeviceName_normalized = urllib2.quote(deviceName)

    mobile_id = getSupervisedMobileDeviceId(mobileSearch, username, password)
    if str(mobile_id) == '-1':
        print 'Mobile device ' + mobileSearch + ' not found, please try again.'
        return -1
    elif str(mobile_id) == '-2':
        print 'More than one mobile device matching search string ' + str(mobileSearch) + ', please try again.'
        return -1
    elif str(mobile_id) == '-3':
        print 'Device found, but is not supervised.'

    postStr = jss_api_base_url + '/mobiledevicecommands/command/DeviceName/' + newDeviceName_normalized + '/id/' + mobile_id
    postXML = "<mobile_device_command><command>DeviceName</command><mobile_devices><mobile_device><id>" + mobile_id + "</id><device_name>" + deviceName + "</device_name></mobile_device></mobile_devices></mobile_device_command>"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号