kytos-ng / telemetry_int

Kytos Telemetry Napp
MIT License
0 stars 2 forks source link

fix: only raise FlowsNotFound when it's active and flows aren't found #88

Closed viniarck closed 5 months ago

viniarck commented 5 months ago

Closes #87

This is on top of PR #86

Summary

See updated changelog file

Local Tests

I tested on AmLight INT Lab the following cases

❯ http http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/9461d30603ae44 | jq
{
  "active": false,
  "archived": false,
  "backup_path": [],
  "bandwidth": 0,
  "circuit_scheduler": [],
  "current_path": [],
  "dynamic_backup_path": true,
  "enabled": true,
  "failover_path": [],
  "id": "9461d30603ae44",
  "metadata": {
    "telemetry": {
      "enabled": true,
      "status": "DOWN",
      "status_reason": [
        "no_flows"
      ],
      "status_updated_at": "2024-04-22T14:54:19"
    }
  },
  "name": "inter_evpl_2222",
  "primary_path": [],
  "service_level": 6,
  "uni_a": {
    "tag": {
      "tag_type": "vlan",
      "value": 2222
    },
    "interface_id": "00:00:00:00:00:00:00:01:15"
  },
  "uni_z": {
    "tag": {
      "tag_type": "vlan",
      "value": 2222
    },
    "interface_id": "00:00:00:00:00:00:00:06:22"
  },
  "sb_priority": null,
  "execution_rounds": 0,
  "owner": null,
  "queue_id": -1,
  "primary_constraints": {},
  "secondary_constraints": {},
  "primary_links": [],
  "backup_links": [],
  "start_date": "2024-04-22T13:32:18",
  "creation_time": "2024-04-22T13:32:18",
  "request_time": "2024-04-22T13:32:18",
  "end_date": null,
  "flow_removed_at": "2024-04-22T13:34:00",
  "updated_at": "2024-04-22T14:53:54"
}
❯ http http://127.0.0.1:8181/api/kytos/mef_eline/v2/evc/9461d30603ae44 | jq
{
  "active": true,
  "archived": false,
  "backup_path": [],
  "bandwidth": 0,
  "circuit_scheduler": [],
  "current_path": [
    {
      "id": "d7e3aade462df35a656320b717e8603a7fd624c4cfb7dcb72feafe95c6be1c96",
      "endpoint_a": {
        "id": "00:00:00:00:00:00:00:01:11",
        "name": "novi_port_11",
        "port_number": 11,
        "mac": "00:00:00:00:00:00",
        "switch": "00:00:00:00:00:00:00:01",
        "type": "interface",
        "nni": true,
        "uni": false,
        "speed": 12500000000.0,
        "metadata": {},
        "lldp": true,
        "active": true,
        "enabled": true,
        "status": "UP",
        "status_reason": [],
        "link": "d7e3aade462df35a656320b717e8603a7fd624c4cfb7dcb72feafe95c6be1c96"
      },
      "endpoint_b": {
        "id": "00:00:00:00:00:00:00:06:11",
        "name": "novi_port_11",
        "port_number": 11,
        "mac": "00:00:00:00:00:00",
        "switch": "00:00:00:00:00:00:00:06",
        "type": "interface",
        "nni": true,
        "uni": false,
        "speed": 12500000000.0,
        "metadata": {},
        "lldp": true,
        "active": true,
        "enabled": true,
        "status": "UP",
        "status_reason": [],
        "link": "d7e3aade462df35a656320b717e8603a7fd624c4cfb7dcb72feafe95c6be1c96"
      },
      "metadata": {
        "s_vlan": {
          "tag_type": "vlan",
          "value": 1
        }
      },
      "active": true,
      "enabled": true,
      "status": "UP",
      "status_reason": []
    }
  ],
  "dynamic_backup_path": true,
  "enabled": true,
  "failover_path": [],
  "id": "9461d30603ae44",
  "metadata": {
    "telemetry": {
      "enabled": true,
      "status": "UP",
      "status_reason": [],
      "status_updated_at": "2024-04-22T14:55:15"
    }
  },
  "name": "inter_evpl_2222",
  "primary_path": [],
  "service_level": 6,
  "uni_a": {
    "tag": {
      "tag_type": "vlan",
      "value": 2222
    },
    "interface_id": "00:00:00:00:00:00:00:01:15"
  },
  "uni_z": {
    "tag": {
      "tag_type": "vlan",
      "value": 2222
    },
    "interface_id": "00:00:00:00:00:00:00:06:22"
  },
  "sb_priority": null,
  "execution_rounds": 0,
  "owner": null,
  "queue_id": -1,
  "primary_constraints": {},
  "secondary_constraints": {},
  "primary_links": [],
  "backup_links": [],
  "start_date": "2024-04-22T13:32:18",
  "creation_time": "2024-04-22T13:32:18",
  "request_time": "2024-04-22T13:32:18",
  "end_date": null,
  "flow_removed_at": "2024-04-22T14:53:54",
  "updated_at": "2024-04-22T14:55:21"
}

End-to-End Tests

N/A yet.