示例#1
0
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))
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.read()
new_device.ping(new_device.management_address)

print(
    new_device.process_content(
        'ENDED',
        'Pinging IP: ' + new_device.management_address + ' successfully',
        context, True))
Orchestration.update_asynchronous_task_details(
    *async_update_list,
    'Attaching configuration deployment settings profile... ')
StationDeviceObject.profile_attach(nec_ipasolink_profile_name)
Orchestration.update_asynchronous_task_details(
    *async_update_list,
    'Attaching configuration deployment settings profile... OK')

for counter in range(0, 12):
    pretty_formatted_bar.insert(0, '*')
    pretty_formatted_bar.pop()
    Orchestration.update_asynchronous_task_details(
        *async_update_list,
        'Creating managed entity for the station... [{}]'.format(
            ''.join(pretty_formatted_bar)))
    time.sleep(5)

#Sync up microservices
response = StationOrderObject.command_synchronize(300)

Orchestration.update_asynchronous_task_details(
    *async_update_list,
    'Creating managed entity for the station... [{}] OK'.format(
        ''.join(pretty_formatted_bar)))
time.sleep(3)

success_comment = 'Microwave station managed entity created sucessfully.'
print(
    StationDeviceObject.process_content('ENDED', success_comment, context,
                                        True))
示例#4
0
from msa_sdk.device import Device
from msa_sdk.variables import Variables
from msa_sdk.msa_api import MSA_API

dev_var = Variables()

dev_var.add('customer_id', var_type='Customer')
dev_var.add('managed_device_name')
dev_var.add('manufacturer_id', var_type='Integer')
dev_var.add('model_id', var_type='Integer')
dev_var.add('device_ip_address', var_type='IP Address', def_value='10.30.19.41')
dev_var.add('login')
dev_var.add('password', var_type='Password')
dev_var.add('password_admin', var_type='Password')

context = Variables.task_call(dev_var)

new_device = Device(context['customer_id'], context['managed_device_name'], context['manufacturer_id'],context['model_id'], context['login'], context['password'], context['password_admin'],context['device_ip_address'])
new_device.create()
context['device_id'] = new_device.device_id

print(new_device.process_content('ENDED', 'Task OK', context, True))