码迷,mamicode.com
首页 > 编程语言 > 详细

[TimLinux] Python3 Coverity zeep/SOAP 库使用示例

时间:2019-05-23 21:06:52      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:ons   cti   linux   number   scope   col   login   filters   import   

废话不多说,上代码:

# 基于Coverity的示例
from zeep import Client
from zeep.wsse.username import UsernameToken

config_url = http://...:8080/ws/v9/configurationservice?wsdl
defect_url = http://...:8080/ws/v9/defectservice?wsdl

user_token = UsernameToken(loginuser, loginpasswd)

config_client = Client(config_url, wsse=user_token)
defect_client = Client(defect_url, wsse=user_token)

config_factory = config_client.type_factory(ns0)
defect_factory = defect_client.type_factory(ns0)

projectId = config_factory.projectIdDataObj(
    name=xxxx-project-name
)

filterSpec = defect_factory.snapshotScopeDefectFilterSpecDataObj()
pageSpec = defect_factory.pageSpecDataObj(pageSize=1, sortAscending=True, startIndex=0)
snapshotScope = defect_factory.snapshotScopeSpecDataObj(showSelector=firstAfter(2019-05-01 12:12:12))

d = {
    projectId: projectId,
    filterSpec: filterSpec,
    pageSpec: pageSpec,
    snapshotScope: snapshotScope
}

res = defect_client.service.getMergedDefectesForSnapshotScope(**d)

print(res.totalNumberOfRecords)

 

[TimLinux] Python3 Coverity zeep/SOAP 库使用示例

标签:ons   cti   linux   number   scope   col   login   filters   import   

原文地址:https://www.cnblogs.com/timlinux/p/10914360.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!