访问servicenow rest api的python模块
servicenow-client的Python项目详细描述
安装
----
pip install servicenow_客户端
用法示例:
-----
立即导入服务
创建对象
obj=servicenow\u client.servnow(instance='myinstance',user='myuser',password='mypassword',empty\u error=true)
创建新记录
obj.create(表='incident',数据={'short_description':'my incident ticket'})
根据搜索条件更新记录
搜索列表=['字段','运算符','值']
obj.update(表='incident',搜索列表=[['short_description','is','my incident ticket'],['number','is not','inc0010022']],数据={'state':'1'})
搜索记录并仅显示结果中的“编号”和“系统ID”
obj.search(表='incident',searchlist=['short_description','is not empty',fields='number,sys_id')
根据搜索条件删除记录
obj.delete(表='problem',搜索列表=['short_description','is','problem ticket'])
根据搜索条件更改记录的状态
obj.changestate(表='incident',搜索列表=['short_description','is','isan problem 2',状态='in progress')
根据搜索条件下载与记录相关的特定附件或特定类型的附件
obj.getfile(表='incident',搜索列表=['short_description','is','test123',类型='.jpg')
上传附件到满足搜索条件的记录
obj.uploadfile(表='incident',搜索列表=['short_description','is','test'],文件名='d:\郁金香.jpg')
从满足搜索条件的记录中删除附件
obj.deletefile(table='incident',searchlist=['short_description','is','upload 4',filename='ridles treasure hunt.pdf')
发送与特定记录相关的电子邮件
发送与任何特定记录无关的电子邮件跳过“表”和“sysid”字段
obj.sendmail(表='incident',主题='hello',消息='hi',收件人='abc@example.com,xyz@example.com',sysid='33434f713200e1e0b5e18110c75b')
读取电子邮件,其中sysid是电子邮件的sysid
obj.reademail(sysid='33434f713200e1e0b5e18110c75b')
兼容性
----
python 2测试:python 2.6+
服务现已测试:伊斯坦布尔,日内瓦
作者
-----
由parul neeraj<;parulneeraj007@gmail.com>;于2017年创建
----
pip install servicenow_客户端
用法示例:
-----
立即导入服务
创建对象
obj=servicenow\u client.servnow(instance='myinstance',user='myuser',password='mypassword',empty\u error=true)
创建新记录
obj.create(表='incident',数据={'short_description':'my incident ticket'})
根据搜索条件更新记录
搜索列表=['字段','运算符','值']
obj.update(表='incident',搜索列表=[['short_description','is','my incident ticket'],['number','is not','inc0010022']],数据={'state':'1'})
搜索记录并仅显示结果中的“编号”和“系统ID”
obj.search(表='incident',searchlist=['short_description','is not empty',fields='number,sys_id')
根据搜索条件删除记录
obj.delete(表='problem',搜索列表=['short_description','is','problem ticket'])
根据搜索条件更改记录的状态
obj.changestate(表='incident',搜索列表=['short_description','is','isan problem 2',状态='in progress')
根据搜索条件下载与记录相关的特定附件或特定类型的附件
obj.getfile(表='incident',搜索列表=['short_description','is','test123',类型='.jpg')
上传附件到满足搜索条件的记录
obj.uploadfile(表='incident',搜索列表=['short_description','is','test'],文件名='d:\郁金香.jpg')
从满足搜索条件的记录中删除附件
obj.deletefile(table='incident',searchlist=['short_description','is','upload 4',filename='ridles treasure hunt.pdf')
发送与特定记录相关的电子邮件
发送与任何特定记录无关的电子邮件跳过“表”和“sysid”字段
obj.sendmail(表='incident',主题='hello',消息='hi',收件人='abc@example.com,xyz@example.com',sysid='33434f713200e1e0b5e18110c75b')
读取电子邮件,其中sysid是电子邮件的sysid
obj.reademail(sysid='33434f713200e1e0b5e18110c75b')
兼容性
----
python 2测试:python 2.6+
服务现已测试:伊斯坦布尔,日内瓦
作者
-----
由parul neeraj<;parulneeraj007@gmail.com>;于2017年创建