Create a rule removal change request

The ruleRemovalChangeRequest creates a FireFlow change request to remove or disable a device rule, using the rule removal workflow.

FireFlow validates the API to ensure that mandatory elements are in place, such as permissions, template, date formats, and that any specified device exists in AFA.

Resource name: /FireFlow/api/change-requests/rule-removal

Request method: POST

Header requirements:

Key Value
Cookie FireFlow_Session=[sessionId]. The sessionId is retrieved from the authentication request.

Request query parameters:

  Element Type Description
template String

The name of the change request template to use.

fields Array
  name String

The name of a field in the Change Request.

For example, enter Owner to set the value of the Owner field in the Change Request.

FireFlow validates the API for mandatory elements, such

Note: Each devices element can contain one device only, which must be a device from the lowest level in the AFA device tree.

For more details, see:

  values String

The value of the named field.

For example, if you are defining the Owner field, enter a username or email address.

requestActions Array
  action

Array

Determines the action to take. One of the following:

  • remove. Removes the rule completely.

  • disable. Disables the rule but does not remove it.

  • automatic. Determines the rule action based on whether the device supports disabling rules.

    If the device supports disabling rules, the action is translated consistently as disable. However, if the device does not support disabling rules, the action is translated as remove.

Each request supports one action only, even if it covers multiple rules. You cannot mix remove and disable actions for different rules.

  ruleId

String

The ID of the rule to remove or disable.

Response:

Element Type Description
status String

One of the following:

  • Success
  • Failure
messages Array
  code String A string that indicates the response code.
  message String Further details about the response, if needed.
data Array
  changeRequestID String The ID of the new Change Request created.
  redirectURL String A link to the new Change Request in FireFlow.

Code

Description

200

Operation completed successfully

400

Input validation failure

403

Authentication failure

500

Failed to complete operation.

 

Rule removal request example:

{
"template": "140: Rule Removal Request",
  "fields":
   [    {
    "name":"subject",
    "values":[
    "subject1111"              
   ]
   },
   {
   "name":"Owner",
   "values":[
    "[email protected]"                
   ]
   },         
   {
    "name": "devices",
    "values": ["<device ID>"]
   }
   ],
   "requestActions": 
   [
   {
    "action": "remove",
    "ruleId": "<ruleID>"
   }
 ]}
}

Rule removal request example (multiple rules)

{

"template": "140: Rule Removal Request",

"fields":

[

{

"key": "subject",

"values": ["test55"]

},

{

"key": "devices",

"values": ["Orit_GW2"]

}

],

"requestActions":

[

{

"action": "remove",

"ruleId": "BC100ABA-446E-493B-9707-604C2A493676"

},

{

"action": "remove",

"ruleId": "88784DAF-C0A9-4B06-AE94-E8199A802EAC"

}

]

}

Rule removal response example (success)

{
 "status": "Success",
 "messages": [   {
  "code": "success",
  "message": "Success"
 }],
 "data":    {
  "changeRequestId": 3157,
  "redirectUrl":"https://<IP>/FireFlow/Ticket/Display.html?id=3157"
 }
}	

Rule removal response example (failure)

{
 "status": "Failure",
 "messages": [   {
  "code": "DEVICES_NOT_FOUND",
  "message": "Cannot find devices: <device ID>."
 }],
 "data": null
}