kytos-ng / telemetry_int

Kytos Telemetry Napp
MIT License
0 stars 2 forks source link

feat: handled kytos/mef_eline.uni_active_updated #91

Closed viniarck closed 2 months ago

viniarck commented 2 months ago

Closes #89

This is on top of PR #88

Summary

See updated changelog file

Local Tests

kytos $> 2024-04-24 15:17:21,170 - INFO [kytos.napps.kytos/of_core] (MainThread) PortStatus modified interface 00:00:00:00:00:00:00:01:15 state OFPPS_LINK_DOWN
2024-04-24 15:17:21,272 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_56) Event handle_interface_link_down Interface('novi_port_15', 15, Switch('00:00:00:00:00:00:00:01'))
2024-04-24 15:17:21,273 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_56) Deactivating EVC 5608a913b43c4b. Interfaces: {'00:00:00:00:00:00:00:01:15': {'status': 'DOWN', 'status_r
eason': {'deactivated'}}}.
2024-04-24 15:17:21,278 - INFO [kytos.napps.kytos/telemetry_int] (MainThread) Handling mef_eline.uni_active_updated active False on EVC id: 5608a913b43c4b
2024-04-24 15:17:21,284 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_56) Deactivating EVC 2d097665300b4f. Interfaces: {'00:00:00:00:00:00:00:01:15': {'status': 'DOWN', 'status_r
eason': {'deactivated'}}}.
2024-04-24 15:17:21,295 - INFO [kytos.napps.kytos/telemetry_int] (MainThread) Handling mef_eline.uni_active_updated active False on EVC id: 2d097665300b4f
2024-04-24 15:17:21,315 - INFO [uvicorn.access] (MainThread) 127.0.0.1:60434 - "POST /api/kytos/mef_eline/v2/evc/metadata HTTP/1.1" 201
2024-04-24 15:17:21,318 - INFO [uvicorn.access] (MainThread) 127.0.0.1:60450 - "POST /api/kytos/mef_eline/v2/evc/metadata HTTP/1.1" 201
2024-04-24 15:17:27,258 - INFO [uvicorn.access] (MainThread) 127.0.0.1:58706 - "GET /api/kytos/mef_eline/v2/evc/5608a913b43c4b HTTP/1.1" 200
2024-04-24 15:17:39,385 - INFO [kytos.napps.kytos/of_core] (MainThread) PortStatus modified interface 00:00:00:00:00:00:00:01:15 state OFPPS_LIVE
2024-04-24 15:17:39,488 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_8) Event handle_interface_link_up Interface('novi_port_15', 15, Switch('00:00:00:00:00:00:00:01'))
2024-04-24 15:17:39,488 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_8) Activating EVC 5608a913b43c4b. Interfaces: {'00:00:00:00:00:00:00:01:15': {'status': 'UP', 'status_reason
': set()}, '00:00:00:00:00:00:00:06:22': {'status': 'UP', 'status_reason': set()}}.
2024-04-24 15:17:39,489 - INFO [kytos.napps.kytos/telemetry_int] (MainThread) Handling mef_eline.uni_active_updated active True on EVC id: 5608a913b43c4b
2024-04-24 15:17:39,493 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_8) Event handle_interface_link_up Interface('novi_port_15', 15, Switch('00:00:00:00:00:00:00:01'))
2024-04-24 15:17:39,493 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_8) Activating EVC 2d097665300b4f. Interfaces: {'00:00:00:00:00:00:00:01:15': {'status': 'UP', 'status_reason
': set()}, '00:00:00:00:00:00:00:06:22': {'status': 'UP', 'status_reason': set()}}.
2024-04-24 15:17:39,495 - INFO [kytos.napps.kytos/telemetry_int] (MainThread) Handling mef_eline.uni_active_updated active True on EVC id: 2d097665300b4f
2024-04-24 15:17:39,505 - INFO [uvicorn.access] (MainThread) 127.0.0.1:38828 - "POST /api/kytos/mef_eline/v2/evc/metadata HTTP/1.1" 201
2024-04-24 15:17:39,506 - INFO [uvicorn.access] (MainThread) 127.0.0.1:38836 - "POST /api/kytos/mef_eline/v2/evc/metadata HTTP/1.1" 201

❯ http http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/5608a913b43c4b | jq '.metadata, .active' 
{
  "telemetry": {
    "enabled": true,
    "status": "DOWN",
    "status_reason": [
      "uni_down"
    ],
    "status_updated_at": "2024-04-24T18:17:21"
  }
}
false

❯ http http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/5608a913b43c4b | jq '.metadata, .active' 
{
  "telemetry": {
    "enabled": true,
    "status": "UP",
    "status_reason": [],
    "status_updated_at": "2024-04-24T18:17:39"
  }
}
true

End-to-End Tests