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.
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:
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. |
The following date formats are supported:
- DD-MM-YYYY, when DateDayBeforeMonth =1
- MM-DD-YYYY, when DateDayBeforeMonth=0
If you are defining the device, you must enter the device database name, not the name displayed in the AFA device tree. Rule IDs must also be defined as the internal AFA IDs.
Retrieve both device database names and internal rule IDs using the following API:
https://<server_IP>/fa/server/rules/read?session=<FA_session_Id>&entity=<AFA_UI_display_name>
Any error messages that include the device name include the name displayed in AFA.
The attachment field accepts single or multiple values, and expects the following syntax: 'filename=<filename>:content=<encoded file content to base64 string>'
Additionally:
-
Filenames must be valid Linux filenames, including valid characters only, no more than 255 characters, and not an empty string.
-
Files must also have valid extensions, and not be of any file types listed in the RestrictedFileExtensionsInAttachment configuration.
-
File content should be encoded to base 64.
-
Before encoding, the file content should not exceed the maximum size configured in the MaxAttachmentSize configuration parameter.
For details, see FireFlow configuration parameter reference.
Response:
Element | Type | Description | |
---|---|---|---|
status
|
String |
One of the following:
|
|
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 Error messages
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
403 |
Authentication failure Error messages:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 |
Failed to complete operation. Error messages:
|
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 }