feat: Add Flow Operation Rule REST APIs#2286
Conversation
Wire 5 site-scoped endpoints (POST/GET/LIST/PATCH/DELETE /v2/org/{org}/nico/rule)
backed by Flow's OperationRule gRPC, with matching Temporal workflows/activities,
typed OpenAPI schemas, and unit tests across model/handler/workflow/activity layers.
Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Adds optional ruleId to power/firmware/bring-up request models (single + batch, rack + tray) and forwards it to Flow's rule_id proto field via the shared Execute* helpers. UUID-validated at the model layer. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-2286.docs.buildwithfern.com/infra-controller |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-06-07 05:09:58 UTC | Commit: dd435f1 |
Keep the surface minimal; can be reintroduced alongside default-rule management. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Covers 8464a1e (drop isDefault list filter); also adds SPDX headers to the rule SDK files that the previous regen missed. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
Description
Adds an Operation Rule CRUD API under
/v2/org/{org}/nico/ruleand lets every rack/tray operation API accept an optionalruleIdso callers can pin a specific rule instead of relying on Flow's default rule resolution.1. Operation Rule CRUD API — 5 site-scoped endpoints, backed by Flow's
OperationRulegRPC:/v2/org/{org}/nico/rule/v2/org/{org}/nico/rulesiteId,operationType,isDefault)/v2/org/{org}/nico/rule/{id}/v2/org/{org}/nico/rule/{id}/v2/org/{org}/nico/rule/{id}2. Optional
ruleIdon rack/tray operation APIs — added to 8 request schemas (power/firmware/bring-up, single + batch, rack + tray). When set, the value is forwarded to Flow'srule_idproto field via the three sharedExecute*helpers inhandler/util/common/common.go. When omitted, Flow falls back to its default rule resolution — no behavior change for existing callers.Type of Change
Related Issues (Optional)
Breaking Changes
Testing
Additional Notes
Followups: