Policy Management API
{ urn:com.soa.rest.services.policy } PolicyAdmin
The API used to manage PM policies.
GET/policiesReturns a list of policies.
Returns all policies of a given type and optionally those of a specified subtype and/or within a given organization.PolicySpecs a returned without any policy content. A usage example that requests all the audit operational policies from the acme org is as follows:
Request:
GET /rest/policies?type=Operational%20Policy&subType=policy.audit&org=acme
Response:
HTTP/1.1 200 OK
[
{
"Id" : "policy.audit",
"Key" : "urn:uuid:e4aac04e-d8c5-11e4-ade8-b60ac1246d7",
"Name" : "My Audit Policy",
"OrganizationKey" : "uddi:f005b0b2-1079-11e5-a330-a83ecc4e96f2",
"PolicyType" : "Operational Policy",
"PolicySubType" : "policy.audit",
"Description" : "Audits all messages when there is an error.",
}
]
Parameters
Reponse
PolicyConfigurationSpec {
POST/policiesCreates a policy with the supplied WS-Policy in XML.
Creates a policy with the supplied WS-Policy in XML. Returns the policy key if successful.A usage example is as follows:
Request:
POST /rest/policies HTTP/1.1
<PolicySpec xmlns="http://soa.com/uri/products/restapi/xsd/1.0">
<Id>policy.messagethreat</Id>
<Key>urn:uuid:e4aac04e-d8c5-11e4-ade8-b60ac1246d71</Key>
<Name>Created Message Threat</Name>
<OrganizationKey>uddi:f005b0b2-1079-11e5-a330-a83ecc4e96f2</OrganizationKey>
<PolicyType>Operational Policy</PolicyType>
<PolicySubType>policy.messagethreat</PolicySubType>
<Description>My Policy Decsription</Description>
<ReadOnly>true</ReadOnly>
<LocalPolicy>true</LocalPolicy>
<PolicyConfigurationSpec>
<wsp:Policy visibility="public" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<ns2:MessageThreat xmlns:ns2="http://federatedgovernance.org/policy/messagethreat">
<ns2:MaxNestedElementDepth>1</ns2:MaxNestedElementDepth>
<ns2:MaxAttributesPerElement>1</ns2:MaxAttributesPerElement>
<ns2:MaxNodeSize>1</ns2:MaxNodeSize>
<ns2:MaxNSPrefixes>1</ns2:MaxNSPrefixes>
<ns2:MaxNSDefinitions>1</ns2:MaxNSDefinitions>
<ns2:MaxEntitySize>1</ns2:MaxEntitySize>
<ns2:MaxEntities>1</ns2:MaxEntities>
<ns2:MaxEntityRecursiveDepth>1</ns2:MaxEntityRecursiveDepth>
<ns2:MaxEntityExternalRef>1</ns2:MaxEntityExternalRef>
<ns2:MaxEntityExternalRefDepth>1</ns2:MaxEntityExternalRefDepth>
</ns2:MessageThreat>
</wsp:Policy>
</PolicyConfigurationSpec>
</PolicySpec>
Response:
HTTP/1.1 201 Created if request is successful
Parameters
PolicyConfigurationSpec {
Reponse
PolicyConfigurationSpec {
GET/policies/{key}getPolicy
Get details for a specific policy including the actual WS-Policy representation of the policy content.
Request:
GET /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85 HTTP/1.1
Accept: application/json
Response:
HTTP/1.1 200 OK
{
"policyKey" : "urn:uuid:8251350f-b7f1-11e6-b810-c5110657467a",
"policyName" : "wss-msg",
"description" : "",
"organizationKey" : "uddi:soa.com:atmosphere:tenant:atmosphere",
"policyConfiguration" : "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<wsp:Policy visibility=\"public\" xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\"><sp:SignedParts xmlns:sp=\"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy\"><sp:Body/></sp:SignedParts><sp:EncryptedParts xmlns:sp=\"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy\"><sp:Body/></sp:EncryptedParts></wsp:Policy>",
"activeVersion" : 1,
"referencedFromAnyAttachmentPoint" : false,
"policySubType" : "policy.security.message",
"localPolicy" : false,
"policyType" : "Operational Policy",
"numberOfReferences" : 0,
"lastUpdatedDts" : 1480615858000,
"version" : 1,
"state" : "Active",
"id" : 1166,
"readOnly" : false
}
Parameters
Reponse
GET/policies/subtypesgetPolicySubTypes
Returns the supported policy subtypes in the system. Policy subtypes are returned as a list of subtype structures.
Request:
GET /rest/policies/subtypes?type=Operational%20Policy HTTP/1.1
Accept: application/json
Response:
HTTP/1.1 200 OK
[
{
"Id" : "policy.aggregate",
"Name" : "Aggregate Policy"
},
{
"Id" : "policy.httpsecurity",
"Name" : "HTTP Security Policy"
}
]
Parameters
Reponse
GET/policies/typesgetPolicyTypes
Returns the supported policy types in the system. Policy types are returned as a list of symbolic names.
Request:
GET /rest/policies/types HTTP/1.1
Accept: application/json
Response:
HTTP/1.1 200 OK
[ \"Operational Policy\", \"Service Level Policy\", \"Denial of Service\" ]
Parameters
Reponse
GET/policies/{key}getPolicyXML
Get details for a specific policy. The policy is returned as a WS-Policy in XML.
Request:
GET /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85 HTTP/1.1
Accept: application/xml
Response:
HTTP/1.1 200 OK
<wsp:Policy visibility="public" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<ns2:AntiVirusPolicy xmlns:ns2="http://federatedgovernance.org/policy/antivirus">
<ns2:ScanScope>
<ns2:scope>SCAN_ENTIRE</ns2:scope>
</ns2:ScanScope>
<ns2:IcapServer>
<ns2:port>0</ns2:port>
<ns2:uri>icap://a:9999</ns2:uri>
</ns2:IcapServer>
<ns2:AntiVirusAction>Log</ns2:AntiVirusAction>
<ns2:messageScope>IN</ns2:messageScope>
<ns2:messageScope>OUT</ns2:messageScope>
<ns2:messageScope>FAULT</ns2:messageScope>
</ns2:AntiVirusPolicy>
</wsp:Policy>
Parameters
Reponse
PUT/policies/{key}Update a policy..
Update a policy based on given policy specification. A usage example is as follows:
Request:
PUT /rest/policies/threatpolicy HTTP/1.1
<PolicySpec xmlns="http://soa.com/uri/products/restapi/xsd/1.0">
<Name>Test Name Change Simultaneous1</Name>
<Description>Test Description Change Simultaneous1</Description>
<PolicyConfigurationSpec>
<wsp:Policy visibility="public" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<ns2:MessageThreat xmlns:ns2="http://federatedgovernance.org/policy/messagethreat">
<ns2:MaxNestedElementDepth>100</ns2:MaxNestedElementDepth>
<ns2:MaxAttributesPerElement>100</ns2:MaxAttributesPerElement>
<ns2:MaxNodeSize>600</ns2:MaxNodeSize>
<ns2:MaxNSPrefixes>1</ns2:MaxNSPrefixes>
<ns2:MaxNSDefinitions>kk</ns2:MaxNSDefinitions>
<ns2:MaxEntitySize>10</ns2:MaxEntitySize>
<ns2:MaxEntities>0</ns2:MaxEntities>
<ns2:MaxEntityRecursiveDepth>0</ns2:MaxEntityRecursiveDepth>
<ns2:MaxEntityExternalRef>0</ns2:MaxEntityExternalRef>
<ns2:MaxEntityExternalRefDepth>0</ns2:MaxEntityExternalRefDepth>
</ns2:MessageThreat>
</wsp:Policy>
</PolicyConfigurationSpec>
</PolicySpec>
Response:HTTP/1.1 200
<PolicySpec xmlns="http://soa.com/uri/products/restapi/xsd/1.0">
<Name>Test Name Change Simultaneous1</Name>
<Description>Test Description Change Simultaneous1</Description>
<PolicyConfigurationSpec>
<wsp:Policy visibility="public" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<ns2:MessageThreat xmlns:ns2="http://federatedgovernance.org/policy/messagethreat">
<ns2:MaxNestedElementDepth>100</ns2:MaxNestedElementDepth>
<ns2:MaxAttributesPerElement>100</ns2:MaxAttributesPerElement>
<ns2:MaxNodeSize>600</ns2:MaxNodeSize>
<ns2:MaxNSPrefixes>1</ns2:MaxNSPrefixes>
<ns2:MaxNSDefinitions>kk</ns2:MaxNSDefinitions>
<ns2:MaxEntitySize>10</ns2:MaxEntitySize>
<ns2:MaxEntities>0</ns2:MaxEntities>
<ns2:MaxEntityRecursiveDepth>0</ns2:MaxEntityRecursiveDepth>
<ns2:MaxEntityExternalRef>0</ns2:MaxEntityExternalRef>
<ns2:MaxEntityExternalRefDepth>0</ns2:MaxEntityExternalRefDepth>
</ns2:MessageThreat>
</wsp:Policy>
</PolicyConfigurationSpec>
</PolicySpec>
Parameters
PolicyConfigurationSpec {
Reponse
PolicyConfigurationSpec {
DELETE/policies/{key}deletePolicy
Deletes the policy with the specified key.
Request:
DELETE /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85 HTTP/1.1
Response:
HTTP/1.1 200 OK
Parameters
Reponse
GET/policies/{key}/childrengetPolicyChildren
Parameters
Reponse
POST/policies/{key}/childrenaddPolicyChild
Parameters
PolicyConfigurationSpec {
Reponse
PolicyConfigurationSpec {
GET/policies/{key}/versionsgetPolicyVersions
Returns the list of versions for a given policy.
Request:
GET /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85/versions?includeState=true HTTP/1.1
Accept: application/json
Response:
HTTP/1.1 200 OK
[ {
"Version" : "2",
"State" : "Draft"
}, {
"Version" : "1",
"State" : "Active"
} ]
Parameters
Reponse
POST/policies/{key}/versionsCreates a new version of a policy with either a supplied WS-Policy in XML or an existing version number to be cloned.
Creates a new version of a policy with either a supplied WS-Policy in XML or an existing version number to be cloned.
Request:
POST /rest/policies/urn:uuid:36b46ae1-b5cf-11e6-8eb1-bf221f7a4727/versions
Content-Type: application/json
{"Version":"1"}
Response:
HTTP/1.1 200 OK
{
"Version": "7",
"PolicyConfigurationSpec": {}
}
Parameters
Reponse
DELETE/policies/{key}/children/{child}deletePolicyChild
Parameters
Reponse
GET/policies/{key}/versions/{version}getPolicyVersion
Get details for a specific policy version including the actual WS-Policy representation of the policy content.
Request:
GET /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85/versions/1.0 HTTP/1.1
Accept: application/json
Response:
HTTP/1.1 200 OK
{
"policyKey" : "urn:uuid:8251350f-b7f1-11e6-b810-c5110657467a",
"policyName" : "wss-msg",
"description" : "",
"organizationKey" : "uddi:soa.com:atmosphere:tenant:atmosphere",
"policyConfiguration" : "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<wsp:Policy visibility=\"public\" xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\"><sp:SignedParts xmlns:sp=\"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy\"><sp:Body/></sp:SignedParts><sp:EncryptedParts xmlns:sp=\"http://schemas.xmlsoap.org/ws/2005/07/securitypolicy\"><sp:Body/></sp:EncryptedParts></wsp:Policy>",
"activeVersion" : 1,
"referencedFromAnyAttachmentPoint" : false,
"policySubType" : "policy.security.message",
"localPolicy" : false,
"policyType" : "Operational Policy",
"numberOfReferences" : 0,
"lastUpdatedDts" : 1480615858000,
"version" : 1,
"state" : "Active",
"id" : 1166,
"readOnly" : false
}
Parameters
Reponse
PUT/policies/{key}/versions/{version}Update a policy version
Update a policy version based on given policy specification. A usage example is as follows:
Request:
PUT /rest/policies/threatpolicy/versions/2.0 HTTP/1.1
<PolicySpec xmlns="http://soa.com/uri/products/restapi/xsd/1.0">
<Name>Test Name Change Simultaneous1</Name>
<Description>Test Description Change Simultaneous1</Description>
<PolicyConfigurationSpec>
<wsp:Policy visibility="public" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<ns2:MessageThreat xmlns:ns2="http://federatedgovernance.org/policy/messagethreat">
<ns2:MaxNestedElementDepth>100</ns2:MaxNestedElementDepth>
<ns2:MaxAttributesPerElement>100</ns2:MaxAttributesPerElement>
<ns2:MaxNodeSize>600</ns2:MaxNodeSize>
<ns2:MaxNSPrefixes>1</ns2:MaxNSPrefixes>
<ns2:MaxNSDefinitions>kk</ns2:MaxNSDefinitions>
<ns2:MaxEntitySize>10</ns2:MaxEntitySize>
<ns2:MaxEntities>0</ns2:MaxEntities>
<ns2:MaxEntityRecursiveDepth>0</ns2:MaxEntityRecursiveDepth>
<ns2:MaxEntityExternalRef>0</ns2:MaxEntityExternalRef>
<ns2:MaxEntityExternalRefDepth>0</ns2:MaxEntityExternalRefDepth>
</ns2:MessageThreat>
</wsp:Policy>
</PolicyConfigurationSpec>
</PolicySpec>
Response:HTTP/1.1 200
<PolicySpec xmlns="http://soa.com/uri/products/restapi/xsd/1.0">
<Name>Test Name Change Simultaneous1</Name>
<Description>Test Description Change Simultaneous1</Description>
<PolicyConfigurationSpec>
<wsp:Policy visibility="public" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<ns2:MessageThreat xmlns:ns2="http://federatedgovernance.org/policy/messagethreat">
<ns2:MaxNestedElementDepth>100</ns2:MaxNestedElementDepth>
<ns2:MaxAttributesPerElement>100</ns2:MaxAttributesPerElement>
<ns2:MaxNodeSize>600</ns2:MaxNodeSize>
<ns2:MaxNSPrefixes>1</ns2:MaxNSPrefixes>
<ns2:MaxNSDefinitions>kk</ns2:MaxNSDefinitions>
<ns2:MaxEntitySize>10</ns2:MaxEntitySize>
<ns2:MaxEntities>0</ns2:MaxEntities>
<ns2:MaxEntityRecursiveDepth>0</ns2:MaxEntityRecursiveDepth>
<ns2:MaxEntityExternalRef>0</ns2:MaxEntityExternalRef>
<ns2:MaxEntityExternalRefDepth>0</ns2:MaxEntityExternalRefDepth>
</ns2:MessageThreat>
</wsp:Policy>
</PolicyConfigurationSpec>
</PolicySpec>
Parameters
PolicyConfigurationSpec {
Reponse
PolicyConfigurationSpec {
DELETE/policies/{key}/versions/{version}deletePolicyVersion
Deletes a specified version of the given policy.
Request:
DELETE /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85/versions/1.0 HTTP/1.1
Response:
HTTP/1.1 200 OK
Parameters
Reponse
PUT/policies/{key}/versions/{version}/workflowperformWorkflowAction
Performs a workflow action on a policy.
Request:
PUT /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85/versions/1.0/workflow HTTP/1.1
{
"Action" : "Activate Policy",
"Comment" : "Putting policy into production.",
"UserName" : "jdoe"
}
Response:
HTTP/1.1 200 OK
Parameters
GET/policies/{key}/versions/{version}/workflowgetWorkflowActions
Returns the list of workflow actions that can be performed on the given policy.
Request:
GET /rest/policies/urn:uuid:b7f45df7-a864-11e6-9425-9d4da1227f85/versions/1.0/workflow HTTP/1.1
Accept: application/json
Response:
HTTP/1.1 200 OK
[ "Activate" ]