From ae81b40098035542104998fd30cc4848b153e92b Mon Sep 17 00:00:00 2001 From: usmanazFIU Date: Mon, 22 Jul 2024 14:53:01 -0500 Subject: [PATCH 1/9] sdx-spec-2.0 --- modules/circuits/views/nodes/nodes/nodes.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/circuits/views/nodes/nodes/nodes.php b/modules/circuits/views/nodes/nodes/nodes.php index a466966a..f94b6e61 100644 --- a/modules/circuits/views/nodes/nodes/nodes.php +++ b/modules/circuits/views/nodes/nodes/nodes.php @@ -442,16 +442,16 @@ function convertToEST(dateStr) { console.log(request); console.log(JSON.stringify(request)); - // $.ajax({ - // type: "POST", - // url: "https://"+meican_url+"/circuits/nodes/create", - // data: JSON.stringify(request), - // contentType: "application/json; charset=utf-8", - // success: function(data){alert(data);}, - // error: function(errMsg) { - // alert(errMsg); - // } - // }); + $.ajax({ + type: "POST", + url: "https://"+meican_url+"/circuits/nodes/create", + data: JSON.stringify(request), + contentType: "application/json; charset=utf-8", + success: function(data){alert(data);}, + error: function(errMsg) { + alert(errMsg); + } + }); }); From 2e8e6c8d6bc425ec447c2bd7e14da63e2ca7da47 Mon Sep 17 00:00:00 2001 From: usmanazFIU Date: Mon, 22 Jul 2024 14:59:26 -0500 Subject: [PATCH 2/9] sdx-spec-2.0 --- modules/circuits/views/nodes/nodes/list-connections.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index 0a5ca914..ed921458 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -218,7 +218,6 @@ function formatNestedPortData(portData) { formattedPortData += `Id: ${portData.id || ''}
`; formattedPortData += `Name: ${portData.name || ''}
`; formattedPortData += `Node: ${portData.node || ''}
`; - formattedPortData += `Short Name: ${portData.short_name || ''}
`; formattedPortData += `State: ${portData.state || ''}
`; formattedPortData += `Status: ${portData.status || ''}
`; return formattedPortData; From 407e17bb030952a5857177f43d63371789b71f79 Mon Sep 17 00:00:00 2001 From: ampath Date: Mon, 22 Jul 2024 22:46:11 -0400 Subject: [PATCH 3/9] MEICAN integration with SDX Controller #55 --- .../views/nodes/nodes/list-connections.php | 73 ++++++++++++------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index ed921458..b6ee6026 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -100,16 +100,17 @@ - - - - - + + + + + @@ -195,33 +196,51 @@ function formatJsonData(data) { formattedData += `Id: ${data.id || ''}
`; formattedData += `Name: ${data.name || ''}
`; - formattedData += `Quantity: ${data.quantity || ''}
`; - formattedData += `Start Time: ${data.start_time || ''}
`; - formattedData += `End Time: ${data.end_time || ''}
`; - formattedData += `Bandwidth Required: ${data.bandwidth_required || ''}
`; - formattedData += `Latency Required: ${data.latency_required || ''}
`; - formattedData += `Time Stamp: ${data.time_stamp || ''}
`; - formattedData += `Version: ${data.version || ''}
`; - - formattedData += `Egress Port:
`; - formattedData += `
${formatNestedPortData(data.egress_port || {})}
`; - formattedData += `Ingress Port:
`; - formattedData += `
${formatNestedPortData(data.ingress_port || {})}
`; + formattedData += `Description: ${data.description || ''}
`; + formattedData += `Start Time: ${data.scheduling.start_time || ''}
`; + formattedData += `End Time: ${data.scheduling.end_time || ''}
`; + + formattedData += `QoS Metrics:
`; + formattedData += `
${formatQosMetrics(data.qos_metrics)}
`; + + formattedData += `Notifications:
`; + data.notifications.forEach((notification, index) => { + formattedData += `
Email ${index + 1}: ${formatNotificationData(notification)}
`; + }); + + formattedData += `Endpoints:
`; + data.endpoints.forEach((endpoint, index) => { + formattedData += `
Interface ${index + 1}:
`; + formattedData += `
${formatEndpointData(endpoint)}
`; + }); return formattedData; } - // Function to format egress and ingress fields - function formatNestedPortData(portData) { - if (portData && Object.keys(portData).length > 0) { - let formattedPortData = ''; - formattedPortData += `Id: ${portData.id || ''}
`; - formattedPortData += `Name: ${portData.name || ''}
`; - formattedPortData += `Node: ${portData.node || ''}
`; - formattedPortData += `State: ${portData.state || ''}
`; - formattedPortData += `Status: ${portData.status || ''}
`; - return formattedPortData; + // Function to format each endpoint field + function formatEndpointData(endpoint) { + let formattedEndpointData = ''; + formattedEndpointData += `Port ID: ${endpoint.port_id || ''}
`; + formattedEndpointData += `VLAN: ${endpoint.vlan || ''}
`; + return formattedEndpointData; + } + + // Function to format each notification field + function formatNotificationData(notification) { + let formattedNotificationData = ''; + formattedNotificationData += `${notification.email || ''}
`; + return formattedNotificationData; + } + + // Function to format QoS metrics + function formatQosMetrics(qosMetrics) { + let formattedQosMetrics = ''; + if (qosMetrics) { + formattedQosMetrics += `Minimum Bandwidth: ${qosMetrics.min_bw.value || ''} (Strict: ${qosMetrics.min_bw.strict ? 'Yes' : 'No'})
`; + formattedQosMetrics += `Maximum Delay: ${qosMetrics.max_delay.value || ''} (Strict: ${qosMetrics.max_delay.strict ? 'Yes' : 'No'})
`; + formattedQosMetrics += `Maximum OXPs: ${qosMetrics.max_number_oxps.value || ''} (Strict: ${qosMetrics.max_number_oxps.strict ? 'Yes' : 'No'})
`; } + return formattedQosMetrics; } $(document).on('click', '.view-connection', function () { From c3a2f2758e125c792ad0d4d34343da02992e353e Mon Sep 17 00:00:00 2001 From: ampath Date: Tue, 23 Jul 2024 22:50:50 -0400 Subject: [PATCH 4/9] MEICAN integration with SDX Controller #55 --- .../views/nodes/nodes/list-connections.php | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index b6ee6026..139a7196 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -79,15 +79,10 @@ - - - - - - - - - + + + + - - - - - - + + + @@ -134,15 +126,10 @@
NameQuantityStart Time Order by:End Time Order by:Source PortDestination PortBandwidth Order by:NameConnection IDDescriptionEndPoints
- - - - - - - - - + + + + @@ -266,6 +253,7 @@ function formatQosMetrics(qosMetrics) { const connectionId = parsedData.id; const meican_url=""; const row = $(this).closest('tr'); + console.log("Connection ID", connectionId); $.ajax({ url: "https://"+meican_url+"/circuits/nodes/delete", From 93fbab5274d089288c719ae5339138f4a9daafc9 Mon Sep 17 00:00:00 2001 From: ampath Date: Tue, 23 Jul 2024 22:52:56 -0400 Subject: [PATCH 5/9] MEICAN integration with SDX Controller #55 --- modules/circuits/views/nodes/nodes/list-connections.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index 139a7196..9d94ed56 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -253,7 +253,6 @@ function formatQosMetrics(qosMetrics) { const connectionId = parsedData.id; const meican_url=""; const row = $(this).closest('tr'); - console.log("Connection ID", connectionId); $.ajax({ url: "https://"+meican_url+"/circuits/nodes/delete", From d7787848e8dc940f2989b60439fbb1baffd3829d Mon Sep 17 00:00:00 2001 From: ampath Date: Fri, 26 Jul 2024 02:04:41 -0400 Subject: [PATCH 6/9] MEICAN integration with SDX Controller #55 --- modules/circuits/views/nodes/nodes/list-connections.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index 9d94ed56..ed880688 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -91,12 +91,13 @@ if (is_array($connectionsData) && json_last_error() === JSON_ERROR_NONE) { foreach ($connectionsData as $connectionId => $connectionInfo) { + var_dump($connectionInfo['endpoints']); ?> - + @@ -261,6 +262,10 @@ function formatQosMetrics(qosMetrics) { contentType: "application/json; charset=utf-8", success: function(data){ row.remove(); + alert(data); + }, + error: function(errMsg) { + alert(errMsg); } }); }); From cecd3012c88e470010d10ffd375ab8fc342d7896 Mon Sep 17 00:00:00 2001 From: ampath Date: Fri, 26 Jul 2024 02:08:01 -0400 Subject: [PATCH 7/9] MEICAN integration with SDX Controller #55 --- modules/circuits/views/nodes/nodes/list-connections.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index ed880688..be755ee8 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -208,8 +208,8 @@ function formatJsonData(data) { // Function to format each endpoint field function formatEndpointData(endpoint) { let formattedEndpointData = ''; - formattedEndpointData += `Port ID: ${endpoint.port_id || ''}
`; - formattedEndpointData += `VLAN: ${endpoint.vlan || ''}
`; + formattedEndpointData += `ID: ${endpoint.id || ''}
`; + formattedEndpointData += `VLAN: ${endpoint.label_range || ''}
`; return formattedEndpointData; } From 30b4e67bdbd702f0e1142d259ee07746b6b55057 Mon Sep 17 00:00:00 2001 From: ampath Date: Fri, 26 Jul 2024 02:09:05 -0400 Subject: [PATCH 8/9] MEICAN integration with SDX Controller #55 --- modules/circuits/views/nodes/nodes/list-connections.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index be755ee8..3608879f 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -91,7 +91,6 @@ if (is_array($connectionsData) && json_last_error() === JSON_ERROR_NONE) { foreach ($connectionsData as $connectionId => $connectionInfo) { - var_dump($connectionInfo['endpoints']); ?>
From ddd933c5c0c375e8979f899eebd398a925ef85d1 Mon Sep 17 00:00:00 2001 From: ampath Date: Fri, 26 Jul 2024 02:27:11 -0400 Subject: [PATCH 9/9] MEICAN integration with SDX Controller #55 --- modules/circuits/controllers/NodesController.php | 1 + modules/circuits/views/nodes/nodes/list-connections.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/circuits/controllers/NodesController.php b/modules/circuits/controllers/NodesController.php index 753fdcbc..2e227b0a 100644 --- a/modules/circuits/controllers/NodesController.php +++ b/modules/circuits/controllers/NodesController.php @@ -101,6 +101,7 @@ public function actionDelete($connectionId) { $connection_response = curl_exec($curl); curl_close($curl); + echo $connection_response; } public function actionCreate(){ // this route manages the view and backend logic for creating a circuit request diff --git a/modules/circuits/views/nodes/nodes/list-connections.php b/modules/circuits/views/nodes/nodes/list-connections.php index 3608879f..7b1e98a6 100644 --- a/modules/circuits/views/nodes/nodes/list-connections.php +++ b/modules/circuits/views/nodes/nodes/list-connections.php @@ -259,12 +259,12 @@ function formatQosMetrics(qosMetrics) { type: "GET", data: { connectionId: connectionId }, contentType: "application/json; charset=utf-8", - success: function(data){ + success: function(data, textStatus, jqXHR) { row.remove(); - alert(data); + alert("Status: " + jqXHR.status + " - Response: " + data); }, - error: function(errMsg) { - alert(errMsg); + error: function(jqXHR, textStatus, errorThrown) { + alert("Status: " + jqXHR.status + " - Error: " + errorThrown); } }); });
NameQuantityStart Time Order by:End Time Order by:Source PortDestination PortBandwidth Order by:NameConnection IDDescriptionEndPoints