def cli_oxe_rainbow_rainbow_connect(host, rainbowdomain, pbxid, phonebook, activationcode, ini, filename): """Summary Args: host (TYPE): Description rainbowdomain (TYPE): Description pbxid (TYPE): Description phonebook (TYPE): Description activationcode (TYPE): Description ini (TYPE): Description filename (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) if ini is False: if rainbowdomain is None: print('--rainbowDomain option is mandatory. Exiting ...') exit(-1) if pbxid is None: print('--pbxId option is mandatory. Exiting ...') exit(-1) if activationcode is None: print('--activationCode option is mandatory. Exiting ...') exit(-1) else: rainbowdomain, pbxid, activationcode, rainbowhost = oxe_get_rainbow_config(filename) oxe_rainbow_connect(host, token, rainbowdomain, pbxid, activationcode, phonebook)
def cli_oxe_rainbow_rainbow_disconnect(host): """Summary Args: host (TYPE): Description """ token = oxe_get_auth_from_cache(host) oxe_rainbow_disconnect(host, token)
def cli_system_law(host, law): """Summary Args: host (TYPE): Description law (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_system_law(host, token, law)
def cli_oxe_delete_voice_mail(host): """Summary Args: host (TYPE): Description """ print('test on going on this feature\n') check_host_option(host) token = oxe_get_auth_from_cache(host) vm_create(host, token, vm_number='')
def cli_oxe_translator_prefix_create_dpnss(host, dpnss): """Summary Args: host (TYPE): Description dpnss (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_translator_prefix_create_dpnss(host, token, dpnss)
def cli_enable_ucaas_csta_sessions_monitored(host, sessions): """Summary Args: host (TYPE): Description sessions (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_system_ucaas_csta_sessions_monitored(host, token, sessions)
def cli_system_compression(host, compression): """Summary Args: host (TYPE): Description compression (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_system_compression_type(host, token, compression)
def cli_oxe_shelf_board_compressors_for_ip_devices(host, shelfid, compressors): """Summary Args: host (TYPE): Description shelfid (TYPE): Description compressors (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_shelf_board_compressors_for_ip_devices(host, token, shelfid, compressors)
def cli_oxe_shelf_create(host, shelfid, racksize): """Summary Args: host (TYPE): Description shelfid (TYPE): Description racksize (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_create_shelf(host, token, shelfid, racksize)
def cli_get_json_model(host): """Summary Args: host (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(str(host)) json_model = loads(oxe_get_json_model(host, token)) timestamp = datetime.now().strftime('%Y%m%d%H%M%S') with open(join(gettempdir(), 'OXE_' + host + '_' + timestamp + '.json'), 'w') as fh: fh.write(dumps(json_model, indent=2, sort_keys=True))
def cli_report_node_number(host, port, password): """Summary Args: host (TYPE): Description port (TYPE): Description password (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) net_number = oxe_netdata_get(host, 'NET_NBER', port, password) oxe_system_network_number(host, token, net_number)
def cli_delete_users(host, rangesize, rangestart): """Summary Args: host (TYPE): Description rangesize (TYPE): Description rangestart (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) bar = progressbar.ProgressBar() for extension_number in bar(range(int(rangestart), int(rangestart) + int(rangesize))): oxe_delete_user(host, token, extension_number, 10)
def cli_oxe_shelf_ethernet_parameters(host, shelfid, mac): """Summary Args: host (TYPE): Description shelfid (TYPE): Description mac (TYPE): Description """ check_host_option(host) if shelfid is None: print('--shelfId option is mandatory. Exiting ...') exit(-1) if mac is None: print('--mac option is mandatory. Exiting ...') exit(-1) token = oxe_get_auth_from_cache(host) oxe_shelf_ethernet_parameters(host, token, shelfid, mac)
def cli_enable_sip(host, trkid): """Summary Args: host (TYPE): Description trkid (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) oxe_sip_create_default_trunk_groups(host, token, trkid) oxe_sip_gateway(host, token, trkid) oxe_sip_proxy(host, token) oxe_ip_domain_deactivate_compression_default_ip_domain(host, token) oxe_system_compression_type(host, token) oxe_system_law(host, token) oxe_system_accept_mu_a_laws_in_sip(host, token, 'true') oxe_system_alaw_to_mulaw(host, token, 'true')
def cli_oxe_create_voice_mail(**kwargs): """Summary Args: **kwargs: Description """ print('test on going on this feature\n') host = kwargs.get('host') check_host_option(host) token = oxe_get_auth_from_cache(host) vm_number = kwargs.get('number') vm_accesses = kwargs.get('accesses') vm_name = kwargs.get('directory') vm_index = kwargs.get('index') port = kwargs.get('port') password = kwargs.get('password') vm_create_eva_cfg(host, port, password, vm_accesses) vm_create_eva_access(host, port, password, vm_accesses) vm_create(host, token, vm_accesses, vm_number, vm_name, vm_index, 'embedded')
def cli_create_users(host, rangesize, rangestart, settype, companyid, sipp): """Summary Args: host (TYPE): Description rangesize (TYPE): Description rangestart (TYPE): Description settype (TYPE): Description companyid (TYPE): Description sipp (TYPE): Description """ check_host_option(host) token = oxe_get_auth_from_cache(host) bar = progressbar.ProgressBar() for extension_number in bar(range(int(rangestart), int(rangestart) + int(rangesize))): last_name = 'LC' + '{:02}'.format(companyid) + 'U' + str(extension_number) first_name = 'FC' + '{:02}'.format(companyid) + 'U' + str(extension_number) oxe_create_user(host, token, extension_number, last_name, first_name, settype, 10) if settype == 'SIP_Extension' and sipp is True: sipp_csv_generator(host + '_' + str(rangesize) + 'users', host, rangestart, rangesize, '0000')
def cli_create_phonebook_entries(host, rangesize, rangestart, alias): """Summary Args: host (TYPE): Description rangesize (TYPE): Description rangestart (TYPE): Description alias (TYPE): Description """ print('Debug ongoing, OXE API is not working properly with the following request\n') check_host_option(host) token = oxe_get_auth_from_cache(host) bar = progressbar.ProgressBar() if 0 <= alias <= 15 or alias == 255: for extension_number in bar(range(rangestart, rangestart + rangesize)): oxe_create_phonebook_entry(host, token, extension_number, 'pb_ln' + str(extension_number), 'pb_fn' + str(extension_number), alias, 10) else: print('--alias value must be in following ranges 0 to 15, 255') exit(-1)
def cli_oxe_licensing_set_flex_server(host, flexip, port, reboot, sshport, password, swinstpassword): """Summary Args: host (TYPE): Description flexip (TYPE): Description port (TYPE): Description reboot (TYPE): Description sshport (TYPE): Description password (TYPE): Description swinstpassword (TYPE): Description """ check_host_option(host) if flexip is None: print('--ip option is mandatory. Exiting ...') exit(-1) token = oxe_get_auth_from_cache(host) oxe_set_flex(host, token, flexip, port) print('WARNING: OXE must be rebooted') if reboot is True: oxe_reboot(host, sshport, password, swinstpassword)