ca频谱web服务api包装器。

spectrum-client的Python项目详细描述


频谱客户端

imageimageimage


ca频谱web服务api包装器

安装

spectrum客户端在pypi上发布,在linux/macos和windows上可用,并支持python 2.7、3.4+。

pip install -U spectrum-client

用法

fromspectrum_clientimportSpectrumoc=Spectrum('http://oneclick.mydomain:8080','myuser','secret')# Update a model attributeoc.update_attribute(0x210afa,0x10024,'MySNMPSecret')# Update multiple attributesnotes='Some notes'updates=[(0x11564,notes),(0x12db9,'JKL002'),(0x1295d,False)]oc.update_attributes(mh,updates)# Get a list of devices by name, using regex, restricting the search to landscape 0x200000oc.devices_by_name('^SW00',0x200000)# Get a lis tof devices by specific attribute from all landscapesoc.devices_by_attr(0x12db9,'XYZ001')# Get a list of devices by multipe matching filtersoc.devices_by_filters([(attr1,'equals',value1),(attr2,'has-pcre','^foo.*bar')],landscape)# Put a model in maintenance modeoc.set_maintenance(model_handle,True)# Remove a model from maintenance modeoc.set_maintenance(model_handle,False)# Create an event of type 0x10f06 (generates a High Memory Utilization alarm) on a device with IP Address.event='0x10f06'device_ip='10.10.0.1'var_binds={0:75,1:99,3:'mem_instance',5:'name'}oc.generate_event_by_ip(event,device_ip,var_binds)

如果不提供,将从环境变量SPECTRUM_URLSPECTRUM_USERNAMESPECTRUM_PASSWORD读取服务器和凭据。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Intellij通过方法中的包查找用法   java中VS代码和打包命名的问题   将java CMS功能集成到具有高度动态内容的网站(Lucene/Mysql/Nosql)的策略   oracle的java类强制转换异常。jdbc。驾驶员OracleConnection   字节码向JVM添加上指令   如何在抽象类中执行java方法?   java是否可以在apache访问日志中排除指定的GET参数?(作者:W7开发环境)   java如何获取已安装音频播放器的列表?   尝试向HS学生展示如何使用Java访问MS数据库   使用正则表达式java对给定行中的特定字符串进行计数   java JOOQ Select查询中的Select计数   方法Java,如何从二维双精度数组中找到特定值?   获取图像URL的java正则表达式   java在切换到新的窗口驱动程序后找不到元素