Skip to content

Commit

Permalink
fix: send mqtt message to cerebrum where edge site id changed (#203)
Browse files Browse the repository at this point in the history
Co-authored-by: 99cloud <qiao.lei@99cloud.net>
  • Loading branch information
qiaolei1 and 99cloud committed Apr 23, 2023
1 parent a56fea1 commit a35eafc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dandelion/api/api_v1/endpoints/system_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from dandelion import crud, models, schemas
from dandelion.api import deps
from dandelion.api.deps import OpenV2XHTTPException as HTTPException
from dandelion.mqtt import cloud_server as mqtt_cloud_server
from dandelion.mqtt import cloud_server as mqtt_cloud_server, topic

router = APIRouter()
CONF: cfg = cfg.CONF
Expand Down Expand Up @@ -67,6 +67,7 @@ def create(
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST, detail="Cloud MQTT Connection failed"
)
mqtt_cloud_server.MQTT_CLIENT.publish(topic=topic.V2X_EDGE_SITE_CHANGE)

return system_config.to_dict()

Expand Down
2 changes: 2 additions & 0 deletions dandelion/mqtt/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
V2X_RSU_PLUS_SSW_DOWN = "V2X/RSU/+/SSW/DOWN"
V2X_RSU_PIP_CFG = "V2X/RSU/PIP/CFG"

V2X_EDGE_SITE_CHANGE = "V2X/EDGE/SITE/CHANGE"


def v2x_rsu_map_down(rsu_id):
return f"V2X/RSU/{rsu_id}/MAP/DOWN"
Expand Down

0 comments on commit a35eafc

Please sign in to comment.