model_id=nec_ipasolink_model_id, login=nec_ipasolink_default_username, password=nec_ipasolink_default_password, management_address=context['ip_address'], management_port='22') StationDeviceObject.create() pretty_formatted_bar = list('-' * 12) Orchestration.update_asynchronous_task_details( *async_update_list, 'Creating managed entity for the station... [{}]'.format( ''.join(pretty_formatted_bar))) #Provision device StationDeviceObject.initial_provisioning() #Create station device order object context['station_device_id'] = StationDeviceObject.device_id StationOrderObject = Order(context['station_device_id']) #Wait until provisioning is done while StationDeviceObject.provision_status()['status'] != 'OK': pretty_formatted_bar.insert(0, '*') Orchestration.update_asynchronous_task_details( *async_update_list, 'Creating managed entity for the station... [{}]'.format( ''.join(pretty_formatted_bar))) time.sleep(5) #Attach configuration profile
from msa_sdk.device import Device from msa_sdk.variables import Variables context = Variables.task_call() new_device = Device(device_id=context['device_id']) new_device.initial_provisioning() print( new_device.process_content( 'ENDED', 'Device: ' + str(new_device.device_id) + ' provisioned successfully', context, True))
#IPAM order object IpamOrderObject = Order(ipam_device_id) #Create CE device object CeDeviceObject = Device(device_id = ce_device_id, device_external = ce_device_external_reference) pretty_formatted_bar = list('------------------------') Orchestration.update_asynchronous_task_details(*async_update_list, 'Provisioning of CE device... [{}]'.format(''.join(pretty_formatted_bar))) #If the device mgmt interface is REST-based, add required configuration variables if 'rest' in ce_local_context['interface'].lower(): for variable, value in ce_local_context['msa_specific']['rest_headers'].items(): CeDeviceObject.create_configuration_variable(name = variable, value = value) #Provision device CeDeviceObject.initial_provisioning() #Wait until provisioning is done while CeDeviceObject.provision_status()['status'] != 'OK': pretty_formatted_bar.insert(0,'*') Orchestration.update_asynchronous_task_details(*async_update_list, 'Provisioning of CE device... [{}]'.format(''.join(pretty_formatted_bar))) time.sleep(10) for counter in range(0, 24): pretty_formatted_bar.insert(0,'*') pretty_formatted_bar.pop() Orchestration.update_asynchronous_task_details(*async_update_list, 'Provisioning of CE device... [{}]'.format(''.join(pretty_formatted_bar))) time.sleep(5) Orchestration.update_asynchronous_task_details(*async_update_list, 'Provisioning of CE device... [{}] OK'.format(''.join(pretty_formatted_bar))) time.sleep(3)