CasperAPI_CLI.py 文件源码

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

项目:Casper-API-Tools 作者: eventbrite 项目源码 文件源码
def getComputerGroupId(groupSearch, username, password):
    groupSearch_normalized = urllib2.quote(groupSearch)

    reqStr = jss_api_base_url + '/computergroups/name/' + groupSearch_normalized

    r = sendAPIRequest(reqStr, username, password, 'GET')

    if r != -1:
        responseCode = r.code
        #print 'Response Code: ' + str(responseCode)

        baseXml = r.read()
        responseXml = etree.fromstring(baseXml)

        computerGroupId = responseXml.find('id').text
        #print computerGroupId
        return computerGroupId
    else:
        #print 'Group not found.'
        return -1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号