Loading src/open_exposure_gateway/application/mappers/edge_application_mapper.py +28 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ from open_exposure_gateway.api.camara.edge_application_management.vwip.schemas i NetworkInterface as CamaraNetworkInterface, ) from open_exposure_gateway.domain.edge_application_management import ( AppDeploymentStatusChangeCloudEvent, AppDeploymentStatusChangeData, AppDeploymentTranslation, AppInstanceStatusChangeCloudEvent, AppInstanceStatusChangeData, Loading Loading @@ -821,3 +823,29 @@ def build_app_instance_status_change_event( status=to_app_instance_status(app_instance.state).value, ), ) def build_app_deployment_status_change_events( app_deployment_id: UUID, app_instances: list[AppInstance], app_id: UUID, occurred_at: str, ) -> list[AppDeploymentStatusChangeCloudEvent]: """One CloudEvent per changed instance for the onAppDeploymentStatusChange callback array (ADR-0008). All instances of a deployment share one app_registration_id, hence one resolved app_id.""" return [ AppDeploymentStatusChangeCloudEvent( id=str(uuid4()), source=_CALLBACK_EVENT_SOURCE, time=occurred_at, data=AppDeploymentStatusChangeData( appDeploymentId=app_deployment_id, appInstanceId=app_instance.app_instance_id, appId=app_id, edgeCloudZoneId=app_instance.edge_cloud_zone_id, status=to_app_instance_status(app_instance.state).value, ), ) for app_instance in app_instances ] Loading
src/open_exposure_gateway/application/mappers/edge_application_mapper.py +28 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ from open_exposure_gateway.api.camara.edge_application_management.vwip.schemas i NetworkInterface as CamaraNetworkInterface, ) from open_exposure_gateway.domain.edge_application_management import ( AppDeploymentStatusChangeCloudEvent, AppDeploymentStatusChangeData, AppDeploymentTranslation, AppInstanceStatusChangeCloudEvent, AppInstanceStatusChangeData, Loading Loading @@ -821,3 +823,29 @@ def build_app_instance_status_change_event( status=to_app_instance_status(app_instance.state).value, ), ) def build_app_deployment_status_change_events( app_deployment_id: UUID, app_instances: list[AppInstance], app_id: UUID, occurred_at: str, ) -> list[AppDeploymentStatusChangeCloudEvent]: """One CloudEvent per changed instance for the onAppDeploymentStatusChange callback array (ADR-0008). All instances of a deployment share one app_registration_id, hence one resolved app_id.""" return [ AppDeploymentStatusChangeCloudEvent( id=str(uuid4()), source=_CALLBACK_EVENT_SOURCE, time=occurred_at, data=AppDeploymentStatusChangeData( appDeploymentId=app_deployment_id, appInstanceId=app_instance.app_instance_id, appId=app_id, edgeCloudZoneId=app_instance.edge_cloud_zone_id, status=to_app_instance_status(app_instance.state).value, ), ) for app_instance in app_instances ]