The BlueCat Python API is a set of wrapper classes abstracting the functionality of the BlueCat Address Manager SOAP API along with certain other BAM and BDDS functions (for example, dynamic updates to host records and remote administration via clish).
The standard usage pattern is to create an API instance, login, retrieve a configuration object, and go from there. For example:
#!/usr/bin/python from bluecat import api, api_exception try: # Create a connection - the URL is the same one as used for raw SOAP API connections. conn = API('http://192.0.2.15/Services/API?wsdl') # Login using an API user configured via the BAM UI. conn.login('admin', 'admin') c = conn.get_configuration('Configuration Name') for s in c.get_servers(): # Print the server name and any service IP4 addresses it has. print s.name(), s.get_service_ip4_addresses() except APIException as e: # Something went wrong. print e.get_message()
Here is an example of direct SOAP API call:
zones = g.user.get_api()._api_client.service.getZonesByHint(view.get_id(), 0, 10, properties)