Loading src/open_exposure_gateway/adapters/http/srm_client.py +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ class SRMClient: if region is not None: params["region"] = region if status is not None: params["status"] = status params["state"] = status headers = {} if x_correlator: Loading src/open_exposure_gateway/application/mappers/edge_application_mapper.py +5 −4 Original line number Diff line number Diff line Loading @@ -119,16 +119,17 @@ def _parse_storage_mb(value: str) -> int: def build_edge_cloud_zone(srm_zone: ResourceZone) -> EdgeCloudZone: try: status = EdgeCloudZoneStatus(srm_zone.status) status = EdgeCloudZoneStatus(srm_zone.state) except ValueError: status = EdgeCloudZoneStatus.UNKNOWN location = srm_zone.metadata.location return EdgeCloudZone( edgeCloudZoneId=UUID(srm_zone.resource_zone_id), edgeCloudZoneId=UUID(srm_zone.id), edgeCloudZoneName=srm_zone.name, edgeCloudZoneStatus=status, edgeCloudProvider=srm_zone.provider, edgeCloudRegion=srm_zone.location.region if srm_zone.location else None, edgeCloudProvider=srm_zone.metadata.provider, edgeCloudRegion=location.region if location else None, ) Loading src/open_exposure_gateway/domain/edge_application_management.py +9 −5 Original line number Diff line number Diff line Loading @@ -96,17 +96,21 @@ class AppDeploymentTranslation(BaseModel): class ResourceZoneLocation(BaseModel): region: str | None = None country: str | None = None geo: Any | None = None class ResourceZone(BaseModel): resource_zone_id: str name: str status: str class ResourceZoneMetadata(BaseModel): provider: str location: ResourceZoneLocation | None = None class ResourceZone(BaseModel): id: str name: str state: str metadata: ResourceZoneMetadata class SRMAccelerator(BaseModel): type: str units: int Loading tests/conformance/conftest.py +7 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ from open_exposure_gateway.dependencies import ( get_publisher, get_qod_service, ) from open_exposure_gateway.domain.edge_application_management import ResourceZone from open_exposure_gateway.domain.edge_application_management import ( ResourceZone, ResourceZoneMetadata, ) from tests.conformance.harness import app from tests.unit.fakes import ( FakeAppInstanceRepository, Loading @@ -45,10 +48,10 @@ def service_overrides() -> Generator[None, None, None]: # otherwise, which no real provider would ever be. srm.zones.append( ResourceZone( resource_zone_id=str(uuid4()), id=str(uuid4()), name="conformance-zone", status="active", provider="conformance-provider", state="active", metadata=ResourceZoneMetadata(provider="conformance-provider"), ) ) operation_repo = FakeOperationRepository() Loading tests/unit/test_eam_contract.py +25 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,31 @@ class TestInternalHttpPaths: assert calls == [("GET", "/internal/zones")] async def test_zone_status_filter_uses_state_query_param(self) -> None: """The zone column is `state`, not `status` (srm/persistence-model.md); the CAMARA-facing `status` filter must be forwarded as `state` or SRM silently ignores it and returns unfiltered results.""" client = SRMClient.__new__(SRMClient) client.base_url = "http://srm:8081" client.timeout = 1.0 recorded_params: dict[str, Any] | None = None async def record( method: str, path: str, json: dict[str, Any] | None = None, params: dict[str, Any] | None = None, headers: dict[str, str] | None = None, ) -> Any: nonlocal recorded_params recorded_params = params return [] client._request = record # type: ignore[method-assign] await client.get_resource_zones(region="athens", status="active") assert recorded_params == {"region": "athens", "state": "active"} async def test_get_app_parses_srm_catalog_read_shape(self) -> None: """SRM's GET /internal/catalog/service-specifications/{id} response (ServiceCapabilityRequirementResponseSchema) never carries Loading Loading
src/open_exposure_gateway/adapters/http/srm_client.py +1 −1 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ class SRMClient: if region is not None: params["region"] = region if status is not None: params["status"] = status params["state"] = status headers = {} if x_correlator: Loading
src/open_exposure_gateway/application/mappers/edge_application_mapper.py +5 −4 Original line number Diff line number Diff line Loading @@ -119,16 +119,17 @@ def _parse_storage_mb(value: str) -> int: def build_edge_cloud_zone(srm_zone: ResourceZone) -> EdgeCloudZone: try: status = EdgeCloudZoneStatus(srm_zone.status) status = EdgeCloudZoneStatus(srm_zone.state) except ValueError: status = EdgeCloudZoneStatus.UNKNOWN location = srm_zone.metadata.location return EdgeCloudZone( edgeCloudZoneId=UUID(srm_zone.resource_zone_id), edgeCloudZoneId=UUID(srm_zone.id), edgeCloudZoneName=srm_zone.name, edgeCloudZoneStatus=status, edgeCloudProvider=srm_zone.provider, edgeCloudRegion=srm_zone.location.region if srm_zone.location else None, edgeCloudProvider=srm_zone.metadata.provider, edgeCloudRegion=location.region if location else None, ) Loading
src/open_exposure_gateway/domain/edge_application_management.py +9 −5 Original line number Diff line number Diff line Loading @@ -96,17 +96,21 @@ class AppDeploymentTranslation(BaseModel): class ResourceZoneLocation(BaseModel): region: str | None = None country: str | None = None geo: Any | None = None class ResourceZone(BaseModel): resource_zone_id: str name: str status: str class ResourceZoneMetadata(BaseModel): provider: str location: ResourceZoneLocation | None = None class ResourceZone(BaseModel): id: str name: str state: str metadata: ResourceZoneMetadata class SRMAccelerator(BaseModel): type: str units: int Loading
tests/conformance/conftest.py +7 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ from open_exposure_gateway.dependencies import ( get_publisher, get_qod_service, ) from open_exposure_gateway.domain.edge_application_management import ResourceZone from open_exposure_gateway.domain.edge_application_management import ( ResourceZone, ResourceZoneMetadata, ) from tests.conformance.harness import app from tests.unit.fakes import ( FakeAppInstanceRepository, Loading @@ -45,10 +48,10 @@ def service_overrides() -> Generator[None, None, None]: # otherwise, which no real provider would ever be. srm.zones.append( ResourceZone( resource_zone_id=str(uuid4()), id=str(uuid4()), name="conformance-zone", status="active", provider="conformance-provider", state="active", metadata=ResourceZoneMetadata(provider="conformance-provider"), ) ) operation_repo = FakeOperationRepository() Loading
tests/unit/test_eam_contract.py +25 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,31 @@ class TestInternalHttpPaths: assert calls == [("GET", "/internal/zones")] async def test_zone_status_filter_uses_state_query_param(self) -> None: """The zone column is `state`, not `status` (srm/persistence-model.md); the CAMARA-facing `status` filter must be forwarded as `state` or SRM silently ignores it and returns unfiltered results.""" client = SRMClient.__new__(SRMClient) client.base_url = "http://srm:8081" client.timeout = 1.0 recorded_params: dict[str, Any] | None = None async def record( method: str, path: str, json: dict[str, Any] | None = None, params: dict[str, Any] | None = None, headers: dict[str, str] | None = None, ) -> Any: nonlocal recorded_params recorded_params = params return [] client._request = record # type: ignore[method-assign] await client.get_resource_zones(region="athens", status="active") assert recorded_params == {"region": "athens", "state": "active"} async def test_get_app_parses_srm_catalog_read_shape(self) -> None: """SRM's GET /internal/catalog/service-specifications/{id} response (ServiceCapabilityRequirementResponseSchema) never carries Loading