Rule

Create an Operation Rule

Changed on

Create a new Operation Rule on the target Site. The rule definition is validated server-side by Flow; on validation failure no state changes (the request acts as a dry-run by way of its own validation step).

Rules are site-scoped and per (operationType, operationCode) tuple. The response echoes the submitted body with the assigned id.

Org must have an Infrastructure Provider entity. User must have authorization role with PROVIDER_ADMIN suffix.

post/v2/org/{org}/nico/task/rule

Request

  • Base URL
    https://nico-rest-api.nico.svc.cluster.local
  • URL
    https://nico-rest-api.nico.svc.cluster.local/v2/org/{org}/nico/task/rule
  • Auth
    HTTP bearer

Request body

siteIdstring uuid required

ID of the Site to create the rule on.

namestring required

Human-readable name of the rule.

descriptionstring

Optional free-form description.

operationType'PowerControl' | 'FirmwareControl' required

Operation type the rule applies to.

operationCodestring required

Operation code within the operation type. For PowerControl, accepted values are power_on, force_power_on, power_off, force_power_off, restart, force_restart, warm_reset, and cold_reset. For FirmwareControl, accepted values are upgrade, downgrade, and rollback. The server validates the code against the selected type.

Response

Rule was created.

idstring uuid required

Unique identifier of the rule.

namestring required

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

descriptionstring

Optional free-form description.

operationType'PowerControl' | 'FirmwareControl' required

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

operationCodestring required

Operation code within the operation type. For PowerControl, accepted values are power_on, force_power_on, power_off, force_power_off, restart, force_restart, warm_reset, and cold_reset. For FirmwareControl, accepted values are upgrade, downgrade, and rollback. The server validates the code against the selected type. Immutable after creation.

isDefaultboolean required

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

createdstring date-time required

Timestamp when the rule was created.

updatedstring date-time required

Timestamp when the rule was last updated.

Changes

    • info

      removed the nico enum value from the response property for the response status

    • info

      removed the nico enum value from the response property for the response status

    • info

      removed the nico enum value from the response property for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status