Skip to main content

Integra SDK

Project description

  • The Integra Python SDK can be used to seemelessly communicate with an Integra reactor.

  • The Integra REST documentation and additional SDKs can be obtained at Integra REST.

  • The Integra documentation can be found at Integra Docs.

Dependencies

  • python 2.6+

  • lxml

  • requests

  • integra_major_minor_build

Build your own integra_major_minor_build

  • Download the Integra XSD.

  • Install pip

  • pip install lxml

  • pip install requests

  • pip install generateDS

  • generateDS.py -o integra_major_minor_build.py integra.xsd

Usage

1- Init RestTemplate:

RestTemplate().init('https://localhost:8443/rest', 'admin', 'integra')

2- Invoke RestTemplate REST methods:

  • post

  • get_all

  • get_by_id

  • put

  • delete

RestTemplate contains a static list of REST resource end points. Example putting it all together; creating a provider:

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()

License

The Integra Python SDK is Open Source software released under the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

integra-sdk-0.1.1.tar.gz (24.4 kB view details)

Uploaded Source

File details

Details for the file integra-sdk-0.1.1.tar.gz.

File metadata

  • Download URL: integra-sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for integra-sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9a20fbf067d14adaa19123d37d5dd494dd485e1d14d2dd0df83961f7e537ab3f
MD5 1ca1e17e33bb9ae7f4e0a0633eda5284
BLAKE2b-256 b67690a56c379dea1176897b141bb4b445c10eab1ccf4a779a6b2838866fbe39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page