Difference between revisions of "SOA3 Policy Management Service"
(Created page with '==Introduction== SOA3 Policy Management Service is a REST Service providing the interfaces to perform Create, Read, Update and Delete operation on the policies stored on Argus. T…') |
Andrea.manzi (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Developer's Guide]] | ||
==Introduction== | ==Introduction== | ||
− | SOA3 Policy Management Service is a REST Service providing the interfaces to perform Create, Read, Update and Delete | + | The SOA3 Policy Management Service is a REST Service providing the interfaces to perform Create, Read, Update and Delete operations on the policies stored on Argus. The current version of the Policy Management Service works on atomic policies, called '''rules''' while future versions will support rule combination to create complex policies. |
− | Policy Management Service is used by [[Policy Management Portlet]], which provides a | + | The Policy Management Service is used by the [[Policy Management Portlet]], which provides a human friendly interface, but it can also be used as a separated component to manage the policies with a general purpose REST client. |
− | In this section the | + | In this section the syntax of the REST methods provided is shown. |
==Methods== | ==Methods== | ||
Line 23: | Line 24: | ||
* List Rules By Action | * List Rules By Action | ||
* List Rules By Resource | * List Rules By Resource | ||
− | |||
− | |||
Line 386: | Line 385: | ||
Response: | Response: | ||
200 OK | 200 OK | ||
+ | |||
+ | |||
+ | === List Rules === | ||
+ | <nowiki>GET <root-uri>/</nowiki>policyService/policymanager/rules" | ||
+ | |||
+ | |||
+ | '''HTTP Response:''' | ||
+ | |||
+ | ''Description:'' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''HTTP Status''' | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| '''Description''' | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''200 OK''' | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The rules have been found and is in the body in JSON format | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | '''''Example:''''' | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <nowiki> GET <root-uri>/policyService/policymanager/rules</nowiki>Name> | ||
+ | |||
+ | |||
+ | Response: | ||
+ | 200 OK | ||
+ | |||
+ | Content-Type: application/json | ||
+ | beanList [{ | ||
+ | “attributes” : { "role" : "Admin"}, | ||
+ | "action" : "serviceClass:serviceName", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102013-10112013", | ||
+ | "timeRange" : "10:30-11:30", | ||
+ | "permit" : "true" | ||
+ | }, | ||
+ | { | ||
+ | “attributes” : { "role" : "Guest"}, | ||
+ | "action" : "serviceClass:serviceName", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102012-10112012", | ||
+ | "timeRange" : "11:23-13:30", | ||
+ | "permit" : "true" | ||
+ | } | ||
+ | ] | ||
+ | |||
+ | |||
+ | === List Rules by Subject=== | ||
+ | |||
+ | There are two forms: | ||
+ | |||
+ | ====Single Attribute==== | ||
+ | <nowiki>GET <root-uri>/</nowiki>policyService/policymanager/subjects/{subjectid}/{subjectvalue}" | ||
+ | |||
+ | |||
+ | '''Request Message Body:''' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Name'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Type'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Description'''</center> | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| <center>'''mandatory/optional'''</center> | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>subjectid</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>JSON String</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>the id of the attribute (e.g. role)</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| <center>mandatory</center> | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>subjectvalue</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>JSON String</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>the value of the attribute (e.g. Admin)</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| <center>mandatory</center> | ||
+ | |} | ||
+ | |||
+ | '''HTTP Response:''' | ||
+ | |||
+ | ''Description:'' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''HTTP Status''' | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| '''Description''' | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''200 OK''' | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The rules have been found and is in the body in JSON format | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | '''''Example:''''' | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <nowiki> GET <root-uri>/policyService/policymanager/subjects/role/Admin</nowiki>Name> | ||
+ | |||
+ | |||
+ | Response: | ||
+ | 200 OK | ||
+ | |||
+ | Content-Type: application/json | ||
+ | beanList [{ | ||
+ | “attributes” : { "role" : "Admin"}, | ||
+ | "action" : "serviceClass:serviceName", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102013-10112013", | ||
+ | "timeRange" : "10:30-11:30", | ||
+ | "permit" : "true" | ||
+ | }, | ||
+ | { | ||
+ | “attributes” : { "role" : "Admin"}, | ||
+ | "action" : "serviceClass:serviceName", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102012-10112012", | ||
+ | "timeRange" : "11:23-13:30", | ||
+ | "permit" : "true" | ||
+ | } | ||
+ | ] | ||
+ | |||
+ | |||
+ | ====Multi Attributes==== | ||
+ | <nowiki>GET <root-uri>/</nowiki>policyService/policymanager/subjects/{subjects}" | ||
+ | |||
+ | |||
+ | '''Request Message Body:''' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Name'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Type'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Description'''</center> | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| <center>'''mandatory/optional'''</center> | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>subjects</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>JSON String</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>Base64(attributeName1=attributeValue1:attributeName2=attributeValue2....)</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| <center>mandatory</center> | ||
+ | |} | ||
+ | |||
+ | '''HTTP Response:''' | ||
+ | |||
+ | ''Description:'' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''HTTP Status''' | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| '''Description''' | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''200 OK''' | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The rules have been found and is in the body in JSON format | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | '''''Example:''''' | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <nowiki> GET <root-uri>/policyService/policymanager/subjects/<encodedString></nowiki>Name> | ||
+ | |||
+ | |||
+ | Response: | ||
+ | 200 OK | ||
+ | |||
+ | Content-Type: application/json | ||
+ | beanList [{ | ||
+ | “attributes” : { "role" : "Admin"}, | ||
+ | "action" : "serviceClass:serviceName", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102013-10112013", | ||
+ | "timeRange" : "10:30-11:30", | ||
+ | "permit" : "true" | ||
+ | }, | ||
+ | { | ||
+ | “attributes” : { "role" : "Guest"}, | ||
+ | "action" : "serviceClass:serviceName", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102012-10112012", | ||
+ | "timeRange" : "11:23-13:30", | ||
+ | "permit" : "true" | ||
+ | } | ||
+ | ] | ||
+ | |||
+ | |||
+ | ===List Rules by Action=== | ||
+ | <nowiki>GET <root-uri>/</nowiki>policyService/policymanager/action/{action}" | ||
+ | |||
+ | |||
+ | '''Request Message Body:''' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Name'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Type'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Description'''</center> | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| <center>'''mandatory/optional'''</center> | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>action</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>JSON String</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>the service string (serviceClass:serviceName)</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| <center>mandatory</center> | ||
+ | |} | ||
+ | |||
+ | '''HTTP Response:''' | ||
+ | |||
+ | ''Description:'' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''HTTP Status''' | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| '''Description''' | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''200 OK''' | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The rules have been found and is in the body in JSON format | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | '''''Example:''''' | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <nowiki> GET <root-uri>/policyService/policymanager/action/serviceClass1:serviceName1</nowiki>Name> | ||
+ | |||
+ | |||
+ | Response: | ||
+ | 200 OK | ||
+ | |||
+ | Content-Type: application/json | ||
+ | beanList [{ | ||
+ | “attributes” : { "role" : "Admin"}, | ||
+ | "action" : "serviceClass1:serviceName1", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102013-10112013", | ||
+ | "timeRange" : "10:30-11:30", | ||
+ | "permit" : "true" | ||
+ | }, | ||
+ | { | ||
+ | “attributes” : { "role" : "Guest"}, | ||
+ | "action" : "serviceClass1:serviceName1", | ||
+ | "resource": "hostname", | ||
+ | "dateRange" : "10102012-10112012", | ||
+ | "timeRange" : "11:23-13:30", | ||
+ | "permit" : "true" | ||
+ | } | ||
+ | ] | ||
+ | |||
+ | ===List Rules by Resource=== | ||
+ | <nowiki>GET <root-uri>/</nowiki>policyService/policymanager/resource/{resource}" | ||
+ | |||
+ | |||
+ | '''Request Message Body:''' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Name'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Type'''</center> | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>'''Description'''</center> | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| <center>'''mandatory/optional'''</center> | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>resource</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>JSON String</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>the service instance, i.e. the hostname</center> | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| <center>mandatory</center> | ||
+ | |} | ||
+ | |||
+ | '''HTTP Response:''' | ||
+ | |||
+ | ''Description:'' | ||
+ | |||
+ | {| style="border-spacing:0;" | ||
+ | | style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''HTTP Status''' | ||
+ | | style="border:0.05pt solid #000000;padding:0.097cm;"| '''Description''' | ||
+ | |||
+ | |- | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''200 OK''' | ||
+ | | style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The rules have been found and is in the body in JSON format | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | '''''Example:''''' | ||
+ | |||
+ | Request: | ||
+ | |||
+ | <nowiki> GET <root-uri>/policyService/policymanager/resource/GHNPise</nowiki>Name> | ||
+ | |||
+ | |||
+ | Response: | ||
+ | 200 OK | ||
+ | |||
+ | Content-Type: application/json | ||
+ | beanList [{ | ||
+ | “attributes” : { "role" : "Admin"}, | ||
+ | "action" : "serviceClass1:serviceName1", | ||
+ | "resource": "GHNPise", | ||
+ | "dateRange" : "10102013-10112013", | ||
+ | "timeRange" : "10:30-11:30", | ||
+ | "permit" : "true" | ||
+ | }, | ||
+ | { | ||
+ | “attributes” : { "role" : "Guest"}, | ||
+ | "action" : "serviceClass1:serviceName1", | ||
+ | "resource": "GHNPise", | ||
+ | "dateRange" : "10102012-10112012", | ||
+ | "timeRange" : "11:23-13:30", | ||
+ | "permit" : "true" | ||
+ | } | ||
+ | ] |
Latest revision as of 18:04, 11 December 2013
Contents
Introduction
The SOA3 Policy Management Service is a REST Service providing the interfaces to perform Create, Read, Update and Delete operations on the policies stored on Argus. The current version of the Policy Management Service works on atomic policies, called rules while future versions will support rule combination to create complex policies.
The Policy Management Service is used by the Policy Management Portlet, which provides a human friendly interface, but it can also be used as a separated component to manage the policies with a general purpose REST client.
In this section the syntax of the REST methods provided is shown.
Methods
The root of all the REST requests is:
http(s)://hostname:port/policyService/policymanager
and the method exposed are the following:
- Create Rule
- Get Rule
- Get Rule Id
- Update Rule
- Delete Rule
- List Rules
- List Rules By Subjects
- List Rules By Action
- List Rules By Resource
Create Rule
POST <root-uri>/policyService/policymanager
Request Message Body:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
201 Created | the rule was created |
200 OK | The rule has been created, but optional parameters have not been added |
400 Bad Request | Invalid parameter or field names in the request.
|
Example:
Request:
PUT <root-uri>/policyService/policymanagerName> Content-Type: application/json { “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }
Response: 201 CREATED
Get Rule
GET <root-uri>/policyService/policymanager/{ruleId}"
Request Message Body:
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rule has been found and is in the body in JSON format |
404 Not Found | Rule not found. |
Example:
Request:
GET <root-uri>/policyService/policymanager/fdfv43f43c3124crcName>
Response: 200 OK
Content-Type: application/json { “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }
Get Rule ID
POST <root-uri>/policyService/policymanager/ruleId"
Request Message Body:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rule idhas been found and is in the body |
404 Not Found | Rule id not found. |
Example:
Request:
POST <root-uri>/policyService/policymanager/ruleidName> Content-Type: application/json { “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", }
Response: 200 OK Content-Type: plain/text fdsfvet5gv546u7n67n6n4n
Update Rule
PUT <root-uri>/policyService/policymanager/{ruleId}
Request Message Body:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | the rule has been updated |
304 Not Modified | The rule has not been modified for an error in the new parameters |
404 Not Found | Rule not found
|
Example:
Request:
PUT <root-uri>/policyService/policymanager/{ruleId}Name> Content-Type: application/json { “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }
Response: 200 OK
Delete Rule
DELETE <root-uri>/policyService/policymanager/{ruleId}"
Request Message Body:
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rule has been found and is in the body in JSON format |
400 Bad Request | Rule not deleted |
Example:
Request:
DELETE <root-uri>/policyService/policymanager/fdfv43f43c3124crcName>
Response: 200 OK
List Rules
GET <root-uri>/policyService/policymanager/rules"
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rules have been found and is in the body in JSON format |
Example:
Request:
GET <root-uri>/policyService/policymanager/rulesName>
Response: 200 OK
Content-Type: application/json beanList [{ “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }, { “attributes” : { "role" : "Guest"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102012-10112012", "timeRange" : "11:23-13:30", "permit" : "true" } ]
List Rules by Subject
There are two forms:
Single Attribute
GET <root-uri>/policyService/policymanager/subjects/{subjectid}/{subjectvalue}"
Request Message Body:
|
|
|
|
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rules have been found and is in the body in JSON format |
Example:
Request:
GET <root-uri>/policyService/policymanager/subjects/role/AdminName>
Response: 200 OK
Content-Type: application/json beanList [{ “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }, { “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102012-10112012", "timeRange" : "11:23-13:30", "permit" : "true" } ]
Multi Attributes
GET <root-uri>/policyService/policymanager/subjects/{subjects}"
Request Message Body:
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rules have been found and is in the body in JSON format |
Example:
Request:
GET <root-uri>/policyService/policymanager/subjects/<encodedString>Name>
Response: 200 OK
Content-Type: application/json beanList [{ “attributes” : { "role" : "Admin"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }, { “attributes” : { "role" : "Guest"}, "action" : "serviceClass:serviceName", "resource": "hostname", "dateRange" : "10102012-10112012", "timeRange" : "11:23-13:30", "permit" : "true" } ]
List Rules by Action
GET <root-uri>/policyService/policymanager/action/{action}"
Request Message Body:
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rules have been found and is in the body in JSON format |
Example:
Request:
GET <root-uri>/policyService/policymanager/action/serviceClass1:serviceName1Name>
Response: 200 OK
Content-Type: application/json beanList [{ “attributes” : { "role" : "Admin"}, "action" : "serviceClass1:serviceName1", "resource": "hostname", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }, { “attributes” : { "role" : "Guest"}, "action" : "serviceClass1:serviceName1", "resource": "hostname", "dateRange" : "10102012-10112012", "timeRange" : "11:23-13:30", "permit" : "true" } ]
List Rules by Resource
GET <root-uri>/policyService/policymanager/resource/{resource}"
Request Message Body:
|
|
|
|
|
|
|
|
HTTP Response:
Description:
HTTP Status | Description |
200 OK | The rules have been found and is in the body in JSON format |
Example:
Request:
GET <root-uri>/policyService/policymanager/resource/GHNPiseName>
Response: 200 OK
Content-Type: application/json beanList [{ “attributes” : { "role" : "Admin"}, "action" : "serviceClass1:serviceName1", "resource": "GHNPise", "dateRange" : "10102013-10112013", "timeRange" : "10:30-11:30", "permit" : "true" }, { “attributes” : { "role" : "Guest"}, "action" : "serviceClass1:serviceName1", "resource": "GHNPise", "dateRange" : "10102012-10112012", "timeRange" : "11:23-13:30", "permit" : "true" } ]