Updates the policy

put

/oaa-policy/policy/v1/{policygid}

Request

Path Parameters
Supported Media Types
Request Body - application/xml ()
Root Schema : schema
Type: object
Policy object for creating, modifying and fetching policy.
Show Source
Request Body - application/json ()
Root Schema : schema
Type: object
Policy object for creating, modifying and fetching policy.
Show Source
Back to Top

Response

Supported Media Types

201 Response

Policy is updated
Body ()
Root Schema : PolicyResponse
Type: object
Show Source
Nested Schema : schema
Type: object
Policy object for creating, modifying and fetching policy.
Show Source

401 Response

Unauthorized

405 Response

Invalid input
Body ()
Root Schema : PolicyResponse
Type: object
Show Source
Nested Schema : schema
Type: object
Policy object for creating, modifying and fetching policy.
Show Source

500 Response

Internal server error

503 Response

Service Unavailable
Back to Top

Examples

The following example shows a sample request and response for updating a policy.

cURL Command to Update a Policy in JSON Format

curl --location --request PUT '<PolicyUrl>/oaa-policy/policy/v1/141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \
--data '{
    "agentgid": "dede64d3-1d6a-42e9-89e1-714e88f8967c",
    "name": "Policy1 Update",
    "description": "Policy for AssuranceLevel1 Update",
    "status": "Active",
    "assuranceLevelId": "AssuranceLevel1"
}'

Sample Response in JSON Format

{
    "status": "200",
    "message": "Policy update is successfully.",
    "policygid": "141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171",
    "policy": {
        "agentgid": "dede64d3-1d6a-42e9-89e1-714e88f8967c",
        "assuranceLevelId": "AssuranceLevel1",
        "name": "Policy1 Update",
        "description": "Policy for AssuranceLevel1 Update",
        "status": "ACTIVE",
        "scoringEngine": "Average",
        "weight": 100,
        "policygid": "141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171"
    }
}

cURL Command to Update a Policy in XML Format

curl --location --request PUT '<PolicyUrl>/oaa-policy/policy/v1/141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171' \
--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>
     <name>Policy1 Update</name>
     <description>Policy for AssuranceLevel1 Update</description>
     <status>Active</status>
     <assuranceLevelId>AssuranceLevel1</assuranceLevelId>
 </PolicyRequest>'

Sample Response in XML Format

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <PolicyResponse>
     <status>200</status>
     <message>Policy update is successfully.</message>
     <policygid>141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171</policygid>
     <policy>
         <agentgid>dede64d3-1d6a-42e9-89e1-714e88f8967c</agentgid>
         <assuranceLevelId>AssuranceLevel1</assuranceLevelId>
         <name>Policy1 Update</name>
         <description>Policy for AssuranceLevel1 Update</description>
         <status>ACTIVE</status>
         <scoringEngine>Average</scoringEngine>
         <weight>100</weight>
         <policygid>141_73875f1eda644e4196248e5ecc824364c5a6c1954350a9927942c6d50c4ed171</policygid>
     </policy>
 </PolicyResponse>
Back to Top