Creates a policy
post
/oaa-policy/policy/v1
Policy definition API
Request
There are no request parameters for this operation.
Supported Media Types
- application/xml
- application/json
Root Schema : schema
Type:
object
Policy object for creating, modifying and fetching policy.
Show Source
-
agentgid(required): string
Identifier of the agent to which the policy belongs
-
assuranceLevelId(required): string
Identifier of the assurance level which is associated with the policy
-
description(required): string
Policy description.
-
name(required): string
Policy Name.
-
policygid: string
Identifier of the policy
-
scoringEngine: string
Engine used for scoring the policy (Aggregated, Average, Maximum, Minimum, Weighted Average, Weighted Maximum, Weighted Minimum)
-
status(required): string
Status of the policy. It can be one of the following values. Active, Disabled or Deleted.
-
weight: integer
Number between 0 to 100 to define the weight of the policy if there are multiple policies in the assurance level.
Root Schema : schema
Type:
object
Policy object for creating, modifying and fetching policy.
Show Source
-
agentgid(required): string
Identifier of the agent to which the policy belongs
-
assuranceLevelId(required): string
Identifier of the assurance level which is associated with the policy
-
description(required): string
Policy description.
-
name(required): string
Policy Name.
-
policygid: string
Identifier of the policy
-
scoringEngine: string
Engine used for scoring the policy (Aggregated, Average, Maximum, Minimum, Weighted Average, Weighted Maximum, Weighted Minimum)
-
status(required): string
Status of the policy. It can be one of the following values. Active, Disabled or Deleted.
-
weight: integer
Number between 0 to 100 to define the weight of the policy if there are multiple policies in the assurance level.
Response
Supported Media Types
- application/xml
- application/json
201 Response
Policy is created
Root Schema : PolicyResponse
Type:
Show Source
object
-
message: string
Message related to the status of the request
-
policy: object
schema
Policy object for creating, modifying and fetching policy.
-
policygid: string
Identifier of the policy.
-
status: string
Status of the request
Nested Schema : schema
Type:
object
Policy object for creating, modifying and fetching policy.
Show Source
-
agentgid(required): string
Identifier of the agent to which the policy belongs
-
assuranceLevelId(required): string
Identifier of the assurance level which is associated with the policy
-
description(required): string
Policy description.
-
name(required): string
Policy Name.
-
policygid: string
Identifier of the policy
-
scoringEngine: string
Engine used for scoring the policy (Aggregated, Average, Maximum, Minimum, Weighted Average, Weighted Maximum, Weighted Minimum)
-
status(required): string
Status of the policy. It can be one of the following values. Active, Disabled or Deleted.
-
weight: integer
Number between 0 to 100 to define the weight of the policy if there are multiple policies in the assurance level.
401 Response
Unauthorized
405 Response
Invalid input
Root Schema : PolicyResponse
Type:
Show Source
object
-
message: string
Message related to the status of the request
-
policy: object
schema
Policy object for creating, modifying and fetching policy.
-
policygid: string
Identifier of the policy.
-
status: string
Status of the request
Nested Schema : schema
Type:
object
Policy object for creating, modifying and fetching policy.
Show Source
-
agentgid(required): string
Identifier of the agent to which the policy belongs
-
assuranceLevelId(required): string
Identifier of the assurance level which is associated with the policy
-
description(required): string
Policy description.
-
name(required): string
Policy Name.
-
policygid: string
Identifier of the policy
-
scoringEngine: string
Engine used for scoring the policy (Aggregated, Average, Maximum, Minimum, Weighted Average, Weighted Maximum, Weighted Minimum)
-
status(required): string
Status of the policy. It can be one of the following values. Active, Disabled or Deleted.
-
weight: integer
Number between 0 to 100 to define the weight of the policy if there are multiple policies in the assurance level.
500 Response
Internal server error
503 Response
Service Unavailable
Examples
The following example shows a sample request and response for creating a policy.
cURL Command to Create a Policy in JSON Format
curl --location --request POST '<PolicyUrl>/oaa-policy/policy/v1' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data '{ "agentgid": "dede64d3-1d6a-42e9-89e1-714e88f8967c", "assuranceLevelId": "AssuranceLevel1", "name": "Policy1", "description": "Policy for AssuranceLevel1", "status": "Active" }'
Sample Response in JSON Format
{ "status": "201", "message": "Policy created successfully.", "policygid": "141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171", "policy": { "agentgid": "dede64d3-1d6a-42e9-89e1-714e88f8967c", "assuranceLevelId": "AssuranceLevel1", "name": "Policy1", "description": "Policy for AssuranceLevel1", "status": "ACTIVE", "scoringEngine": "Average", "weight": 100, "policygid": "141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171" } }
cURL Command to Create a Policy in XML Format
curl --location --request POST '<PolicyUrl>/oaa-policy/policy/v1' \ --header 'Content-Type: application/xml' \ --header 'Accept: application/xml' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data '<?xml version="1.0" encoding="UTF-8" ?> <PolicyRequest> <agentgid>dede64d3-1d6a-42e9-89e1-714e88f8967c</agentgid> <assuranceLevelId>AssuranceLevel1</assuranceLevelId> <name>Policy1</name> <description>Policy for AssuranceLevel1</description> <status>Active</status> </PolicyRequest>'
Sample Response in XML Format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <PolicyResponse> <status>201</status> <message>Policy created successfully.</message> <policygid>141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171</policygid> <policy> <agentgid>dede64d3-1d6a-42e9-89e1-714e88f8967c</agentgid> <assuranceLevelId>AssuranceLevel1</assuranceLevelId> <name>Policy1</name> <description>Policy for AssuranceLevel1</description> <status>ACTIVE</status> <scoringEngine>Average</scoringEngine> <weight>100</weight> <policygid>141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171</policygid> </policy> </PolicyResponse>