Updates the rule in a policy
put
/oaa-policy/policy/v1/{policygid}/rule/{ruleid}
Request
Path Parameters
-
policygid(required): string
Id of the policy
-
ruleid(required): string
Id of the rule
Supported Media Types
- application/xml
- application/json
Root Schema : schema
Type:
object
Defines policy rule in the system
Show Source
-
conditionMap: array
conditionMap
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
-
conditions: array
conditions
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
-
name(required): string
Name of the rule.
-
note: string
Note (if any) for the rule
-
policygid(required): string
Global id of the policy. Policy id may not be required when rule definition is part of policy definition result
-
results(required): object
RuleAction
Action to be returned when the rule is evaluated true.
-
rulegid: string
Global unique identifier of the rule.
-
status: string
Active or Disabled
-
transactiongid: string
Unique id of the transaction to be used for the rule evaluation which is then checked using filter conditions
Nested Schema : conditionMap
Type:
array
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
Show Source
-
Array of:
object ConditionMap
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Nested Schema : conditions
Type:
array
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
Show Source
-
Array of:
object Condition
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Nested Schema : RuleAction
Type:
object
Action to be returned when the rule is evaluated true.
Show Source
-
action: string
Action group name
-
alert: string
Alert group name
-
score: integer
Score returned by the rule
-
weight: integer
Weight if the score if there are multiple rules in the context.
Nested Schema : ConditionMap
Type:
object
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Show Source
-
key: string
-
value: object
value
The value can be a json object or a simple string.
Nested Schema : value
Type:
object
The value can be a json object or a simple string.
Nested Schema : Condition
Type:
object
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Show Source
-
conditionId: string
The global identifier of the condition which can be used to update the condition inside a rule.
-
conditionKey(required): string
Unique key of the condition. May be repeated for multiple conditions of same type.
-
parameters: array
parameters
List of all the overriding parameters.
-
remove: boolean
Remove the condition from the rule. It is optional.
Nested Schema : parameters
Type:
array
List of all the overriding parameters.
Show Source
-
Array of:
object ConditionParameter
Parameter of a condition that is required when the condition is evaluated.
Nested Schema : ConditionParameter
Type:
object
Parameter of a condition that is required when the condition is evaluated.
Show Source
-
operations: string
Operation performed on the key. The operation may not be required
-
paramname: string
Key to be used for the operation
-
scope: string
Filter condition. One of Value or Current. The scope is not required.
-
value: string
Value to be matched based on the scope.
Root Schema : schema
Type:
object
Defines policy rule in the system
Show Source
-
conditionMap: array
conditionMap
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
-
conditions: array
conditions
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
-
name(required): string
Name of the rule.
-
note: string
Note (if any) for the rule
-
policygid(required): string
Global id of the policy. Policy id may not be required when rule definition is part of policy definition result
-
results(required): object
RuleAction
Action to be returned when the rule is evaluated true.
-
rulegid: string
Global unique identifier of the rule.
-
status: string
Active or Disabled
-
transactiongid: string
Unique id of the transaction to be used for the rule evaluation which is then checked using filter conditions
Nested Schema : conditionMap
Type:
array
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
Show Source
-
Array of:
object ConditionMap
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Nested Schema : conditions
Type:
array
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
Show Source
-
Array of:
object Condition
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Nested Schema : RuleAction
Type:
object
Action to be returned when the rule is evaluated true.
Show Source
-
action: string
Action group name
-
alert: string
Alert group name
-
score: integer
Score returned by the rule
-
weight: integer
Weight if the score if there are multiple rules in the context.
Nested Schema : ConditionMap
Type:
object
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Show Source
-
key: string
-
value: object
value
The value can be a json object or a simple string.
Nested Schema : value
Type:
object
The value can be a json object or a simple string.
Nested Schema : Condition
Type:
object
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Show Source
-
conditionId: string
The global identifier of the condition which can be used to update the condition inside a rule.
-
conditionKey(required): string
Unique key of the condition. May be repeated for multiple conditions of same type.
-
parameters: array
parameters
List of all the overriding parameters.
-
remove: boolean
Remove the condition from the rule. It is optional.
Nested Schema : parameters
Type:
array
List of all the overriding parameters.
Show Source
-
Array of:
object ConditionParameter
Parameter of a condition that is required when the condition is evaluated.
Nested Schema : ConditionParameter
Type:
object
Parameter of a condition that is required when the condition is evaluated.
Show Source
-
operations: string
Operation performed on the key. The operation may not be required
-
paramname: string
Key to be used for the operation
-
scope: string
Filter condition. One of Value or Current. The scope is not required.
-
value: string
Value to be matched based on the scope.
Response
Supported Media Types
- application/xml
- application/json
200 Response
Policy rule is updated.
Root Schema : RuleResponse
Type:
object
It contains information about the requested operation related to the policy rule.
Show Source
-
message: string
Message related to the status of the request.
-
rule: object
schema
Defines policy rule in the system
-
rulegid: string
Global identifier of the rule.
-
status: string
Status of the request to indicate success or failure.
Nested Schema : schema
Type:
object
Defines policy rule in the system
Show Source
-
conditionMap: array
conditionMap
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
-
conditions: array
conditions
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
-
name(required): string
Name of the rule.
-
note: string
Note (if any) for the rule
-
policygid(required): string
Global id of the policy. Policy id may not be required when rule definition is part of policy definition result
-
results(required): object
RuleAction
Action to be returned when the rule is evaluated true.
-
rulegid: string
Global unique identifier of the rule.
-
status: string
Active or Disabled
-
transactiongid: string
Unique id of the transaction to be used for the rule evaluation which is then checked using filter conditions
Nested Schema : conditionMap
Type:
array
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
Show Source
-
Array of:
object ConditionMap
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Nested Schema : conditions
Type:
array
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
Show Source
-
Array of:
object Condition
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Nested Schema : RuleAction
Type:
object
Action to be returned when the rule is evaluated true.
Show Source
-
action: string
Action group name
-
alert: string
Alert group name
-
score: integer
Score returned by the rule
-
weight: integer
Weight if the score if there are multiple rules in the context.
Nested Schema : ConditionMap
Type:
object
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Show Source
-
key: string
-
value: object
value
The value can be a json object or a simple string.
Nested Schema : value
Type:
object
The value can be a json object or a simple string.
Nested Schema : Condition
Type:
object
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Show Source
-
conditionId: string
The global identifier of the condition which can be used to update the condition inside a rule.
-
conditionKey(required): string
Unique key of the condition. May be repeated for multiple conditions of same type.
-
parameters: array
parameters
List of all the overriding parameters.
-
remove: boolean
Remove the condition from the rule. It is optional.
Nested Schema : parameters
Type:
array
List of all the overriding parameters.
Show Source
-
Array of:
object ConditionParameter
Parameter of a condition that is required when the condition is evaluated.
Nested Schema : ConditionParameter
Type:
object
Parameter of a condition that is required when the condition is evaluated.
Show Source
-
operations: string
Operation performed on the key. The operation may not be required
-
paramname: string
Key to be used for the operation
-
scope: string
Filter condition. One of Value or Current. The scope is not required.
-
value: string
Value to be matched based on the scope.
401 Response
Unauthorized
405 Response
Invalid input
Root Schema : RuleResponse
Type:
object
It contains information about the requested operation related to the policy rule.
Show Source
-
message: string
Message related to the status of the request.
-
rule: object
schema
Defines policy rule in the system
-
rulegid: string
Global identifier of the rule.
-
status: string
Status of the request to indicate success or failure.
Nested Schema : schema
Type:
object
Defines policy rule in the system
Show Source
-
conditionMap: array
conditionMap
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
-
conditions: array
conditions
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
-
name(required): string
Name of the rule.
-
note: string
Note (if any) for the rule
-
policygid(required): string
Global id of the policy. Policy id may not be required when rule definition is part of policy definition result
-
results(required): object
RuleAction
Action to be returned when the rule is evaluated true.
-
rulegid: string
Global unique identifier of the rule.
-
status: string
Active or Disabled
-
transactiongid: string
Unique id of the transaction to be used for the rule evaluation which is then checked using filter conditions
Nested Schema : conditionMap
Type:
array
Map of key value pair for reconstruction of UI rule. Required elements for the OAA rules are entityRefId, operation, values (Array of String), expression, mode, isgroup.
Show Source
-
Array of:
object ConditionMap
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Nested Schema : conditions
Type:
array
Array of conditions to be evaluated when the rule will be executed. All the condition must be true to return the action associated with the rule.
Show Source
-
Array of:
object Condition
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Nested Schema : RuleAction
Type:
object
Action to be returned when the rule is evaluated true.
Show Source
-
action: string
Action group name
-
alert: string
Alert group name
-
score: integer
Score returned by the rule
-
weight: integer
Weight if the score if there are multiple rules in the context.
Nested Schema : ConditionMap
Type:
object
Map of key-value pair which is used to reconstruct the rule or any additional parameters that are required by the rule can be passed in the map
Show Source
-
key: string
-
value: object
value
The value can be a json object or a simple string.
Nested Schema : value
Type:
object
The value can be a json object or a simple string.
Nested Schema : Condition
Type:
object
Conditions to be evaluated. If no parameter is provided then all the conditions will be evaluated with the default values.
Show Source
-
conditionId: string
The global identifier of the condition which can be used to update the condition inside a rule.
-
conditionKey(required): string
Unique key of the condition. May be repeated for multiple conditions of same type.
-
parameters: array
parameters
List of all the overriding parameters.
-
remove: boolean
Remove the condition from the rule. It is optional.
Nested Schema : parameters
Type:
array
List of all the overriding parameters.
Show Source
-
Array of:
object ConditionParameter
Parameter of a condition that is required when the condition is evaluated.
Nested Schema : ConditionParameter
Type:
object
Parameter of a condition that is required when the condition is evaluated.
Show Source
-
operations: string
Operation performed on the key. The operation may not be required
-
paramname: string
Key to be used for the operation
-
scope: string
Filter condition. One of Value or Current. The scope is not required.
-
value: string
Value to be matched based on the scope.
500 Response
Internal server error
503 Response
Service Unavailable
Examples
The following example shows a sample request and response for updating the rule of a given policy.
cURL Command to Update the Rule of a Policy in JSON Format
curl --location --request PUT '<PolicyUrl>/oaa-policy/policy/v1/141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171/rule/146_faef323e5ee26bac62d48a9bf9ded1da3f9655731566b0e3628ce86e21c9e46a' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data ' { "name": "Factor and IP Range Rule", "status": "Active", "note": "Factor and IP Rule update", "conditionMap": [ { "key": "IpGroupCondition", "value": { "mode": "BASIC", "expression": "context.ip.inRange('\''127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad'\'')", "values": [ "127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad" ], "isgroup": true, "attribute": "Context.IPAddress", "operator": "In Range" } } ], "results": { "action": "111_4141dd92a40fa2ff8d09153e62c658c67f3c7ac014ce89c0c103896230457718", "score": 300, "weight": 100 } }'
Sample Response in JSON Format
{ "status": "200", "message": "Rule updated successfully.", "rulegid": "146_faef323e5ee26bac62d48a9bf9ded1da3f9655731566b0e3628ce86e21c9e46a", "rule": { "name": "Factor and IP Range Rule", "rulegid": "146_faef323e5ee26bac62d48a9bf9ded1da3f9655731566b0e3628ce86e21c9e46a", "policygid": "141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171", "status": "ACTIVE", "note": "Factor and IP Rule update", "conditions": [ { "conditionKey": "always_on_user.condition0", "conditionId": "145_5f7d4a93ac1ad362c70a43a9b64351cf6789b3a0c55b425145c374aca7628bc1", "parameters": [ { "paramname": "isTrue", "value": "true" } ] } ], "conditionMap": [ { "key": "IpGroupCondition", "value": { "mode": "BASIC", "expression": "context.ip.inRange(127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad)", "values": [ "127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad" ], "isgroup": true, "attribute": "Context.IPAddress", "operator": "In Range" } } ], "results": { "action": "111_4141dd92a40fa2ff8d09153e62c658c67f3c7ac014ce89c0c103896230457718", "score": 300, "weight": 100 } } }
cURL Command to Update the Rule of a Policy in XML Format
curl --location --request PUT '<PolicyUrl>/oaa-policy/policy/v1/141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171/rule/146_faef323e5ee26bac62d48a9bf9ded1da3f9655731566b0e3628ce86e21c9e46a' \ --header 'Content-Type: application/xml' \ --header 'Accept: application/xml' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data ' <?xml version="1.0" encoding="UTF-8" ?> <RuleRequest> <name>Factor and IP Range Rule</name> <status>Active</status> <note>Factor and IP Rule update</note> <conditionMap> <key>IpGroupCondition</key> <value> <mode>BASIC</mode> <expression>context.ip.inRange('127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad')</expression> <values>127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad</values> <isgroup>true</isgroup> <attribute>Context.IPAddress</attribute> <operator>In Range</operator> </value> </conditionMap> <results> <action>111_4141dd92a40fa2ff8d09153e62c658c67f3c7ac014ce89c0c103896230457718</action> <score>300</score> <weight>100</weight> </results> </RuleRequest>'
Sample Response in XML Format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RuleResponse> <status>200</status> <message>Rule updated successfully.</message> <rulegid>146_faef323e5ee26bac62d48a9bf9ded1da3f9655731566b0e3628ce86e21c9e46a</rulegid> <rule> <name>Factor and IP Range Rule</name> <rulegid>146_faef323e5ee26bac62d48a9bf9ded1da3f9655731566b0e3628ce86e21c9e46a</rulegid> <policygid>141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171</policygid> <status>ACTIVE</status> <note>Factor and IP Rule update</note> <conditions> <conditionKey>always_on_user.condition0</conditionKey> <conditionId>145_5f7d4a93ac1ad362c70a43a9b64351cf6789b3a0c55b425145c374aca7628bc1</conditionId> <parameters> <paramname>isTrue</paramname> <value>true</value> </parameters> </conditions> <conditionMap> <key>IpGroupCondition</key> <value> <mode>BASIC</mode> <expression>context.ip.inRange(127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad)</expression> <values>127_ddd32e7186d66b2cb96cc4608ded0bb7d6ae4a48b1fc1894c69e715cf262e7ad</values> <isgroup>true</isgroup> <attribute>Context.IPAddress</attribute> <operator>In Range</operator> </value> </conditionMap> <results> <action>111_4141dd92a40fa2ff8d09153e62c658c67f3c7ac014ce89c0c103896230457718</action> <score>300</score> <weight>100</weight> </results> </rule> </RuleResponse>