feat: WP-0002 T03 selection decision, wait on purchase
Recommend Scaleway Multi-AZ nl-ams. Inventory stays proposed with description, decision, reef: refs, secret: handle, and consumers. Human approval required before ordered.
This commit is contained in:
parent
9d11d2a043
commit
f9af7518f5
6 changed files with 179 additions and 5 deletions
|
|
@ -51,6 +51,18 @@ def validate_record(record: dict) -> None:
|
|||
|
||||
association_ok(record)
|
||||
|
||||
decision = record.get("decision")
|
||||
if record.get("status") in {"ordered", "commissioning"} and (
|
||||
not decision or decision.get("status") != "approved"
|
||||
):
|
||||
raise ValueError("ordered or commissioning resources require an approved decision")
|
||||
for ref in record.get("operational_refs") or []:
|
||||
if not str(ref).startswith("reef:"):
|
||||
raise ValueError(f"operational_refs must be reef: references: {ref}")
|
||||
for ref in record.get("credential_handles") or []:
|
||||
if not str(ref).startswith("secret:"):
|
||||
raise ValueError(f"credential_handles must be secret: references: {ref}")
|
||||
|
||||
allocation = record["ownership"]["allocation"]
|
||||
if allocation["mode"] == "unattributed":
|
||||
if allocation["cost_attribution_key"] is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue