@startuml
title Reroute all flows which go through a particular ISL

participant Client

participant Northbound

control kilda.northbound
control kilda.topo.nb

participant NbWorkerTopology

participant Neo4j

Client -> Northbound : PATCH /links/under-maintenance\nRequest body: LinkUnderMaintenanceDto

activate Northbound
Northbound -> kilda.topo.nb : CommandMessage\nUpdateIslUnderMaintenanceRequest
kilda.topo.nb -> NbWorkerTopology : CommandMessage\nUpdateIslUnderMaintenanceRequest
activate NbWorkerTopology

NbWorkerTopology -> Neo4j : Query to get link\ninformation
activate Neo4j
Neo4j -> NbWorkerTopology : Isl
deactivate Neo4j

alt

NbWorkerTopology -> Neo4j : Update isl
NbWorkerTopology -> kilda.northbound : InfoData\nIslInfoData
kilda.northbound -> Northbound : InfoData\nIslInfoData
Northbound -> Client : LinkDto

else link does not exist

NbWorkerTopology -> kilda.northbound : ErrorMessage
deactivate NbWorkerTopology
kilda.northbound -> Northbound : ErrorMessage
Northbound -> Client : HTTP 404: Isl not found
deactivate Northbound
end

@enduml