def load(self, core): service = build_service() api.add_resource(SwitchboardList, '/switchboards', resource_class_args=(service, )) api.add_resource(SwitchboardStats, '/switchboards/<id>/stats', resource_class_args=(service, ))
def load(self, core): service = build_service() api.add_resource(UserEntityItem, '/users/<int:user_id>/entities/<int:entity_id>', '/users/<uuid:user_id>/entities/<int:entity_id>', endpoint='user_entities', resource_class_args=(service, user_dao)) api.add_resource(UserEntityList, '/users/<int:user_id>/entities', '/users/<uuid:user_id>/entities', resource_class_args=(service, user_dao))
def load(self, core): provd_client = core.provd_client() service = build_service(provd_client) api.add_resource(SipItem, '/endpoints/sip/<int:id>', endpoint='endpoint_sip', resource_class_args=(service, )) api.add_resource(SipList, '/endpoints/sip', resource_class_args=(service, ))
def load(self, core): service = build_service() api.add_resource(CallPermissionList, '/callpermissions', resource_class_args=(service,) ) api.add_resource(CallPermissionItem, '/callpermissions/<int:id>', endpoint='callpermissions', resource_class_args=(service,) )
def load(self, core): service = build_service() api.add_resource(UserVoicemailRoot, '/users/<int:user_id>/voicemail', '/users/<uuid:user_id>/voicemail', endpoint='user_voicemails', resource_class_args=(service, user_dao, voicemail_dao)) api.add_resource(VoicemailUserList, '/voicemails/<int:voicemail_id>/users', resource_class_args=(service, user_dao, voicemail_dao))
def load(self, core): provd_client = core.provd_client() service = build_service(provd_client) api.add_resource(LineItem, '/lines/<int:id>', endpoint='lines', resource_class_args=(service,) ) api.add_resource(LineList, '/lines', resource_class_args=(service,) )
def load(self, core): provd_client = core.provd_client() service = build_service(provd_client, infos_dao) api.add_resource(WizardResource, '/wizard', endpoint='wizard', resource_class_args=(service,) ) api.add_resource(WizardDiscoverResource, '/wizard/discover', resource_class_args=(service,) )
def load(self, core): provd_client = core.provd_client() dao = build_dao(provd_client) service = build_service(dao) api.add_resource(DeviceItem, '/devices/<id>', endpoint='devices', resource_class_args=(service, )) api.add_resource(DeviceList, '/devices', resource_class_args=(service, )) api.add_resource(DeviceAutoprov, '/devices/<id>/autoprov', resource_class_args=(service, )) api.add_resource(DeviceSynchronize, '/devices/<id>/synchronize', resource_class_args=(service, ))
def load_custom(self, provd_client): service = self.build_custom_service(provd_client) api.add_resource( LineEndpointAssociationCustom, '/lines/<int:line_id>/endpoints/custom/<int:endpoint_id>', endpoint='line_endpoint_custom', resource_class_args=(service, )) api.add_resource(LineEndpointGetCustom, '/lines/<int:line_id>/endpoints/custom', resource_class_args=(service, )) api.add_resource(EndpointLineGetCustom, '/endpoints/custom/<int:endpoint_id>/lines', resource_class_args=(service, ))
def load_sccp(self, provd_client): service = self.build_sccp_service(provd_client) api.add_resource( LineEndpointAssociationSccp, '/lines/<int:line_id>/endpoints/sccp/<int:endpoint_id>', endpoint='line_endpoint_sccp', resource_class_args=(service, )) api.add_resource(LineEndpointGetSccp, '/lines/<int:line_id>/endpoints/sccp', resource_class_args=(service, )) api.add_resource(EndpointLineGetSccp, '/endpoints/sccp/<int:endpoint_id>/lines', resource_class_args=(service, ))
def load(self, core): service = build_service() class_args = (service, line_dao, extension_dao) legacy_class_args = (service, line_dao, extension_dao, line_extension_dao) api.add_resource(LineExtensionItem, '/lines/<int:line_id>/extensions/<int:extension_id>', endpoint='line_extensions', resource_class_args=class_args) api.add_resource(LineExtensionList, '/lines/<int:line_id>/extensions', resource_class_args=class_args) api.add_resource(LineExtensionLegacy, '/lines/<int:line_id>/extension', endpoint='line_extension_legacy', resource_class_args=legacy_class_args) api.add_resource(ExtensionLineLegacy, '/extensions/<int:extension_id>/line', resource_class_args=legacy_class_args)
def load(self, core): provd_client = core.provd_client() device_dao = build_device_dao(provd_client) service = build_service(provd_client) api.add_resource(LineDeviceAssociation, '/lines/<int:line_id>/devices/<device_id>', endpoint='line_devices', resource_class_args=(line_dao, device_dao, service)) api.add_resource(LineDeviceGet, '/lines/<int:line_id>/devices', resource_class_args=(line_dao, device_dao, service)) api.add_resource(DeviceLineGet, '/devices/<device_id>/lines', resource_class_args=(line_dao, device_dao, service))
def load(self, core): service = build_service() api.add_resource(UserLineItem, '/users/<int:user_id>/lines/<int:line_id>', '/users/<uuid:user_id>/lines/<int:line_id>', endpoint='user_lines', resource_class_args=(service, user_dao, line_dao) ) api.add_resource(UserLineList, '/users/<int:user_id>/lines', '/users/<uuid:user_id>/lines', resource_class_args=(service, user_dao, line_dao) ) api.add_resource(LineUserList, '/lines/<int:line_id>/users', resource_class_args=(service, user_dao, line_dao) )
def load(self, core): service = build_service() api.add_resource( UserCallPermissionAssociation, '/users/<uuid:user_id>/callpermissions/<call_permission_id>', '/users/<int:user_id>/callpermissions/<call_permission_id>', endpoint='user_call_permissions', resource_class_args=(service, user_dao, call_permission_dao)) api.add_resource(UserCallPermissionGet, '/users/<uuid:user_id>/callpermissions', '/users/<int:user_id>/callpermissions', resource_class_args=(service, user_dao, call_permission_dao)) api.add_resource(CallPermissionUserGet, '/callpermissions/<call_permission_id>/users', resource_class_args=(service, user_dao, call_permission_dao))
def load(self, core): api.add_resource( UserLineAssociatedEndpointSipMain, '/users/<uuid:user_uuid>/lines/main/associated/endpoints/sip', )
def load(self, core): provd_client = core.provd_client() service = build_service(provd_client) service_callservice = build_service_callservice() service_forward = build_service_forward() api.add_resource(UserItem, '/users/<uuid:id>', '/users/<int:id>', endpoint='users', resource_class_args=(service,) ) api.add_resource(UserList, '/users', endpoint='users_list', resource_class_args=(service,) ) api.add_resource(UserServiceDND, '/users/<uuid:user_id>/services/dnd', '/users/<int:user_id>/services/dnd', resource_class_args=(service_callservice,) ) api.add_resource(UserServiceIncallFilter, '/users/<uuid:user_id>/services/incallfilter', '/users/<int:user_id>/services/incallfilter', resource_class_args=(service_callservice,) ) api.add_resource(UserServiceList, '/users/<uuid:user_id>/services', '/users/<int:user_id>/services', resource_class_args=(service_callservice,) ) api.add_resource(UserForwardBusy, '/users/<uuid:user_id>/forwards/busy', '/users/<int:user_id>/forwards/busy', resource_class_args=(service_forward,) ) api.add_resource(UserForwardNoAnswer, '/users/<uuid:user_id>/forwards/noanswer', '/users/<int:user_id>/forwards/noanswer', resource_class_args=(service_forward,) ) api.add_resource(UserForwardUnconditional, '/users/<uuid:user_id>/forwards/unconditional', '/users/<int:user_id>/forwards/unconditional', resource_class_args=(service_forward,) ) api.add_resource(UserForwardList, '/users/<uuid:user_id>/forwards', '/users/<int:user_id>/forwards', resource_class_args=(service_forward,) )
def load(self, core): provd_client = core.provd_client() user_service = build_user_service(provd_client) user_voicemail_service = build_uv_service() voicemail_service = build_voicemail_service() line_service = build_line_service(provd_client) sip_service = build_sip_service(provd_client) sccp_service = build_sccp_service() line_sip_service = build_le_service(provd_client, 'sip', sip_service) line_sccp_service = build_le_service(provd_client, 'sccp', sccp_service) extension_service = build_extension_service(provd_client) user_line_service = build_ul_service() line_extension_service = build_line_extension_service() call_permission_service = build_call_permission_service() user_call_permission_service = build_user_call_permission_service() creators = { 'user': UserCreator(user_service), 'line': LineCreator(line_service), 'voicemail': VoicemailCreator(voicemail_service), 'sip': SipCreator(sip_service), 'sccp': SccpCreator(sccp_service), 'extension': ExtensionCreator(extension_service), 'incall': IncallCreator(extension_service), 'cti_profile': CtiProfileCreator(cti_profile_dao), 'call_permissions': CallPermissionCreator(call_permission_service), } entry_creator = EntryCreator(creators) associators = OrderedDict([ ('voicemail', VoicemailAssociator(user_voicemail_service)), ('cti_profile', CtiProfileAssociator(user_cti_profile_service, cti_profile_dao)), ('sip', SipAssociator(line_sip_service)), ('sccp', SccpAssociator(line_sccp_service)), ('line', LineAssociator(user_line_service)), ('extension', ExtensionAssociator(line_extension_service)), ('incall', IncallAssociator(line_extension_service)), ('call_permissions', CallPermissionAssociator(user_call_permission_service, call_permission_service)), ]) entry_associator = EntryAssociator(associators) entry_finder = EntryFinder(user_dao, voicemail_dao, user_voicemail_dao, cti_profile_dao, user_cti_profile_dao, line_dao, user_line_dao, sip_dao, sccp_dao, extension_dao, incall_dao, call_permission_dao, user_call_permission_dao) entry_updater = EntryUpdater(creators, associators, entry_finder) service = ImportService(entry_creator, entry_associator, entry_updater) api.add_resource(UserImportResource, '/users/import', resource_class_args=(service, )) api.add_resource(UserExportResource, '/users/export')