Source code for Canopy

from urllib.request import urlopen, Request
import sys, re, ssl, urllib.parse, base64, json, xmltodict, urllib, xml.etree.ElementTree as ET
from xml.dom import minidom
import os, pprint as pp
import xml.parsers.expat

class AResponse:
	def __init__(self, HTTPResponse):
		self.r = HTTPResponse
		print(self.r.read())
		self.msg = HTTPResponse.msg
		self.status = HTTPResponse.status
		self.reason = HTTPResponse.reason

	def read(self):
		return self.r.read()

	def getheader(self, name):
		return self.r.getheader(name)

	def getheaders(self):
		return self.r.getheaders()

	def get_xml(self):
		try:
			return ET.fromstring(self.read())
		except xml.parsers.expat.ExpatError:
			return ET.Element

[docs]class Acano: """The Acano Server class Use this class to connect and make API calls to an Acano Virtual Machine. :param server_ip: The IP Address of the server :param username: The username of an account with access to the API. :param password: The password for your user account :type server_ip: String :type username: String :type password: String :returns: return an Acano object :rtype: Acano :Example: >>> import Canopy >>> a = Canopy.Acano("192.168.12.100", "admin", "guest") """ def __init__(self, server_ip, username, password): self.server_ip = server_ip self.username = username self.password = password self.auth = "Basic " + base64.b64encode(str.encode(username + ":" + password)).decode("utf-8") ''' def get_response(self, function): return function(parameters = parameters, payload = payload, HTTPmethod = HTTPmethod) ''' def __open__(self, acanoMethod, parameters = {}, payload = None, HTTPmethod = 'GET'): ip = self.server_ip base = "https://" + ip + "/api/v1/" + acanoMethod + "?" + urllib.parse.urlencode(parameters) req = 1 if(payload == None): req = Request(base) req.method = HTTPmethod else: d = urllib.parse.urlencode(payload) d = d.encode('ascii') req = Request(base, data = d) req.method = HTTPmethod req.add_header("Authorization", self.auth) ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE resp = "" with urlopen(req, context = ctx) as f: resp = f.read() #return resp.decode("utf-8") #ET.fromstring(xmltodict.ConvertXmlToDict() tR = "test" response = "" try: response = xmltodict.parse(resp.decode("utf-8")) #json.loads(json.dumps(xml... in order to convert from OrderedDict to dict except xml.parsers.expat.ExpatError: testString = "<class 'http.client.HTTPResponse'>" if(str(type(f)) == testString): try: return { 'HTTPResponse' : f.getcode(), '@id' : (f.getheader("Location")).split("/")[len((f.getheader("Location")).split("/"))-1]} except AttributeError: return { 'HTTPResponse' : f.getcode(), 'Date' : f.getheader("Date") } ''' This section attempts to convert the responses that contain only a single item, eg: {'coSpaces': { '@total': '1', 'coSpace': {'@id': '3b8dfa05-f7b6-41f2-b14a-739a0d015b90', 'autoGenerated': 'false', 'name': None}}}​ {'coSpaces': {'@total': '1', 'coSpace': [ {'@id': '3b8dfa05-f7b6-41f2-b14a-739a0d015b90', 'autoGenerated': 'false', 'name': None} ]}}​ This mitigates different behaviour from when there are single instances vs multiple instances: Before: a.get_coSpaces()["coSpace"]["coSpace"]["@id"] # Get the first coSpace ID when there's only one coSpace in the database a.get_coSpaces()["coSpace"]["coSpace"][0]["@id"] # Get the first coSpace ID when there are multiple coSpaces in the database After: a.get_coSpaces()["coSpace"]["coSpace"][0]["@id"] # Get the first coSpace ID when there's only one coSpace in the database a.get_coSpaces()["coSpace"]["coSpace"][0]["@id"] # Get the first coSpace ID when there are multiple coSpaces in the database ''' try: rootName = list(response.keys())[0] root = response[rootName] if(root["@total"] == "1"): # Attempt to find a 'total' of items li = list() childName = list(root.keys())[1] li.append(root[childName].copy()) root[childName] = li response[rootName] = root return json.loads(json.dumps(response)) elif(len(resp) == 0): return {} #pp.pprint(root) #We need to make it a list except KeyError: return json.loads(json.dumps(xmltodict.parse(resp.decode("utf-8")))) return json.loads(json.dumps(xmltodict.parse(resp.decode("utf-8"))))
[docs] def get_coSpaces(self, parameters = {}): """Get the coSpaces within the Acano VM. These are returned in an arbitrary order. :param parameters: A dictionary of parameters, per the Acano API. :type parameters: Dict :Example: >>> print(a.get_coSpaces()) :Example: >>> print(a.get_coSpaces(parameters = { >>> 'offset' : 5 >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=25 .. note:: v1.8 upward """ return self.__open__("coSpaces")
[docs] def create_coSpace(self, payload = {}): """Create a new coSpace :param payload: Details the initial state of the newly created coSpace :type payload: Dict :Example: >>> print(a.create_coSpace()) :Example: >>> print(a.create_coSpace(payload = { >>> 'name' : 'Emergency meeting' >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=25 .. note:: v1.8 upward """ return self.__open__("coSpaces", payload = payload, HTTPmethod='POST')
[docs] def modify_coSpace(self, coSpace_id, payload): """Make changes to an existing coSpace, using the coSpace ID as the identifier. :param coSpace_id: The ID of the coSpace to modify. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param payload: Details the new state of the identified coSpace :type payload: Dict :Example: >>> print(a.modify_coSpace("3b8dfa05-f7b6-41f2-b14a-739a0d015b90", payload = { >>> "name" : "Modified coSpace" >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=25 .. note:: v1.8 upward """ return self.__open__(("coSpaces/" + coSpace_id), payload = payload, HTTPmethod = 'PUT')
[docs] def get_coSpace(self, coSpace_id): """Get the details of a coSpace, using the coSpace ID as the identifier. :param coSpace_id: The ID of the coSpace to modify. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param parameters: Filters for the query :type parameters: Dict :Example: >>> print(a.get_coSpace("3b8dfa05-f7b6-41f2-b14a-739a0d015b90")) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=27 .. note:: v1.8 upward """ return self.__open__(("coSpaces/" + coSpace_id))
[docs] def delete_coSpace(self, coSpace_id): """Delete a coSpace, using the coSpace ID as the identifier. :param coSpace_id: The ID of the coSpace to delete. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :Example: >>> print(a.delete_coSpace("3b8dfa05-f7b6-41f2-b14a-739a0d015b90")) .. note:: This function is not explicitly described in the Acano API reference .. note:: v1.8 upward """ return self.__open__(("coSpaces/" + coSpace_id), HTTPmethod = "delete".upper())
def _coSpaces_coSpaceID_coSpaceUsers_node_(self, coSpace_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__(("coSpaces/" + coSpace_id + "/coSpaceUsers"), parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_coSpace_members(self, coSpace_id, parameters = {}): """Get the members in a coSpace, using the coSpace ID as the identifier. :param coSpace_id: The ID of the coSpace for which to get members. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param parameters: Details the parameters of the HTTP GET :type parameters: Dict :Example: >>> print(a.get_coSpace_members("3b8dfa05-f7b6-41f2-b14a-739a0d015b90")) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=27 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_coSpaceUsers_node_(coSpace_id, parameters = parameters, HTTPmethod = 'GET')
[docs] def add_member_to_coSpace(self, coSpace_id, payload = {}): """Add a member to the coSpace, using the coSpace ID as the identifier. :param coSpace_id: The ID of the coSpace for which to add a member. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param payload: Details the member to add. Must contain the User JID. :type payload: Dict :Example: >>> print(a.add_member_to_coSpace("3b8dfa05-f7b6-41f2-b14a-739a0d015b90", payload { >>> 'userJid' : a.get_coSpace_members()["coSpaceMembers] >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=30 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_coSpaceUsers_node_(coSpace_id, payload = payload, HTTPmethod = 'POST')
def _coSpaces_coSpaceID_coSpaceUsers_coSpaceUserID_node_(self, coSpace_id, coSpace_user_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__(("coSpaces/" + coSpace_id + "/coSpaceUsers/" + coSpace_user_id), parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_coSpace_member(self, coSpace_id, coSpace_user_id, payload = {}): """Make changes to the permissions of a user in a coSpace, using the coSpace ID and user ID as the identifiers. :param coSpace_id: The ID of the coSpace for to get the user. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param coSpace_user_id: The ID of the user. :type coSpace_user_id: String :param payload: Details the state to which to update the user. :type payload: Dict :Example: >>> print(a.modify_coSpace_member("3b8dfa05-f7b6-41f2-b14a-739a0d015b90", user_id, payload { >>> 'canDestroy' : 'true' >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=30 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_coSpaceUsers_coSpaceUserID_node_(coSpace_id, coSpace_user_id, payload, HTTPmethod = 'PUT')
[docs] def get_coSpace_member(self, coSpace_id, coSpace_user_id): """Make changes to the permissions of a user in a coSpace, using the coSpace ID and user ID as the identifiers. :param coSpace_id: The ID of the coSpace for to get the user. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param coSpace_user_id: The ID of the user. :type coSpace_user_id: String :Example: >>> print(a.get_coSpace_member("3b8dfa05-f7b6-41f2-b14a-739a0d015b90", user_id) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=31 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_coSpaceUsers_coSpaceUserID_node_(coSpace_id, coSpace_user_id, HTTPmethod = 'GET')
def _coSpaces_coSpaceID_messages_node_(self, coSpace_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__(("coSpaces/" + coSpace_id + "/messages"), parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def post_message_to_coSpace(self, coSpace_id, payload = {}): """Post a message to the board of a coSpace. :param coSpace_id: The ID of the coSpace. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param payload: Details the message to send. :type payload: Dict :Example: >>> print(a.post_message_to_coSpace("3b8dfa05-f7b6-41f2-b14a-739a0d015b90", payload = { >>> 'message' : 'hello world', >>> 'from' : 'George' >>> }) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=31 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_messages_node_(coSpace_id, payload, HTTPmethod = 'POST')
[docs] def delete_message_from_coSpace(self, coSpace_id, payload = {}): """Delete messages from the board of a coSpace :param coSpace_id: The ID of the coSpace for to get the user. This can be returned from the get_coSpaces()["coSpaces"]["coSpace"][i]["@id"] :type coSpace_id: String :param payload: Details the messages to remove. :type payload: Dict :Example: >>> print(a.delete_message_from_coSpace("3b8dfa05-f7b6-41f2-b14a-739a0d015b90", payload = { >>> 'maxAge' : 20 >>> }) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=32 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_messages_node_(coSpace_id, payload, HTTPmethod = "delete".upper())
def _userProfiles_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("userProfiles", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_user_profiles(self, parameters = {}): """Get the user profiles that exist within the VM. :param parameters: Details filters for the query. :type parameters: Dict :Example: >>> print(a.get_user_profiles() .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=66 .. note:: v1.8 upward """ return self._userProfiles_node_(parameters = parameters, HTTPmethod = 'GET')
[docs] def create_user_profile(self, payload = {}): """Create a new user profile :param payload: Details the inital state of the new user profile. :type payload: Dict :Example: >>> print(a.create_user_profile(payload = { >>> "cancreateCoSpaces" : True >>> }) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=66 .. note:: v1.8 upward """ return self._userProfiles_node_(payload = payload, HTTPmethod = 'POST')
def _userProfiles_userProfile_id_node_(self, user_profile_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("userProfiles/" + user_profile_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_user_profile(self, user_profile_id): """Get a specific existing user profile :param user_profile_id: Identifies the user profile to return :type user_profile_id: String :Example: >>> print(a.get_user_profile()) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=67 .. note:: v1.8 upward """ return self._userProfiles_userProfile_id_node_(user_profile_id, HTTPmethod = 'GET')
[docs] def modify_user_profile(self, user_profile_id, payload = {}): """Modify an existing user profile :param user_profile_id: Identifies the user profile to modify :type user_profile_id: String :param payload: Details the new state of the user profile. :type payload: Dict :Example: >>> print(a.modify_user_profile(payload = { >>> "cancreateCoSpaces" : False >>> }) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=66 .. note:: v1.8 upward """ return self._userProfiles_userProfile_id_node_(user_profile_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_system_status(self): """Get information on the current system status, e.g. software version, uptime etc. :Example: >>> print(a.get_system_status()) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=68 .. note:: v1.8 upward """ return self.__open__("system/status", HTTPmethod = 'GET')
[docs] def get_system_alarms(self): """Get information on the current system alarm status. :Example: >>> print(a.get_system_alarms()) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=68 .. note:: v1.8 upward """ return self.__open__("system/alarms", HTTPmethod = 'GET')
[docs] def get_system_database(self): """Get information on the system database status. :Example: >>> print(a.get_system_database()) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=70 .. note:: v1.8 upward """ return self.__open__("system/database", HTTPmethod = 'GET')
def _system_cdrReceivers_cdrReceiverId_node_(self, cdr_receiver_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("system/cdrReceivers/" + cdr_receiver_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_cdr_receiver(self, cdr_receiver_id): """Get a specific Call Detail Record Receiver by ID :param cdr_receiver_id: Identifies the CDR to return :type cdr_receiver_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=71 .. seealso:: https://www.acano.com/publications/2013/07/Acano-Solution-R1.6-CDR-Guide.pdf#page=6 .. note:: v1.8 upward """ return self._system_cdrReceivers_cdrReceiverId_node_(cdr_receiver_id, HTTPmethod = 'GET')
[docs] def modify_cdr_receiver(self, cdr_receiver_id, payload = {}): """Modify a Call Detail Record Receiver by ID :param cdr_receiver_id: Identifies the CDR to return :type cdr_receiver_id: String :param payload: Details the new state of the CDR receiver. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=71 .. seealso:: https://www.acano.com/publications/2013/07/Acano-Solution-R1.6-CDR-Guide.pdf#page=6 .. note:: v1.8 upward """ return self._system_cdrReceivers_cdrReceiverId_node_(cdr_receiver_id, payload = payload, HTTPmethod = 'PUT')
def _system_cdrReceivers_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("system/cdrReceivers", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_cdr_receivers(self, parameters = {}): """Get the Call Detail Record receivers :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=71 .. seealso:: https://www.acano.com/publications/2013/07/Acano-Solution-R1.6-CDR-Guide.pdf#page=6 .. note:: v1.8 upward """ return self._system_cdrReceivers_node_(parameters = parameters, HTTPmethod = 'GET')
[docs] def create_cdr_receiver(self, payload = {}): """Create a new Call Detail Record receiver :param payload: Details the initial state of the CDR receiver :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=71 .. seealso:: https://www.acano.com/publications/2013/07/Acano-Solution-R1.6-CDR-Guide.pdf#page=6 .. note:: v1.8 upward """ return self._system_cdrReceivers_node_(payload = payload, HTTPmethod = 'POST')
def _system_profiles_node_(self, payload = {}, HTTPmethod = 'GET'): return self.__open__("system/profiles", payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_global_profile(self): """Get the global profile :Example: >>> print(a.get_global_profile()) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. note:: v1.8 upward """ return self._system_profiles_node_(HTTPmethod = 'GET')
[docs] def modify_global_profile(self, payload = {}): """Modify the global profile :param payload: Details the modified state of the global profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. note:: v1.8 upward """ return self._system_profiles_node_(payload = payload, HTTPmethod = 'PUT')
[docs] def create_global_profile(self, payload = {}): """Set up the global profile :param payload: Details the inital state of the global profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. note:: v1.8 upward """ return self._system_profiles_node_(payload = payload, HTTPmethod = 'POST')
def _turnServers_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("turnServers", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_turn_servers(self, parameters = {}): """Get the TURN servers. TURN, in this context being Traversal Using Relay NAT :param parameters: Details filters for the query :type parameters: Dict :Example: >>> print(a.get_turn_servers()) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=50 .. seealso:: http://en.wikipedia.org/wiki/Traversal_Using_Relay_NAT .. note:: v1.8 upward """ return self._turnServers_node_(parameters = parameters, HTTPmethod = 'GET')
[docs] def create_turn_server(self, payload = {}): """Set up a new TURN server. TURN, in this context being Traversal Using Relay NAT :param payload: Details the initial state of the TURN server :type payload: Dict :Example: >>> print(a.create_turn_server(payload = { >>> "ServerAddress" : "192.168.12.50" >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=50 .. seealso:: http://en.wikipedia.org/wiki/Traversal_Using_Relay_NAT .. note:: v1.8 upward """ return self._turnServers_node_(payload = payload, HTTPmethod = 'POST')
def __turnServers_turnServerId_node__(self, turn_server_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("turnServers/" + turn_server_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_turn_server(self, turn_server_id, payload = {}): """Modify an existing TURN server. TURN, in this context being Traversal Using Relay NAT :param payload: Details the modified state of the TURN server :type payload: Dict :Example: >>> print(a.create_turn_server(payload = { >>> "ServerAddress" : "192.168.12.50" >>> })) .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=50 .. seealso:: http://en.wikipedia.org/wiki/Traversal_Using_Relay_NAT .. note:: v1.8 upward """ return self.__turnServers_turnServerId_node__(turn_server_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_turn_server(self, turn_server_id): """Return a TURN server, referenced by the TURN server ID. TURN, in this context being Traversal Using Relay NAT .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=72 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=50 .. seealso:: http://en.wikipedia.org/wiki/Traversal_Using_Relay_NAT .. note:: v1.8 upward """ return self.__turnServers_turnServerId_node__(turn_server_id, HTTPmethod = 'GET')
#This one returns bad request when presented with a valid TURN server ID. Not sure why... def get_turn_server_status(self, turn_server_id): print("turnServers/" + turn_server_id + "/status") return self.__open__("turnServers/" + turn_server_id + "/status", HTTPmethod = 'GET') def _webBridges_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("webBridges", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_web_bridges(self, parameters = {}): """Get information on Web Bridges :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=74 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=47 .. note:: v1.8 upward """ return self._webBridges_node_(parameters = parameters, HTTPmethod = 'GET')
[docs] def create_web_bridge(self, payload = {}): """Set up a new web bridge :param payload: Details the initial state of the Web Bridge :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=75 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=47 .. note:: v1.8 upward """ return self._webBridges_node_(payload = payload, HTTPmethod = 'POST')
def _webBridges_webBridgeID_node_(self, web_bridge_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("webBridges/" + web_bridge_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_web_bridge(self, web_bridge_id, payload = {}): """Modify an existing web bridge :param web_bridge_id: The ID of the web bridge to modify. :type web_bridge_id: String :param payload: Details the new state of the Web Bridge :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=75 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=47 .. note:: v1.8 upward """ return self._webBridges_webBridgeID_node_(web_bridge_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_web_bridge(self, web_bridge_id): """Get information for a specific web bridge, by ID :param web_bridge_id: The ID of the web bridge for which to get information. :type web_bridge_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=75 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=47 .. note:: v1.8 upward """ return self._webBridges_webBridgeID_node_(web_bridge_id, parameters = parameters, HTTPmethod = 'GET')
[docs] def update_web_bridge_customization(self, web_bridge_id): """Reretrieve the configured customisation archive for the specified Web Bridge and push to memory. :param web_bridge_id: The ID of the web bridge for which to get information. :type web_bridge_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=76 .. seealso:: https://www.acano.com/publications/2013/08/Acano-solution-Deployment-Guide.pdf#page=47 .. note:: v1.8 upward """ return self.__open__("webBridges/" + web_bridge_id + "/updateCustomization", HTTPmethod = POST)
def _callBridges_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callBridges", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call_bridges(self, parameters = {}): """Get information on Call Bridges :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=76 .. note:: v1.8 upward """ return self._callBridges_node_(parameters = parameters, HTTPmethod = 'GET')
[docs] def create_call_bridge(self, payload = {}): """Set up a Call Bridge :param payload: Details the initial state of the call bridge :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=76 .. note:: v1.8 upward """ return self._callBridges_node_(payload = payload, HTTPmethod = 'POST')
def _callBridges_callBridgeID_node_(self, call_bridge_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callBridges/" + call_bridge_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_call_bridge(self, call_bridge_id, payload = {}): """Modify an existing Call Bridge :param call_bridge_id: The ID of the call bridge to modify :type call_bridge_id: String :param payload: Details the initial state of the call bridge :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=76 .. note:: v1.8 upward """ return self._callBridges_callBridgeID_node_(call_bridge_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_call_bridge(self, call_bridge_id): """Get information on a specific call bridge :param call_bridge_id: The ID of the call bridge to modify :type call_bridge_id: String :param payload: Details the initial state of the call bridge :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=76 .. note:: v1.8 upward """ return self._callBridges_callBridgeID_node_(call_bridge_id, HTTPmethod = 'GET')
def _system_configuration_xmpp_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("system/configuration/xmpp", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_xmpp_server(self): """Get information on the XMPP server .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=77 .. note:: v1.8 upward """ return self._system_configuration_xmpp_node_()
[docs] def create_xmpp_server(self, payload = {}): """Set up the XMPP server :param payload: The initial state of the XMPP server :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=77 .. note:: v1.8 upward """ return self._system_configuration_xmpp_node_(payload = payload, HTTPmethod = 'POST')
[docs] def modify_xmpp_server(self, payload = {}): """Modify the XMPP server details :param payload: The new state of the XMPP server :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=77 .. note:: v1.8 upward """ return self._system_configuration_xmpp_node_(payload = payload, HTTPmethod = 'PUT')
def _system_configuration_cluster_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("system/configuration/cluster", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call_bridge_cluster(self): """Get information on the call bridge cluster .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=77 .. note:: v1.8 upward """ return self._system_configuration_cluster_node_()
[docs] def create_call_bridge_cluster(self, payload = {}): """Set up the call bridge cluster :param payload: The initial state of the call bridge cluster :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=78 .. note:: v1.8 upward """ return self._system_configuration_cluster_node_(payload = payload, HTTPmethod = 'POST')
[docs] def modify_call_bridge_cluster(self, payload = {}): """Modify the existing call bridge cluster :param payload: The new state of the call bridge cluster :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=78 .. note:: v1.8 upward """ return self._system_configuration_cluster_node_(payload = payload, HTTPmethod = 'PUT')
[docs] def get_system_diagnostics(self): """Retrieve system diagnostics .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=78 .. note:: v1.8 upward """ return self.__open__("system/diagnostics")
[docs] def get_system_diagnostic(self, diagnostic_id): """Retrieve an individual system diagnostic :param diagnostic_id: The ID of the diagnostic to retrieve :type diagnostic_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=79 .. note:: v1.8 upward """ return self.__open__("system/diagnostics/" + diagnostic_id)
[docs] def get_system_diagnostic_contents(self, diagnostic_id): """Retrieve the contents of an individual system diagnostic :param diagnostic_id: The ID of the diagnostic to retrieve :type diagnostic_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=79 .. note:: v1.8 upward """ return self.__open__("system/diagnostics/" + diagnostic_id + "/contents")
def _ldapServers_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapServers", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_ldap_servers(self, parameters = {}): """Retrieve information on LDAP servers :param parameters: Details filters of the query :type parameters: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=79 .. note:: v1.8 upward """ return self._ldapServers_node_(parameters = parameters)
[docs] def create_ldap_server(self, payload = {}): """Add an LDAP server :param payload: Details the initial state of the LDAP server :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=81 .. note:: v1.8 upward """ return self._ldapServers_node_(payload = payload, HTTPmethod = 'POST')
def _ldapServers_ldapServerID_node_(self, ldap_server_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapServers/" + ldap_server_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_ldap_server(self, ldap_server_id, payload = {}): """Modify an existing LDAP server :param ldap_server_id: The ID of the LDAP server to modify :type ldap_server_id: dict :param payload: Details the new state of the LDAP server :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=81 .. note:: v1.8 upward """ return self._ldapServers_ldapServerID_node_(ldap_server_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_ldap_server(self, ldap_server_id): """Get an LDAP server, by ID :param ldap_server_id: The ID of the LDAP server to get :type ldap_server_id: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=81 .. note:: v1.8 upward """ return self._ldapServers_ldapServerID_node_(ldap_server_id)
def _ldapMappings_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapMappings", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_ldap_mappings(self): """Get LDAP mappings .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=84 .. note:: v1.8 upward """ return self._ldapMappings_node_()
[docs] def create_ldap_mapping(self, payload = {}): """Create an LDAP mapping :param payload: Details the initial state of the LDAP mapping :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=82 .. note:: v1.8 upward """ return self._ldapMappings_node_(payload = payload, HTTPmethod = 'POST')
def _ldapMappings_ldapMappingID_node_(self, ldap_mapping_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapMappings/" + ldap_mapping_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_ldap_mapping(self, ldap_mapping_id, payload = {}): """Modify an existing LDAP mapping :param ldap_mapping_id: Details the new state of the LDAP mapping :type ldap_mapping_id: String :param payload: Details the new state of the LDAP mapping :type payload: dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=82 .. note:: v1.8 upward """ return self._ldapMappings_ldapMappingID_node_(ldap_mapping_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_ldap_mapping(self, ldap_mapping_id): """Modify an existing LDAP mapping :param ldap_mapping_id: Details the ID of the LDAP mapping to get :type ldap_mapping_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=84 .. note:: v1.8 upward """ return self._ldapMappings_ldapMappingID_node_(ldap_mapping_id)
def _ldapSources_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapSources", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_ldap_sources(self): """Get LDAP sources .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=84 .. note:: v1.8 upward """ return self._ldapSources_node_()
[docs] def create_ldap_source(self, payload = {}): """Create an LDAP source :param payload: Details the initial state of the LDAP source :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=85 .. note:: v1.8 upward """ return self._ldapSources_node_(payload = {}, HTTPmethod = 'POST')
def _ldapSources_ldapSourceID_node_(self, ldap_source_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapSources/" + ldap_source_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_ldap_source(self, ldap_source_id, payload = {}): """Modify an existing LDAP source :param ldap_source_id: The ID of the LDAP source to modify :type ldap_source_id: String :param payload: Details the initial state of the LDAP source :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=85 .. note:: v1.8 upward """ return self._ldapSources_ldapSourceID_node_(ldap_source_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_ldap_source(self, ldap_source_id): """Get an LDAP source, by ID :param ldap_source_id: The ID of the LDAP source to get :type ldap_source_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=85 .. note:: v1.8 upward """ return self._ldapSources_ldapSourceID_node_(ldap_source_id)
def _ldapSyncs_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapSyncs", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_ldap_syncs(self, parameters = {}): """Monitor pending and in-progress LDAP syncs :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=85 .. note:: v1.8 upward """ return self._ldapSyncs_node_(parameters = parameters)
[docs] def initiate_ldap_sync(self, payload = {}): """Trigger a new LDAP sync :param parameters: Details parameters for the LDAP sync :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=86 .. note:: v1.8 upward """ return self._ldapSyncs_node_(payload = payload, HTTPmethod = 'POST')
def _ldapSyncs_ldapSyncID_node_(self, ldap_sync_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ldapSyncs/" + ldap_sync_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def cancel_ldap_sync(self, ldap_sync_id): """Cancel a scheduled LDAP sync. Will fail if the sync has already started. :param ldap_sync_id: The ID of the LDAP sync to cancel :type ldap_sync_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=86 .. note:: v1.8 upward """ return self._ldapSyncs_ldapSyncID_node_(ldap_sync_id, HTTPmethod = 'delete'.upper())
[docs] def get_ldap_sync(self, ldap_sync_id, parameters = {}): """Get information on a single LDAP sync :param ldap_sync_id: The ID of the LDAP sync to cancel :type ldap_sync_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=86 .. note:: v1.8 upward """ return self._ldapSyncs_ldapSyncID_node_(ldap_sync_id, parameters = parameters)
def _directorySearchLocations_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("directorySearchLocations", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_directory_search_locations(self): """Get information on external directory search locations: additional directory search locations to be consulted when users of Acano clients perform searches .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=87 .. note:: v1.8 upward """ return self._directorySearchLocations_node_()
[docs] def create_directory_search_location(self, payload = {}): """Add an external directory search location :param payload: Details the initial state of the directory search location :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=88 .. note:: v1.8 upward """ return self._directorySearchLocations_node_(payload = payload, HTTPmethod = 'POST')
def _directorySearchLocations_directorySearchLocationID_node_(self, directory_search_location_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("directorySearchLocations/" + directory_search_location_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_directory_search_location(self, directory_search_location_id, payload = {}): """Modify an existing external directory search location :param directory_search_location_id: The ID of the directory search location to modify :type directory_search_location_id: String :param payload: Details the new state of the directory search location :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=88 .. note:: v1.8 upward """ return self._directorySearchLocations_directorySearchLocationID_node_(directory_search_location_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_directory_search_location(self, directory_search_location_id): """Get a single external directory search location :param directory_search_location_id: The ID of the directory search location to get :type directory_search_location_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=88 .. note:: v1.8 upward """ return self._directorySearchLocations_directorySearchLocationID_node_(directory_search_location_id)
def _tenants_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("tenants", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_tenants(self, parameters = {}): """Retrieve tenants in the system :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=93 .. note:: v1.8 upward """ return self._tenants_node_(parameters = parameters)
[docs] def create_tenant(self, payload = {}): """Create a new tenant :param payload: Details the initial state of the tenant :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=94 .. note:: v1.8 upward """ return self._tenants_node_(payload = payload, HTTPmethod = 'POST')
def _tenants_tenantID_node_(self, tenant_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("tenants/" + tenant_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_tenant(self, tenant_id, payload = {}): """Modify an existing tenant :param tenant_id: The ID of the tenant to modify :type tenant_id: String :param payload: Details the new state of the tenant :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=94 .. note:: v1.8 upward """ return self._tenants_tenantID_node_(tenant_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_tenant(self, tenant_id): """Get a single tenant :param tenant_id: The ID of the tenant to get :type tenant_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=94 .. note:: v1.8 upward """ return self._tenants_tenantID_node_(tenant_id)
def _tenantGroups_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("tenantGroups", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_tenant_groups(self, parameters = {}): """Retrieve tenant groups in the system. :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=94 .. seealso:: https://www.acano.com/publications/2015/09/Acano-Solution-Multi-tenancy-Considerations1.pdf#page=6 .. note:: v1.8 upward """ return self._tenantGroups_node_(parameters = {})
[docs] def create_tenant_group(self, payload = {}): """Create a tenant group. :param payload: Details the initial state of the tenant :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=95 .. seealso:: https://www.acano.com/publications/2015/09/Acano-Solution-Multi-tenancy-Considerations1.pdf#page=6 .. note:: v1.8 upward """ return self._tenantGroups_node_(payload = payload, HTTPmethod = 'POST')
def _tenantGroups_tenantGroupID_node_(self, tenant_group_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("tenantGroups/" + tenant_group_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_tenant_group(self, tenant_group_id, payload = {}): """Modify an existing tenant group :param tenant_group_id: The ID of the tenant group to modify :type tenant_group_id: String :param payload: Details the new state of the tenant group :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=94 .. seealso:: https://www.acano.com/publications/2015/09/Acano-Solution-Multi-tenancy-Considerations1.pdf#page=6 .. note:: v1.8 upward """ return self._tenantGroups_tenantGroupID_node_(tenant_group_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_tenant_group(self, tenant_group_id): """Retrieve a single existing tenant group :param tenant_group_id: The ID of the tenant group to get :type tenant_group_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=94 .. seealso:: https://www.acano.com/publications/2015/09/Acano-Solution-Multi-tenancy-Considerations1.pdf#page=6 .. note:: v1.8 upward """ return self._tenantGroups_tenantGroupID_node_(tenant_group_id, HTTPmethod = 'GET')
[docs] def create_access_query(self, payload = {}): """The accessQuery method finds details of how a given URI or call ID (for example, one that could be associated with a coSpace) might be reached. One use is an external system discovering that a coSpace with URI "sales.meeting" would be reached via the SIP URI "sales.meeting@example.com". :param payload: Details the query :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=96 .. note:: v1.8 upward """ return self.__open__(payload = payload, HTTPmethod = 'POST')
def _coSpaces_coSpaceID_accessMethods_node_(self, coSpace_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("coSpaces/" + coSpace_id + "/accessMethods", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_coSpace_access_methods(self, coSpace_id, parameters = {}): """Retrieve the access methods for a coSpace. Access methods define URI / passcode / callID combinations that can be used to access a coSpace :param coSpace_id: The ID of the coSpace for which to retrieve access methods :type coSpace_id: String :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=32 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_accessMethods_node_(coSpace_id, parameters = parameters)
[docs] def create_coSpace_access_method(self, coSpace_id, payload = {}): """Create a new access method for a coSpace. Access methods define URI / passcode / callID combinations that can be used to access a coSpace :param coSpace_id: The ID of the coSpace for which to add an access method :type coSpace_id: String :param payload: Details the initial state of the access method :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=32 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_accessMethods_node_(coSpace_id, payload = payload, HTTPmethod = 'POST')
def _coSpaces_coSpaceID_accessmethods_accessMethodID_node_(self, coSpace_id, access_method_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("coSpaces/" + coSpace_id + "/accessMethods/" + access_method_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_coSpace_access_method(self, coSpace_id, access_method_id, payload = {}): """Modify an existing access method for a coSpace. Access methods define URI / passcode / callID combinations that can be used to access a coSpace :param coSpace_id: The ID of the coSpace in which to modify an access method :type coSpace_id: String :param access_method_id: The ID of the access method to modify. :type access_method_id: String :param payload: Details the new state of the access method :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=33 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_accessmethods_accessMethodID_node_(coSpace_id, access_method_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_coSpace_access_method(self, coSpace_id, access_method_id): """Retrieve a single access method for a coSpace. Access methods define URI / passcode / callID combinations that can be used to access a coSpace :param coSpace_id: The ID of the coSpace in which to get an access method :type coSpace_id: String :param access_method_id: The ID of the access method to get. :type access_method_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=33 .. note:: v1.8 upward """ return self._coSpaces_coSpaceID_accessmethods_accessMethodID_node_(self, coSpace_id, access_method_id, HTTPmethod = 'GET')
#Generates bad request. Not sure why... def _create_coSpace_diagnostics_(self, coSpace_id): return self.__open__("coSpaces/" + coSpace_id + "/diagnostics", HTTPmethod = 'POST') def _outboundDialPlanRules_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("outboundDialPlanRules", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_outbound_dial_plan_rules(self, parameters = {}): """Retrieve outbound dial plan rules. :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=35 .. note:: v1.8 upward """ return self._outboundDialPlanRules_node_(parameters = parameters)
[docs] def create_outbound_dial_plan_rule(self, payload = {}): """Create a new outbound dial plan rule. :param payload: Details the initial state of the dial plan rule. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=35 .. note:: v1.8 upward """ return self._outboundDialPlanRules_node_(payload = {}, HTTPmethod = 'POST')
def _outboundDialPlanRules_outboundDialPlanRuleID_node_(self, outbound_dial_plan_rule_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("outboundDialPlanRules/" + outbound_dial_plan_rule_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_outbound_dial_plan_rule(self, outbound_dial_plan_rule_id, payload = {}): """Create a new outbound dial plan rule. :param outbound_dial_plan_rule_id: The ID of the dial plan rule to modify :type outbound_dial_plan_rule_id: String :param payload: Details the new state of the dial plan rule. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=35 .. note:: v1.8 upward """ return self._outboundDialPlanRules_outboundDialPlanRuleID_node_(outbound_dial_plan_rule_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_outbound_dial_plan_rule(self, outbound_dial_plan_rule_id): """Retrieve a single outbound dial plan rule :param outbound_dial_plan_rule_id: The ID of the dial plan rule to retrieve :type outbound_dial_plan_rule_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=35 .. note:: v1.8 upward """ return self._outboundDialPlanRules_outboundDialPlanRuleID_node_(outbound_dial_plan_rule_id)
def _inboundDialPlanRules_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("inboundDialPlanRules", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_inbound_dial_plan_rules(self, parameters = {}): """Retrieve inbound dial plan rules. :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=37 .. note:: v1.8 upward """ return self._inboundDialPlanRules_node_(parameters = parameters)
[docs] def create_inbound_dial_plan_rule(self, payload = {}): """Create a new inbound dial plan rule. :param payload: Details the initial state of the dial plan rule. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=37 .. note:: v1.8 upward """ return self._inboundDialPlanRules_node_(payload = {}, HTTPmethod = 'POST')
def _inboundDialPlanRules_inboundDialPlanRuleID_node_(self, inbound_dial_plan_rule_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("inboundDialPlanRules/" + inbound_dial_plan_rule_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_inbound_dial_plan_rule(self, inbound_dial_plan_rule_id, payload = {}): """Create a new inbound dial plan rule. :param inbound_dial_plan_rule_id: The ID of the dial plan rule to modify :type inbound_dial_plan_rule_id: String :param payload: Details the new state of the dial plan rule. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=35 .. note:: v1.8 upward """ return self._inboundDialPlanRules_inboundDialPlanRuleID_node_(inbound_dial_plan_rule_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_inbound_dial_plan_rule(self, inbound_dial_plan_rule_id, parameters = {}): """Retrieve a single inbound dial plan rule. :param inbound_dial_plan_rule_id: The ID of the dial plan rule to retrieve :type inbound_dial_plan_rule_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=37 .. note:: v1.8 upward """ return self._inboundDialPlanRules_inboundDialPlanRuleID_node_(inbound_dial_plan_rule_id, parameters = parameters)
def _forwardingDialPlanRules_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("forwardingDialPlanRules", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_forwarding_dial_plan_rules(self, parameters = {}): """Retrieve the forwarding dial plan rules. :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=38 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=39 .. note:: v1.8 upward """ return self._forwardingDialPlanRules_node_(parameters)
[docs] def create_forwarding_dial_plan_rule(self, payload = {}): """Create a new forwarding dial plan rule. :param payload: Details the initial state of the rule :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=38 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=39 .. note:: v1.8 upward """ return self._forwardingDialPlanRules_node_(payload = payload, HTTPmethod = 'POST')
def _forwardingDialPlanRules_forwardingDialPlanRuleID_node_(self, forwarding_dial_plan_rule_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("forwardingDialPlanRules/" + forwarding_dial_plan_rule_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_forwarding_dial_plan_rule(self, forwarding_dial_plan_rule_id, payload = {}): """Modify an existing forwarding dial plan rule. :param forwarding_dial_plan_rule_id: The ID of the rule to modify :type forwarding_dial_plan_rule_id: Dict :param payload: Details the new state of the rule :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=38 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=39 .. note:: v1.8 upward """ return self._forwardingDialPlanRules_forwardingDialPlanRuleID_node_(forwarding_dial_plan_rule_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_forwarding_dial_plan_rule(self, forwarding_dial_plan_rule_id): """Retrieve a single forwarding dial plan rule. :param forwarding_dial_plan_rule_id: The ID of the rule to modify :type forwarding_dial_plan_rule_id: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=38 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=40 .. note:: v1.8 upward """ return self._forwardingDialPlanRules_forwardingDialPlanRuleID_node_(forwarding_dial_plan_rule_id)
def _calls_node(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("calls", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_calls(self, parameters = {}): """Retrieve information on active calls :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=41 .. note:: v1.8 upward """ return self._calls_node(parameters = parameters)
[docs] def create_call(self, payload = {}): """Create a new call :param payload: Details of the call :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=41 .. note:: v1.8 upward """ return self._calls_node(payload = payload, HTTPmethod = 'POST')
def _calls_callID_node(self, call_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("calls/" + call_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call(self, call_id): """Retrieve information on a single active call :param call_id: The ID of the call for which to retrieve information :type call_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=42 .. note:: v1.8 upward """ return self._calls_callID_node(call_id)
[docs] def delete_call(self, call_id): """Cancel an in-progress call :param call_id: The ID of the call :type call_id: String """ return self._calls_callID_node(call_id, HTTPmethod = "delete".upper())
def _callProfiles_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callProfiles", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call_profiles(self, parameters = {}): """Retrieve information on call profiles :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=97 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=42 .. note:: v1.8 upward """ return self._callProfiles_node_(parameters = parameters)
[docs] def create_call_profile(self, payload = {}): """Create a new call profile :param payload: Details the initial state of the call profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=97 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=43 .. note:: v1.8 upward """ return self._callProfiles_node_(payload = payload, HTTPmethod = 'POST')
def _callProfiles_callProfileID_node(self, call_profile_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callProfiles/" + call_profile_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_call_profile(self, call_profile_id, payload = {}): """Modify an existing call profile :param call_profile_id: The ID of the call profile to modify :type call_profile_id: String :param payload: Details the new state of the call profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=97 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=43 .. note:: v1.8 upward """ return self._callProfiles_callProfileID_node(call_profile_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_call_profile(self, call_profile_id): """Retrieve information on a single call profile :param call_profile_id: The ID of the call profile to modify :type call_profile_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=97 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=43 .. note:: v1.8 upward """ return self._callProfiles_callProfileID_node(call_profile_id)
def _callLegs_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callLegs", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call_legs(self, parameters = {}): """Retrieve information on call legs :param parameters: Details filter for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=43 .. note:: v1.8 upward """ return self._callLegs_node_(parameters = parameters)
[docs] def create_call_leg(self, call_id, payload = {}): """Create a new call leg :param call_id: The ID of the call for which to create the call leg :type call_id: String :param payload: Details the initial state of the call leg :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=45 .. note:: v1.8 upward """ return self.__open__("calls/" + call_id + "/callLegs", payload = payload, HTTPmethod = 'POST')
def _callLegs_callLegID_node_(self, call_leg_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callLegs/" + call_leg_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_call_leg(self, call_leg_id, payload = {}): """Modify an existing call leg :param call_leg_id: The ID of the call leg to modify :type call_leg_id: String :param payload: Details the new state of the call leg :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=45 .. note:: v1.8 upward """ return self._callLegs_callLegID_node_(call_leg_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_call_leg(self, call_leg_id): """Retrieve information on a single call leg. :param call_leg_id: The ID of the call leg to get :type call_leg_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=47 .. note:: v1.8 upward """ return self._callLegs_callLegID_node_(call_leg_id)
def _callLegProfiles_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callLegProfiles", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call_leg_profiles(self, parameters = {}): """Retrieve information on call leg profiles :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=48 .. note:: v1.8 upward """ return self._callLegProfiles_node_(parameters = parameters)
[docs] def create_call_leg_profile(self, payload = {}): """Create a new call leg profile :param payload: Details the initial state of the call leg profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=49 .. note:: v1.8 upward """ return self._callLegProfiles_node_(payload = payload, HTTPmethod = 'POST')
def _callLegProfiles_callLegProfileID_node_(self, call_leg_profile_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callLegProfiles/" + call_leg_profile_id, parameters = {}, payload = {}, HTTPmethod = HTTPmethod)
[docs] def modify_call_leg_profile(self, call_leg_profile_id, payload = {}): """Modify an existing call leg profile :param call_leg_profile_id: The ID of the call leg profile to modify :type call_leg_profile_id: String :param payload: Details the new state of the call leg profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=49 .. note:: v1.8 upward """ return self._callLegProfiles_callLegProfileID_node_(call_leg_profile_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_call_leg_profile(self, call_leg_profile_id): """Retrieve information on a single call leg profile :param call_leg_profile_id: The ID of the call leg profile to get :type call_leg_profile_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=51 .. note:: v1.8 upward """ return self._callLegProfiles_callLegProfileID_node_(call_leg_profile_id)
[docs] def get_call_leg_profile_trace(self, call_leg_id, parameters = {}): """Retrieve information on a call leg profile trace :param call_leg_id: The ID of the call leg to get :type call_leg_id: String :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=52 .. note:: v1.8 upward """ return self.__open__("callLegs/" + call_leg_profile_id + "/callLegProfileTrace", parameters = parameters)
def _dialTransforms_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("dialTransforms", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_dial_transforms(self, parameters = {}): """Retrieve information on transforms set up for outbound calls. :param call_leg_id: The ID of the call leg to get :type call_leg_id: String :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=54 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=55 .. note:: v1.6 upward """ return self._dialTransforms_node_(parameters = parameters)
[docs] def create_dial_transform(self, payload = {}): """Create a new dial transform for outbound calls :param payload: Details the initial state of the dial transform :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=54 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=55 .. note:: v1.6 upward """ return self._dialTransforms_node_(payload = payload, HTTPmethod = 'POST')
def _dialTransforms_dialTransformID_node_(self, dial_transform_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("dialTransforms/" + dial_transform_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_dial_transform(self, dial_transform_id, payload = {}): """Modify an existing dial transform :param dial_transform_id: The ID of the dial transform to modify :type dial_transform_id: String :param payload: Details the initial state of the dial transform :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=54 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=55 .. note:: v1.6 upward """ return self._dialTransforms_dialTransformID_node_(dial_transform_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_dial_transform(self, dial_transform_id): """Retrieve information on a single dial transform :param dial_transform_id: The ID of the dial transform to get :type dial_transform_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=54 .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=56 .. note:: v1.6 upward """ return self._dialTransforms_dialTransformID_node_(dial_transform_id)
def _callBrandingProfiles_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callBrandingProfiles", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_call_branding_profiles(self, parameters = {}): """Retrieve information on call branding profiles :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=57 .. note:: v1.6 upward """ return self._callBrandingProfiles_node_(parameters = parameters)
[docs] def create_call_branding_profile(self, payload = {}): """Create a call branding profile :param payload: Details the initial state of the call branding profile. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=57 .. note:: v1.6 upward """ return self._callBrandingProfiles_node_(payload = payload, HTTPmethod = 'POST')
def _callBrandingProfiles_callBrandingProfileID_node(self, call_branding_profile_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("callBrandingProfiles/" + call_branding_profile_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_call_branding_profile(self, call_branding_profile_id, payload = {}): """Modify an existing call branding profile :param call_branding_profile_id: The ID of the call branding profile to modify :type call_branding_profile_id: String :param payload: Details the new state of the call branding profile. :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=57 .. note:: v1.6 upward """ return self._callBrandingProfiles_callBrandingProfileID_node(call_branding_profile_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_call_branding_profile(self, call_branding_profile_id): """Retrieve information on a single call branding profile :param call_branding_profile_id: The ID of the call branding profile to get :type call_branding_profile_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=58 .. note:: v1.6 upward """ return self._callBrandingProfiles_callBrandingProfileID_node(call_branding_profile_id)
def _dtmfProfiles_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("dtmfProfiles", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_dtmf_profiles(self, parameters = {}): """Create a new DTMF profile :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=58 .. seealso:: https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling .. note:: v1.6 upward """ return self._dtmfProfiles_node_(parameters = parameters)
[docs] def create_dtmf_profile(self, payload = {}): """Create a DTMF profile :param payload: Details the initial state of the DTMF profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=59 .. seealso:: https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling .. note:: v1.6 upward """ return self._dtmfProfiles_node_(payload = payload, HTTPmethod = 'POST')
def _dtmfProfiles_dtmfProfileID_node_(self, dtmf_profile_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("dtmfProfiles/" + dtmf_profile_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_dtmf_profile(self, dtmf_profile_id, payload = {}): """Modify a DTMF profile :param dtmf_profile_id: The ID of the DTMF profile to modify :type dtmf_profile_id: String :param payload: Details the new state of the DTMF profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=59 .. seealso:: https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling .. note:: v1.6 upward """ return self._dtmfProfiles_dtmfProfileID_node_("dtmfProfiles/" + dtmf_profile_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_dtmf_profile(self, dtmf_profile_id): """Retrieve information on a single DTMF profile :param dtmf_profile_id: The ID of the DTMF profile to get :type dtmf_profile_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=59 .. seealso:: https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling .. note:: v1.6 upward """ return self._dtmfProfiles_dtmfProfileID_node_(dtmf_profile_id)
def _ivrs_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ivrs", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_ivrs(self, parameters = {}): """Retrieve information on IVRs :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=59 .. seealso:: https://en.wikipedia.org/wiki/Interactive_voice_response """ return self._ivrs_node_(parameters = parameters)
[docs] def create_ivr(self, payload = {}): """Create a new IVR :param payload: Details the initial state of the IVR :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=60 .. seealso:: https://en.wikipedia.org/wiki/Interactive_voice_response """ return self._ivrs_node_(payload = payload, HTTPmethod = 'POST')
def _ivrs_ivrID_node(self, ivr_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ivrs/" + ivr_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_ivr(self, ivr_id, payload = {}): """Modify an existing IVR :param ivr_id: The ID of the IVR to modify :type ivr_id: String :param payload: Details the new state of the IVR :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=60 .. seealso:: https://en.wikipedia.org/wiki/Interactive_voice_response """ return self._ivrs_ivrID_node(ivr_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_ivr(self, ivr_id): """Retrieve information on a single IVR :param ivr_id: The ID of the IVR to get :type ivr_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=60 .. seealso:: https://en.wikipedia.org/wiki/Interactive_voice_response """ return self._ivrs_ivrID_node(ivr_id)
def _ivrBrandingProfiles_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ivrBrandingProfiles", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_ivr_branding_profiles(self, parameters = {}): """Retrieve information IVR branding profiles :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=61 """ return self._ivrBrandingProfiles_node_(parameters = {})
[docs] def create_ivr_branding_profile(self, payload = {}): """Create a new IVR branding profile :param payload: Details the initial state of the profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=61 """ return self._ivrBrandingProfiles_node_(payload = payload, HTTPmethod = 'POST')
def _ivrBrandingProfiles_ivrBrandingProfileID_node_(self, ivr_branding_profile_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("ivrBrandingProfiles/" + ivr_branding_profile_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_ivr_branding_profile(self, ivr_branding_profile_id, payload = {}): """Modify an existing IVR branding profile :param ivr_branding_profile_id: The ID of the IVR branding profile to modify :type ivr_branding_profile_id: String :param payload: Details the new state of the profile :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=61 """ return self._ivrBrandingProfiles_ivrBrandingProfileID_node_(ivr_branding_profile_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_ivr_branding_profile(self, ivr_branding_profile_id): """Retrieve information on a single IVR branding profile :param ivr_branding_profile_id: The ID of the IVR branding profile to get :type ivr_branding_profile_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=61 """ return self._ivrBrandingProfiles_ivrBrandingProfileID_node_(ivr_branding_profile_id)
def _participants_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("participants", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_participants(self, parameters = {}): """Get information on participants :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=61 """ return self._participants_node_(parameters = parameters)
def _participants_participantID_node_(self, participant_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("participants/" + participant_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_participant(self, participant_id): """Get information on a participant :param participant_id: The ID of the participant to get :type participant_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=62 """ return self._participants_participantID_node_(participant_id)
[docs] def get_participant_call_legs(self, participant_id): """Get information on a participant's call legs :param participant_id: The ID of the participant for which to get call legs :type participant_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=63 """ return self.__open__("participant/" + participant_id + "callLegs", HTTPmethod = 'GET')
def _users_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("users", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_users(self, parameters = {}): """Get information on users :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=65 """ return self._users_node_(parameters = parameters)
def _users_userID_node_(self, user_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("users/" + user_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_user(self, user_id): """Get information on a single user :param user_id: The ID of the user :type user_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=65 """ return self._users_userID_node_(user_id)
def _users_userID_usercoSpaces_node_(self, user_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("users/" + user_id + "/usercoSpaces", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_user_coSpaces(self, user_id): """Get information on the coSpaces with which a user is currently associated :param user_id: The ID of the user :type user_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=65 """ return self._users_userID_usercoSpaces_node_(user_id)
def _recorders_node_(self, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("recorders", parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def get_recorders(self, parameters = {}): """Get information on meeting recorders :param parameters: Details filters for the query :type parameters: Dict .. seealso:: https://www.acano.com/publications/2016/06/Solution-API-Reference-R1_9.pdf#page=105 .. note:: v1.9 upward """ return self._recorders_node_(parameters = parameters)
[docs] def create_recorder(self, payload = {}): """Create a meeting recorder :param payload: Details the initial state of the recorder :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=106 .. note:: v1.9 upward """ return self._recorders_node_(payload = payload, HTTPmethod = 'POST')
def _recorders_recorderid_node(self, recorder_id, parameters = {}, payload = {}, HTTPmethod = 'GET'): return self.__open__("recorders/" + recorder_id, parameters = parameters, payload = payload, HTTPmethod = HTTPmethod)
[docs] def modify_recorder(self, recorder_id, payload = {}): """Modify an existing meeting recorder :param recorder_id: The ID of the recorder to modify :type recorder_id: String :param payload: Details the new state of the recorder :type payload: Dict .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=106 .. note:: v1.9 upward """ return self._recorders_recorderid_node(recorder_id, payload = payload, HTTPmethod = 'PUT')
[docs] def get_recorder(self, recorder_id): """Get information on a single recorder :param recorder_id: The ID of the recorder to get :type recorder_id: String .. seealso:: https://www.acano.com/publications/2015/09/Solution-API-Reference-R1_8.pdf#page=106 .. note:: v1.9 upward """ return self._recorders_recorderid_node(recorder_id)
# print(len(Acano.__dict__)) # ivrbpid = a.get_ivr_branding_profiles()["ivrBrandingProfiles"]["ivrBrandingProfile"][0]["@id"] # print(a.modify_ivr_branding_profile(ivrbpid, payload = { # 'resourceLocation' : "http://george.com" # })) # pp.pprint(a.get_ivr_branding_profile(ivrbpid)) # ivrid = a.get_ivrs()["ivrs"]["ivr"]["@id"] # print(a.modify_ivr(ivrid, payload = { # 'uri' : 'http://george.com' # })) # pp.pprint(a.get_ivr(ivrid)) # var = a.get_call_branding_profiles()["callBrandingProfiles"]["callBrandingProfile"][0]["@id"] # print(a.modify_call_branding_profile(var, payload = { # 'invitationTemplate' : "http://example.co" # })) # print(a.get_call_branding_profile(var)) # dtid = a.get_dial_transforms()["dialTransforms"]["dialTransform"]["@id"] # print(a.modify_dial_transform(dtid, payload = { # 'action' : 'deny', # 'priority' : 50, # 'type' : 'strip' # })) # pp.pprint(a.get_dial_transform(dtid)) # #csid = a.get_coSpaces()["coSpaces"]["coSpace"][0]["@id"] # #clid = a.get_call_legs()["callLegs"]["callLeg"]["@id"] # #print(clid) # #cid = a.get_calls()["calls"]["call"]["@id"] # #clpid = a.get_call_leg_profiles()["callLegProfiles"]["callLegProfile"]["@id"] # #pp.pprint(a.get_call_leg_profile_trace(clid)) # cdr_id = a.get_cdr_receivers()['cdrReceivers']['cdrReceiver']['@id'] # print(cdr_id) # print(a.get_cdr_receiver(cdr_id)) # print(a.get_cdr_receivers()) # #coSpaceID = var['coSpaces']['coSpace'][1]['@id'] # #print(a.get_coSpace_member(coSpaceID, "123")) # print(a.get_user_profiles()) # print(a.create_user_profile({ # 'cancreateCoSpaces' : 'true', # 'canCreateCalls' : 'true', # 'canUseExternalDevices' : 'true', # 'canMakePhoneCalls' : 'true', # 'userToUserMessagingAllowed' : 'true' # })) # #pp.pprint(var) # Example usage: get_coSpaces() # a = Acano("192.168.12.200", "administrator", "HelloCisco") # var = a.get_coSpaces({ # 'limit' : 5, # 'offset' : 5 # }) # print(var['coSpaces']['coSpace']) # #Create a coSpace # print(a.create_coSpace({ # 'name' : 'George\'s First Space', # 'uri' : 'http://gnisbet.com/comms.sip', # 'passcode' : '123', # 'defaultLayout' : 'allEqual' # })) # #Modifying a cospace # var = a.get_coSpaces() # coSpaceID = var['coSpaces']['coSpace'][1]['@id'] # a.modify_coSpace(coSpaceID, { # 'name' : 'EDITED, Muhfugger' # }) # def __params_to_string__(self, params): # tR = "" # first = True # for pair in params.items(): # if(first): # tR = pair[0] + "=" + str(pair[1]) + tR # else: # tR = pair[0] + "=" + str(pair[1]) + "&" + tR # #tR = tR + pair.key() + "=" + pair.value() # first = False # return "?" + tR # #TEST # params = { 'limit' : 10, 'offset' : 20} # a = Acano("192.168.12.200", "admin", "admin") # var = a.get_coSpaces(parameters = params_to_string(params)) # pp = pprint.PrettyPrinter(indent=1) # pp.pprint(var) # os.chdir(os.path.dirname(os.path.realpath(__file__))) # tree = ET.parse('config1.xml') # root = tree.getroot() # for child in root: # print(child.tag) # print(child.attrib) # def createDict(element): # tR = {} # #If the current element is a leaf node # if(len(list(element)) == 0 and len(list(element.attrib))==0): # return {element.tag : element.text} # #If the current element HAS GOT CHILDREN # if(len(list(element.attrib)) != 0): # for attrib in element.attrib: # return attrib # #tR["coSpaces"] = "Hello" # return tR # #print(createDict(root)) # #print(root) # def coSpaces_coSpaceid(self, coSpaceid, parameters): # return self.__open__("coSpaces" + coSpaceid, json.dumps(parameters).encode("utf-8")) # def callBrandingProfiles(self): # return self.__open__("callBrandingProfiles", None) # def callBrandingProfiles(self, parameters): # return self.__open__("callBrandingProfiles", json.dumps(parameters).encode("utf-8")) # def callBridges(self): # return self.__open__("callBridges", None) # def calls(self): # return self.__open__("calls", None) # def callLegs(self): # return self.__open__("callLegs", None) # def callLegProfiles(self): # return self.__open__("callLegProfiles", None) # username = "admin" # password = "admin" # almostThere = base64.b64encode(str.encode(username + ":" + password)) # almostThere = almostThere.decode("utf-8") # print("Basic YWRtaW46YWRtaW4=") # print("Basic " + almostThere) # print("Basic YWRtaW46YWRtaW4=" == "Basic " + almostThere) # ip = "192.168.12.200" # base = "https://" + ip + "/api/v1/" # fullLink = base + "coSpaces" # req = Request(fullLink) # username = "admin" # password = "admin" # req.add_header("Authorization", "Basic YWRtaW46YWRtaW4=") # #req.add_header("User-Agent", "API console") # #req.add_header("Connection", "keep-alive") # ctx = ssl.create_default_context() # ctx.check_hostname = False # ctx.verify_mode = ssl.CERT_NONE # print() # data="".encode("utf-8") # #urllib.request. # with urlopen(req, context = ctx) as f: # resp = f.read() # print(resp) # #print(result.read())