集成SDK
integra-sdk的Python项目详细描述
- integra python sdk可用于与integra reactor进行无缝通信。
- integra rest文档和其他sdk可以在Integra REST获得。
- integra文档可以在Integra Docs找到。
依赖关系
- Python2.6+
- lxml
- 请求
- 主次一体化建筑
创建自己的integra主/副积木构建
- 下载Integra XSD。
- 安装pip
- pip安装lxml
- PIP安装请求
- pip install generateds
- generateds.py-o integra_major_minor_build.py integra.xsd
用法
1-初始化restTemplate:
RestTemplate().init('https://localhost:8443/rest', 'admin', 'integra')
2-调用restTemplate rest方法:
- 发布
- 全部获取
- 按ID获取
- 放置
- 删除
restTemplate包含rest资源端点的静态列表。将所有内容组合在一起的示例;创建提供者:
class ProviderServiceTest(unittest.TestCase): description = 'test desc' hostname = 'localhost' name = 'test name' password = 'password' port = 9999 timeout = 1000 def setUp(self): RestTemplate().init('https://localhost:8443/rest', 'admin', 'integra') def test_create(self): prov = self._get_provider() prov = RestTemplate().post(RestTemplate.PROVIDERS, prov) self.assertIsNotNone(prov, 'Unable to create provider') self.assertIsNotNone(prov.get_id()) def _get_provider(self): prov = provider() prov.set_description(self.description) prov.set_hostname(self.hostname) prov.set_name(self.name) prov.set_password(self.password) prov.set_port(self.port) prov.set_secured(True) prov.set_timeout(self.timeout) return prov if __name__ == "__main__": unittest.main()
许可证
integra python sdk是在Apache 2.0 license下发布的开源软件。