Retrieve an Operation Rule

View as Markdown

Get an Operation Rule by UUID.

Rules are site-scoped; siteId must be the Site that owns the rule. Org must have an Infrastructure Provider entity. User must have authorization role with PROVIDER_ADMIN suffix.

Authentication

AuthorizationBearer
``` export JWT_BEARER_TOKEN="<jwt-bearer-token>" # Example org name: "acme-inc export ORG_NAME=<org-name> # Use the JWT bearer token in your API request auth header: curl -v -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $JWT_BEARER_TOKEN" https://nico-rest-api.nico.svc.cluster.local/v2/org/$ORG_NAME/nico/user/current ```

Path parameters

orgstringRequired
Name of the Org
idstringRequiredformat: "uuid"
UUID of the Rule

Query parameters

siteIdstringRequiredformat: "uuid"

ID of the Site that owns the rule (rules are site-scoped).

Response

OK
idstringformat: "uuid"
Unique identifier of the rule.
namestring

Human-readable name of the rule. Required and non-empty.

operationTypeenum
Type of operation this rule applies to. Immutable after creation.
operationCodestring

Operation code within the operation type (e.g. power_on, power_off, upgrade). Server-side validated against Flow’s allow-list for the type. Immutable after creation.

ruleDefinitionobject

Executable definition of a rule. Mirrors Flow’s wire schema 1:1 so existing YAML rule files can be converted to JSON without any key renaming (nested fields use snake_case).

isDefaultboolean

Whether this rule is currently the default for its (operationType, operationCode) tuple.

createddatetime
Timestamp when the rule was created.
updateddatetime
Timestamp when the rule was last updated.
descriptionstring

Optional free-form description.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error