Commit 27bdccd7 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

docs: add ADR-0062 to standardize zone.state values to CAMARA's active/inactive/unknown

parent dcbef481
Loading
Loading
Loading
Loading
+66 −0
Changes for decisions/0062-zone-state-uses-camara-inactive.md: 66 added lines, 0 removed lines.
Original line number Diff line number Diff line
---
type: Decision Record
title: "ADR-0062: SRM zone.state uses CAMARA's `inactive`, not `offline`"
description: "zone.state values are active/inactive/unknown, identical to CAMARA edgeCloudZoneStatus, so OEG passes the status filter and value through unchanged; domain, capability and control-path-binding states keep offline"
tags: [adr]
timestamp: 2026-10-02T00:00:00Z
status: "accepted"
---

# ADR-0062: SRM `zone.state` uses CAMARA's `inactive`, not `offline`

**Status:** accepted
**Date:** 2026-10-02
**Affects:** [srm/persistence-model.md](/srm/persistence-model.md) (`zone` table), [srm/persistence-cross-standards-view.md](/srm/persistence-cross-standards-view.md) §3 `zone.state`, [srm/interface-contract.md](/srm/interface-contract.md) §E.3 `GET /zones`

## Context

SRM's `zone.state` allowed `active`, `offline`, `unknown`. CAMARA's `edgeCloudZoneStatus` is
`active`, `inactive`, `unknown`, and the cross-standards view said OEG maps `inactive` ↔ `offline`.
But interface-contract §E.3 also says OEG passes CAMARA's `status` filter through to
`GET /zones?state=` **unchanged**. Both can't hold: with `offline` stored, a CAMARA
`status=inactive` query matches nothing. In practice nobody implemented the mapping. OEG's SRM
mock already returns `"state": "inactive"`, and SRM's `refactor/fm-client` branch renamed the enum
value to `inactive`.

Options considered:

- **A. Keep `offline` and specify the OEG mapping properly**, in both directions, on the filter and
  on the response. That's an extra translation for one value, and every new consumer of
  `GET /zones` (FM, partner zones merged in per ADR-0044) has to repeat it.
- **B. Store `inactive` in `zone.state`.** Zone state then matches CAMARA one to one.
- **C. Rename `offline` → `inactive` on every topology table** (zone, domain, capability,
  control-path binding). Domains, capabilities and bindings have no CAMARA status to align with,
  and their `offline` reads correctly as "this target can't take work". Renaming them is churn
  with no consumer that benefits.

## Decision

Option B. `zone.state` takes `active`, `inactive` or `unknown`, the same values as CAMARA
`edgeCloudZoneStatus`. SRM exposes them on `GET /zones` and accepts them on its `state` filter.
OEG passes both through with no mapping. `domain`, `capability` and `control_path_binding`
keep `active`, `offline`, `unknown`.

## Consequences

What becomes easier:

- OEG's `GET /edge-cloud-zones` passes `status` through and returns `state` as is, which is what
  §E.3 already said.
- Federated zones merged into `GET /zones` (ADR-0044) need no state translation on the CAMARA side.

What becomes harder:

- Zones say `inactive` while the other topology tables say `offline` for the same idea. Code must
  not share one state enum across the four tables.
- Existing SRM databases need a migration: rewrite `zone.state = 'offline'` rows to `inactive` and
  replace the `zone` CHECK constraint.

Deferred or excluded:

- Domain, capability and control-path-binding states are unchanged.

Revisit trigger:

- A consumer needs CAMARA-aligned state on domains or capabilities, or CAMARA changes
  `edgeCloudZoneStatus`.
+1 −0
Changes for decisions/index.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -49,3 +49,4 @@ the reasoning lives here. Never renumber; supersede instead (see the record-deci
* [ADR-0044](0044-srm-owns-federated-zone-locality-and-hand-off.md) - SRM resolves Edge Cloud Zone locality for deployment targets and forwards non-local deploys to FM; interim layer pending a future runtime-coordinator component
* [ADR-0045](0045-pin-narrows-candidates-not-probing.md) - a zone/domain pin narrows the device-targeted candidate set rather than bypassing target probing; probing is triggered by how many candidates survive the pin (amends ADR-0038's unpinned scoping)
* [ADR-0047](0047-terminal-record-read-follows-camara-schema.md) - terminal-record read behaviour follows each family's own vendored CAMARA schema: Traffic Influence returns 200 with `state: deleted`, QoD stays 404 (amends ADR-0034's blanket 404 rule and its 204 delete code)
* [ADR-0062](0062-zone-state-uses-camara-inactive.md) - `zone.state` uses CAMARA's `active`/`inactive`/`unknown` (was `offline`), so OEG passes the zone status filter and value through unmapped; domain, capability and control-path-binding states keep `offline`
+3 −1
Changes for srm/interface-contract.md: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -737,7 +737,8 @@ Number Verification is **not** part of this contract; model separately.
- `POST /capacity-check` — capacity query against a zone (or a specific
  `domain_id`); best-effort via `query_available_resources`.
- `GET /zones` — zones with compute/network domain summaries. `metadata.provider` is guaranteed
  non-null on every zone (ADR-0029). Optionally filterable by `state` (`zone.state` column) and
  non-null on every zone (ADR-0029). Optionally filterable by `state` (`zone.state` column:
  `active`/`inactive`/`unknown`, the CAMARA `edgeCloudZoneStatus` values, ADR-0062) and
  `region` (matched against the free-form `metadata.location.region` JSON path — not a dedicated
  column, and not guaranteed set on every zone, per persistence-cross-standards-view.md). OEG
  passes CAMARA `region`/`status` through to these two params unchanged. Per ADR-0044, this read
@@ -880,3 +881,4 @@ component (platform/future-architecture.md §6.1, ADR-0044).
| 2.0 | 2026-09-04 | Added F.4a: SRM resolves zone locality and forwards non-local deploys to FM (ADR-0044). `GET /zones` (§E.3) may now include FM-sourced federated zones. F.4a step 1 corrected to cite F.1's direct zone lookup, not §B's device-targeted candidate-probing mechanism (different, unrelated resolution path). |
| 2.0 | 2026-09-08 | §B: a zone/domain pin on a device-targeted capability narrows the candidate set rather than bypassing target probing (ADR-0045). Deploy §B.2's "SRM selects a domain in it" no longer carries over; probing is triggered by how many candidates survive the pin, so a zone-pinned request in a two-NEF zone is probed and a zone+domain pin still resolves without one. |
| 2.0 | 2026-09-09 | §E.1: terminal-record read behaviour is per-family, following each vendored CAMARA schema rather than a blanket `404` (ADR-0047). Traffic Influence's `state` enum documents `deletion in progress`/`deleted`, so it reads them back as `200`; QoD's `QosStatus` has no such value and stays `404`. |
| 2.0 | 2026-10-02 | §E.3: `GET /zones` `state` values listed as `active`/`inactive`/`unknown`, the CAMARA `edgeCloudZoneStatus` values, so OEG's unchanged pass-through matches (ADR-0062). |
+2 −1
Changes for srm/persistence-cross-standards-view.md: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ site — *the "where" of edge*. Other kinds (`authority`, `federation_business`,
| `ref` | Text | **Internal only** — never on contracts (ADR-0013). | Human-readable slug for logs and operator tooling. | EDGE-DEPLOY: `london-east`. | Not null, `UNIQUE (ref)` in single-platform v1 |
| `name` | Text | CAMARA: `edgeCloudZoneName`. TMF674 v4: `GeographicSite.name`. GSMA OPG.04: `zoneName`. | The friendly name of the site. | EDGE-DEPLOY: `"London-East"`. | Not null |
| `kind` | Text | OOP-internal taxonomy. | What this zone scopes: `resource` zones host compute/network domains; `authority` zones host trust domains. | EDGE-DEPLOY: `resource`. | Not null. Values: `resource`, `authority`, `federation_business`, `logical`, `custom`. |
| `state` | Text | CAMARA: `edgeCloudZoneStatus` (`active`/`inactive`/`unknown`) — OEG maps `inactive` ↔ SRM `offline`. TMF674 v4: `lifecycleStatus`. GSMA OPG.04: `zoneStatus`. | Whether the site is usable right now. | EDGE-DEPLOY: `active`. | Not null, default `active`. Values: `active`, `offline`, `unknown`. |
| `state` | Text | CAMARA: `edgeCloudZoneStatus` (`active`/`inactive`/`unknown`) — same values, OEG passes them through unmapped (ADR-0062). TMF674 v4: `lifecycleStatus`. GSMA OPG.04: `zoneStatus`. | Whether the site is usable right now. | EDGE-DEPLOY: `active`. | Not null, default `active`. Values: `active`, `inactive`, `unknown`. |
| `metadata` | Document | OOP-internal geographic / operator annotations (not a CAMARA object). Closest CAMARA fields: `edgeCloudRegion` (`metadata.location.region`), `edgeCloudProvider` (`metadata.provider`). TMF674 v4: `place.geographicLocation` (similar). | Where this site is in the world, and anything else the operator records. | EDGE-DEPLOY: `{"provider":"oop-provider","location":{"city":"London","country":"GB","lat":51.50,"lon":-0.06,"region":"Europe"}}`. | Not null, default `{}`. **Exception:** the `provider` key is guaranteed, never absent — SRM populates it from configuration, falling back to a hardcoded default (e.g. `"oop-provider"`) when unconfigured (ADR-0029). `location.region` is the recognized (OEG-consumed) key for CAMARA `edgeCloudRegion`, but is optional/free-form like the rest of `location` — SRM does not guarantee it is set. |
| `created_at` / `updated_at` | Timestamp | — | Bookkeeping. | `2025-11-10 08:00 UTC`. | Not null, default `now()` |

@@ -472,3 +472,4 @@ These are the points a standards reviewer will look at first.
| Version | Date | Summary |
|---------|------|---------|
| 2.0 | 2026-07-07 | OOP Release 2.0. |
| 2.0 | 2026-10-02 | `zone.state`: values `active`/`inactive`/`unknown`, identical to CAMARA `edgeCloudZoneStatus`; the OEG `inactive` ↔ `offline` mapping is dropped (ADR-0062). |
 No newline at end of file
+2 −1
Changes for srm/persistence-model.md: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ CREATE TABLE zone (
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    UNIQUE (ref),   -- single-platform v1; becomes UNIQUE(platform_ref, ref) if multi-platform
    CHECK (kind IN ('resource','authority','federation_business','logical','custom')),
    CHECK (state IN ('active','offline','unknown'))
    CHECK (state IN ('active','inactive','unknown'))   -- CAMARA edgeCloudZoneStatus values (ADR-0062)
);

CREATE TABLE domain (
@@ -638,3 +638,4 @@ creation order of §B.3.
| Version | Date | Summary |
|---------|------|---------|
| 2.0 | 2026-07-07 | OOP Release 2.0. |
| 2.0 | 2026-10-02 | `zone` table: `state` CHECK is `active`/`inactive`/`unknown` (was `offline`), matching CAMARA `edgeCloudZoneStatus` (ADR-0062). `domain`, `capability` and `control_path_binding` keep `offline`. |
 No newline at end of file