Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Decommission_CE_Remove_CE_and_update_IPAM.py</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1606077676711</value>
<value>1613065059594</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1606077676704</value>
<value>1613065059589</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>General_network_service_automation.xml</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1606077677406</value>
<value>1613143839654</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1606077677403</value>
<value>1613143839647</value>
</entry>
<entry>
<key>MODEL</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>New_CE_Provision_and_activate_CE_device.py</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1602160641226</value>
<value>1613143838873</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1602160641214</value>
<value>1613143838869</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>New_L3VPN_Configure_CE_-_PE_connections.py</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1601980973728</value>
<value>1613142201550</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1601980973719</value>
<value>1613142201545</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Remove_L3VPN_Clean_up_IPAM.py</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1606074391321</value>
<value>1613065045994</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1606074391314</value>
<value>1613065045989</value>
</entry>
<entry>
<key>TAG</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

#Find CE device name
Orchestration.update_asynchronous_task_details(*async_update_list, 'Retrieve information about CE device on the site... ')
while ce_device_name is None or counter < len(objects_list):
while ce_device_name is None and counter < len(objects_list):
util.log_to_process_file(process_id, 'DEBUG: {}'.format(IpamOrderObject.command_objects_instances_by_id(ms_ipam_device, objects_list[counter])))
device_object = IpamOrderObject.command_objects_instances_by_id(ms_ipam_device,
objects_list[counter])[ms_ipam_device][objects_list[counter]]
Expand Down Expand Up @@ -119,7 +119,6 @@
Orchestration.update_asynchronous_task_details(*async_update_list, 'Update IPAM... OK')
time.sleep(3)


success_comment = 'CE device has been moved to {} on site {}'.format(context['status'], context['site'])
del context['status']
del context['site']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ObjectDefinition>
<variables frozen="0">
<variable displayName="Customer name" name="params.customer_name" startIncrement="0" type="String" mandatoryArray="false" visible="true" description="" groupSeparator="" groupDisplayName="" displayOrder="0" increment="0" refServiceURI="" keepOnImport="false" editable="true" onlyDetailView="false" localVarNameMatch="" remoteVarNameMatch="" arrayCanAdd="true" arrayCanRemove="true" arrayCanMove="true" arrayCanEdit="true" default="Planet Express Inc." isMandatory="false" isUserLocked="false" isGrouped="false" isSearchable="false" isUniqueGlobal="false"/>
<variable displayName="IPAM ME" name="params.ipam_device_id" startIncrement="0" type="Device" mandatoryArray="false" visible="true" description="" groupSeparator="" groupDisplayName="" displayOrder="0" increment="0" refServiceURI="" keepOnImport="false" editable="false" onlyDetailView="false" localVarNameMatch="" remoteVarNameMatch="" arrayCanAdd="true" arrayCanRemove="true" arrayCanMove="true" arrayCanEdit="true" displayNameHeader="" fullDisplayName="" isMandatory="false" isUserLocked="false" isGrouped="false" isSearchable="false" isUniqueGlobal="false">
<variable displayName="IPAM ME" name="params.ipam_device_id" startIncrement="0" type="Device" mandatoryArray="false" visible="true" description="" groupSeparator="" groupDisplayName="" displayOrder="0" increment="0" refServiceURI="" keepOnImport="false" editable="false" onlyDetailView="false" localVarNameMatch="" remoteVarNameMatch="" arrayCanAdd="true" arrayCanRemove="true" arrayCanMove="true" arrayCanEdit="true" displayNameHeader="" fullDisplayName="" default="UBI1244" isMandatory="false" isUserLocked="false" isGrouped="false" isSearchable="false" isUniqueGlobal="false">
<sdTypes>
<sdTypes manId="191119" modId="29092020"/>
</sdTypes>
Expand All @@ -23,6 +23,7 @@
<displayName>Start to work with customer</displayName>
<type>CREATE</type>
<visibility>0</visibility>
<allowSchedule/>
<task name="Start_to_work_with_customer_Define_variables.py">
<processPath>/opt/fmc_repository/Process/General_Network_Service_Automation</processPath>
<displayName>Define variables</displayName>
Expand All @@ -36,11 +37,13 @@
<displayName>Delete</displayName>
<type>DELETE</type>
<visibility>5</visibility>
<allowSchedule/>
</process>
<process name="Process/General_Network_Service_Automation/New_CE">
<displayName>New CE</displayName>
<type>UPDATE</type>
<visibility>0</visibility>
<allowSchedule/>
<task name="New_CE_Create_CE_device.py">
<processPath>/opt/fmc_repository/Process/General_Network_Service_Automation</processPath>
<displayName>Create CE device</displayName>
Expand All @@ -54,6 +57,7 @@
<displayName>New L3VPN</displayName>
<type>UPDATE</type>
<visibility>5</visibility>
<allowSchedule/>
<task name="New_L3VPN_Prepare_IP_address_schema.py">
<processPath>/opt/fmc_repository/Process/General_Network_Service_Automation</processPath>
<displayName>Prepare IP address schema</displayName>
Expand All @@ -71,11 +75,13 @@
<displayName>New L2VPN</displayName>
<type>UPDATE</type>
<visibility>5</visibility>
<allowSchedule/>
</process>
<process name="Process/General_network_service_automation/Remove_L3VPN">
<displayName>Remove L3VPN</displayName>
<type>UPDATE</type>
<visibility>5</visibility>
<allowSchedule/>
<task name="Remove_L3VPN_Gather_information_from_IPAM.py">
<processPath>/opt/fmc_repository/Process/General_Network_Service_Automation</processPath>
<displayName>Gather information from IPAM</displayName>
Expand All @@ -93,6 +99,7 @@
<displayName>Decommission CE</displayName>
<type>UPDATE</type>
<visibility>5</visibility>
<allowSchedule/>
<task name="Decommission_CE_Remove_CE_and_update_IPAM.py">
<processPath>/opt/fmc_repository/Process/General_Network_Service_Automation</processPath>
<displayName>Remove CE and update IPAM</displayName>
Expand All @@ -104,7 +111,7 @@
<displayField>service_id</displayField>
<serviceTaskType>python</serviceTaskType>
<order>10000</order>
<visibility>0</visibility>
<visibility>5</visibility>
<name>General network service automation</name>
<group/>
</information>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,49 +55,42 @@
#Create CE device object
CeDeviceObject = Device(device_id = ce_device_id,
device_external = ce_device_external_reference)
pretty_formatted_bar = list('------------------------')
pretty_formatted_bar = list(10*'-')
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)

#Attach configuration profile
Orchestration.update_asynchronous_task_details(*async_update_list, 'Attaching configuration deployment settings profile... ')
CeDeviceObject.profile_attach(ce_local_context['msa_specific']['deployment_settings_ref'])
Orchestration.update_asynchronous_task_details(*async_update_list, 'Attaching configuration deployment settings profile... OK')
time.sleep(3)

#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)
time.sleep(5)

for counter in range(0, 24):
for counter in range(0, 10):
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)
time.sleep(3)

Orchestration.update_asynchronous_task_details(*async_update_list, 'Provisioning of CE device... [{}] OK'.format(''.join(pretty_formatted_bar)))
time.sleep(3)



#Attach configuration profile
Orchestration.update_asynchronous_task_details(*async_update_list, 'Attaching configuration deployment settings profile... ')
CeDeviceObject.profile_attach(ce_local_context['msa_specific']['deployment_settings_ref'])



#Create CE device order object
CeOrderObject = Order(ce_device_id)
response = CeOrderObject.command_synchronize(300)

device_object = IpamOrderObject.command_objects_instances_by_id(ms_ipam_device,
ce_device_name)[ms_ipam_device][ce_device_name.replace('.', '_')]

Orchestration.update_asynchronous_task_details(*async_update_list, 'Attaching configuration deployment settings profile... OK')

Orchestration.update_asynchronous_task_details(*async_update_list, 'Marking device {} as "ACTIVE" in IPAM system...'.format(ce_device_name))
#Mark the device as Active in IPAM
ms_dict = {ms_ipam_device:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
Orchestration.update_asynchronous_task_details(*async_update_list, 'Configuring PE device... BGP peer for {}... OK'.format(ce_device_name))
pe_order_list[-1].command_synchronize(300)

pretty_formatted_bar = list('------------')
pretty_formatted_bar = list(12*'-')
for counter in range(0, 12):
pretty_formatted_bar.insert(0,'*')
pretty_formatted_bar.pop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@

IpamOrderObject.command_synchronize(300)


#Clean up context
del context['ce_connections']
del context['ce_device_details']
Expand Down
4 changes: 2 additions & 2 deletions Topology/.meta_Topology.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<map>
<entry>
<key>DATE_MODIFICATION</key>
<value>1606224624688</value>
<value>1602162156567</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1606224624662</value>
<value>1602162156561</value>
</entry>
<entry>
<key>MODEL</key>
Expand Down
35 changes: 14 additions & 21 deletions Topology/Common/Topology_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,8 @@ function topology_update_service_view($ipam_device_id) {

logToFile("*** topology_update_view");

if (!isset($context ["Nodes"])) {
$context ['Nodes'] = array ();
}

if (!isset($context ["Nodes_MAJ"])) {
$context ['Nodes_MAJ'] = array ();
}

$context ['Nodes'] = array ();
$context ['Nodes_MAJ'] = array ();

$response = json_decode(import_objects($ipam_device_id, array('vrf')), True);
$object_ids_array = $response['wo_newparams']['vrf'];
Expand Down Expand Up @@ -199,10 +193,17 @@ function topology_update_view() {
function processDevice($device_id, $name, $device_nature, $status) {
logToFile("*** processDevice <$name> ID: $device_id STATUS: $status");
try {
if($status == "OK") {
calculateDeviceTopology($device_id, $name, $device_nature, $status);
//$status = getStatus($device_id);
if($status == "UP") {
calculateDeviceTopology($device_id, $name, $device_nature);
} else {
createTopology($device_id, $name, $device_nature, "router", "", $status);
if($status == "UNREACHABLE") {
createTopology($device_id, $name, $device_nature, "router", "style/topology/img/router_ERROR.svg");
} else if($status == "NEVERREACHED") {
createTopology($device_id, $name, $device_nature, "router", "style/topology/img/router_NEVERREACHED.svg");
} else if($status == "CRITICAL") {
createTopology($device_id, $name, $device_nature, "router", "style/topology/img/router_CRITICAL.svg");
}
}
} catch (Exception $e) {
logTofile(debug_dump($e, "************** processDevice ERROR **************"));
Expand All @@ -214,19 +215,11 @@ function processDevice($device_id, $name, $device_nature, $status) {
function getStatus($device_id) {
$info = json_decode(_device_get_status($device_id), true);
$status = $info ["wo_newparams"];
logToFile("*** getStatus <$device_id> => $status");


if (empty($status) || $status == "") {
return "Managed Entity with id " . $device_id . " was not found";
} else {
if ($status == "UP") {
return "OK";
} else if ($status == "UNREACHABLE") {
return "ERROR";
} else if ($status == "CRITICAL") {
return "CRITICAL";
}
return "NEVERREACHED";
return $status;
}
}

Expand Down
Loading