Download OpenAPI specification:Download
This page describe tha API exposed by the Policy Service Server of the Product Plane of the Open Data Mesh Platform.
The Policy Module of the Open Data Mesh platform manages the lifecycle of policies.Specifically, it handles the creation, update and deletion of a policy for a specific policy executor, as well as managing the evaluation of the policies in different phases of the lifecycle of a Data Product object.
Get the PolicyEvaluationResult identified by the given ID
id required | integer <int64> |
{- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "dataProductId": "string",
- "dataProductVersion": "string",
- "inputObject": { },
- "outputObject": "string",
- "result": true,
- "policyId": 0,
- "policy": {
- "lastVersion": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "rootId": 0,
- "name": "string",
- "displayName": "string",
- "description": "string",
- "blockingFlag": true,
- "rawContent": "string",
- "suite": "string",
- "evaluationEvent": "string",
- "filteringExpression": "string",
- "isLastVersion": true,
- "policyEngine": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
}
}
Update the given PolicyEvaluationResult
id required | integer <int64> ID of the PolicyEvaluationResult to update |
A PolicyEvaluationResult JSON object
createdAt | string <date-time> The creation timestamp. Automatically handled by the API: can not be modified. |
updatedAt | string <date-time> The last update timestamp. Automatically handled by the API: can not be modified. |
id | integer <int64> Auto-generated ID of the PolicyEvaluationResult |
dataProductId | string ID of the Data Product evaluated (if the evaluation subject was a Data Product) |
dataProductVersion | string Version number of the Data Product evaluated (if the evaluation subject was a Data Product) |
inputObject | object (JsonNode) JSON representation of the evaluated object |
outputObject | string JSON representation of the evaluation output object |
result | boolean Whether the evaluation is successful or not |
policyId | integer <int64> ID of the policy used for the evaluation |
object (PolicyResource) |
Example of a PolicyEvaluationResult for OPA
"{\n \"id\": 1,\n \"dataProductId\": \"abc123\",\n \"dataProductVersion\": \"1.0.1\",\n \"inputObject\": \"{\"name\":\"dp-1\",\"description\":\"DataProduct1Draft\",\"domain\":\"Marketing\"}\",\n \"outputObject\": \"{\"allow\":true}\",\n \"result\": true,\n \"policyId\": 1,\n \"createdAt\": \"a\"\n}"
evaluation
"{\n \"id\": 1,\n \"dataProductId\": \"abc123\",\n \"dataProductVersion\": \"1.0.1\",\n \"inputObject\": \"{\"name\":\"dp-1\",\"description\":\"DataProduct1Draft\",\"domain\":\"Marketing\"}\",\n \"outputObject\": \"{\"allow\":true}\",\n \"result\": true,\n \"policyId\": 1,\n \"createdAt\": \"a\",\n \"updatedAt\": \"a\"\n}"
Delete a PolicyEvaluationResult given its ID
id required | integer <int64> ID of the PolicyEvaluationResult to delete |
{- "status": 0,
- "code": "string",
- "description": "string",
- "message": "string",
- "path": "string",
- "timestamp": 0
}
Get all the registered PolicyEvaluationResult paginated
required | object (Pageable) |
required | object (PolicyEvaluationResultSearchOptions) |
[- {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "dataProductId": "string",
- "dataProductVersion": "string",
- "inputObject": { },
- "outputObject": "string",
- "result": true,
- "policyId": 0,
- "policy": {
- "lastVersion": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "rootId": 0,
- "name": "string",
- "displayName": "string",
- "description": "string",
- "blockingFlag": true,
- "rawContent": "string",
- "suite": "string",
- "evaluationEvent": "string",
- "filteringExpression": "string",
- "isLastVersion": true,
- "policyEngine": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
}
}
]
Create a single PolicyEvaluationResult
A PolicyEvaluationResult JSON object
createdAt | string <date-time> The creation timestamp. Automatically handled by the API: can not be modified. |
updatedAt | string <date-time> The last update timestamp. Automatically handled by the API: can not be modified. |
id | integer <int64> Auto-generated ID of the PolicyEvaluationResult |
dataProductId | string ID of the Data Product evaluated (if the evaluation subject was a Data Product) |
dataProductVersion | string Version number of the Data Product evaluated (if the evaluation subject was a Data Product) |
inputObject | object (JsonNode) JSON representation of the evaluated object |
outputObject | string JSON representation of the evaluation output object |
result | boolean Whether the evaluation is successful or not |
policyId | integer <int64> ID of the policy used for the evaluation |
object (PolicyResource) |
Example of a PolicyEvaluationResult for OPA
"{\n \"dataProductId\": \"abc123\",\n \"dataProductVersion\": \"1.0.1\",\n \"inputObject\": \"{\"name\":\"dp-1\",\"description\":\"DataProduct1Draft\",\"domain\":\"Marketing\"}\",\n \"outputObject\": \"{\"allow\":true}\",\n \"result\": true,\n \"policyId\": 1\n}"
evaluation
"{\n \"id\": 1,\n \"dataProductId\": \"abc123\",\n \"dataProductVersion\": \"1.0.1\",\n \"inputObject\": \"{\"name\":\"dp-1\",\"description\":\"DataProduct1Draft\",\"domain\":\"Marketing\"}\",\n \"outputObject\": \"{\"allow\":true}\",\n \"result\": true,\n \"policyId\": 1,\n \"createdAt\": \"a\",\n \"updatedAt\": \"a\"\n}"
Get the PolicyEngine identified by the given ID
id required | integer <int64> |
{- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
Update the given PolicyEngine
id required | integer <int64> ID of the PolicyEngine to update |
A PolicyEngine JSON object
createdAt | string <date-time> The creation timestamp. Automatically handled by the API: can not be modified. |
updatedAt | string <date-time> The last update timestamp. Automatically handled by the API: can not be modified. |
id | integer <int64> Auto-generated ID of the PolicyEngine |
name | string Unique name of the PolicyEngine |
displayName | string Human readable display name of the PolicyEngine |
adapterUrl | string URL to reach the Validator Adapter working as PolicyEngine |
Example of a PolicyEngine for OPA
{- "id": 1,
- "name": "opa-policy-checker",
- "displayName": "OPA Policy Checker",
- "createdAt": "2024-03-21T12:04:11.000+00:00"
}
engine1
{- "id": 1,
- "name": "opa-policy-checker",
- "displayName": "OPA Policy Checker",
- "createdAt": "2024-03-21T12:04:11.000+00:00",
- "updatedAt": "2024-03-21T12:06:31.000+00:00"
}
Get all the registered PolicyEngine paginated
required | object (Pageable) |
searchOptions required | object (PolicyEngineSearchOptions) |
[- {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
]
Create a single PolicyEngine
A PolicyEngine JSON object
createdAt | string <date-time> The creation timestamp. Automatically handled by the API: can not be modified. |
updatedAt | string <date-time> The last update timestamp. Automatically handled by the API: can not be modified. |
id | integer <int64> Auto-generated ID of the PolicyEngine |
name | string Unique name of the PolicyEngine |
displayName | string Human readable display name of the PolicyEngine |
adapterUrl | string URL to reach the Validator Adapter working as PolicyEngine |
Example of a PolicyEngine for OPA
{- "name": "opa-policy-checker",
- "displayName": "OPA Policy Checker",
}
engine1
{- "id": 1,
- "name": "opa-policy-checker",
- "displayName": "OPA Policy Checker",
- "createdAt": "2024-03-21T12:04:11.000+00:00",
- "updatedAt": "2024-03-21T12:06:31.000+00:00"
}
Get the active Policy (i.e., the last version) identified by the given Root ID
id required | integer <int64> The root ID of the Policy |
{- "lastVersion": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "rootId": 0,
- "name": "string",
- "displayName": "string",
- "description": "string",
- "blockingFlag": true,
- "rawContent": "string",
- "suite": "string",
- "evaluationEvent": "string",
- "filteringExpression": "string",
- "isLastVersion": true,
- "policyEngine": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
}
Update the given Policy
id required | integer <int64> The ID of the Policy to update |
A PolicyEngine JSON object
lastVersion | boolean |
createdAt | string <date-time> The creation timestamp. Automatically handled by the API: can not be modified. |
updatedAt | string <date-time> The last update timestamp. Automatically handled by the API: can not be modified. |
id | integer <int64> Auto-generated ID of the Policy |
rootId | integer <int64> ID of the parent Policy (the same of the previous ID if the policy was never updated) |
name | string Unique name of the Policy |
displayName | string Human readable display name of the Policy |
description | string Policy description |
blockingFlag | boolean Whether the Policy is blocking or not in regards to the suite |
rawContent | string Raw content of the Policy implementation if exists |
suite | string The name of the suite which the policy belongs |
evaluationEvent | string A tag, a phase, something that identify in which stages of the lifecycle the Policy must be evaluated |
filteringExpression | string A SpEL expression to be evaluated on the input object of a validation request to exclude or include the Policy in the set of policies to be evaluated |
isLastVersion | boolean Whether or not the Policy is the last version |
object (PolicyEngineResource) The PolicyEngine that will evaluate the Policy |
Example of a Policy OPA
"{\n \"id\": 1,\n \"name\": \"dataproduct-name-checker\",\n \"displayName\": \"Data Product Name Checker\",\n \"description\": \"Check whether the name of the input Data Product is compliant with global naming convention or not\",\n \"blocking_flag\": true,\n \"rawContent\": \"package dataproduct-name-checker\n\ndefault allow := false\n\nallow := true { \n startswith(input.name, \"dp-\")\n}\",\n \"evaluationEvent\": \"DATA_PRODUCT_CREATION\",\n \"suite\": \"Suite Name\",\n \"policyEngineId\": 1,\n \"createdAt\": \"a\"\n}"
engine1
"{\n \"id\": 1,\n \"name\": \"dataproduct-name-checker\",\n \"displayName\": \"Data Product Name Checker\",\n \"description\": \"Check whether the name of the input Data Product is compliant with global naming convention or not\",\n \"blocking_flag\": true,\n \"rawContent\": \"package dataproduct-name-checker\n\ndefault allow := false\n\nallow := true { \n startswith(input.name, \"dp-\")\n}\",\n \"evaluationEvent\": \"DATA_PRODUCT_CREATION\",\n \"suite\": \"Suite Name\",\n \"policyEngineId\": 1,\n \"createdAt\": \"a\",\n \"updatedAt\": \"a\"\n}"
Get all the registered Policy paginated
required | object (Pageable) |
required | object (PolicySearchOptions) |
[- {
- "lastVersion": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "rootId": 0,
- "name": "string",
- "displayName": "string",
- "description": "string",
- "blockingFlag": true,
- "rawContent": "string",
- "suite": "string",
- "evaluationEvent": "string",
- "filteringExpression": "string",
- "isLastVersion": true,
- "policyEngine": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
}
]
Create a single Policy
A PolicyEngine JSON object
lastVersion | boolean |
createdAt | string <date-time> The creation timestamp. Automatically handled by the API: can not be modified. |
updatedAt | string <date-time> The last update timestamp. Automatically handled by the API: can not be modified. |
id | integer <int64> Auto-generated ID of the Policy |
rootId | integer <int64> ID of the parent Policy (the same of the previous ID if the policy was never updated) |
name | string Unique name of the Policy |
displayName | string Human readable display name of the Policy |
description | string Policy description |
blockingFlag | boolean Whether the Policy is blocking or not in regards to the suite |
rawContent | string Raw content of the Policy implementation if exists |
suite | string The name of the suite which the policy belongs |
evaluationEvent | string A tag, a phase, something that identify in which stages of the lifecycle the Policy must be evaluated |
filteringExpression | string A SpEL expression to be evaluated on the input object of a validation request to exclude or include the Policy in the set of policies to be evaluated |
isLastVersion | boolean Whether or not the Policy is the last version |
object (PolicyEngineResource) The PolicyEngine that will evaluate the Policy |
Example of a Policy OPA
"{\n \"name\": \"dataproduct-name-checker\",\n \"displayName\": \"Data Product Name Checker\",\n \"description\": \"Check whether the name of the input Data Product is compliant with global naming convention or not\",\n \"blocking_flag\": true,\n \"rawContent\": \"package dataproduct-name-checker\n\ndefault allow := false\n\nallow := true { \n startswith(input.name, \"dp-\")\n}\",\n \"evaluationEvent\": \"DATA_PRODUCT_CREATION\",\n \"suite\": \"Suite Name\",\n \"policyEngineId\": 1\n}"
engine1
"{\n \"id\": 1,\n \"name\": \"dataproduct-name-checker\",\n \"displayName\": \"Data Product Name Checker\",\n \"description\": \"Check whether the name of the input Data Product is compliant with global naming convention or not\",\n \"blocking_flag\": true,\n \"rawContent\": \"package dataproduct-name-checker\n\ndefault allow := false\n\nallow := true { \n startswith(input.name, \"dp-\")\n}\",\n \"evaluationEvent\": \"DATA_PRODUCT_CREATION\",\n \"suite\": \"Suite Name\",\n \"policyEngineId\": 1,\n \"createdAt\": \"a\",\n \"updatedAt\": \"a\"\n}"
Get the Policy version identified by the given ID, whether it is active or not
versionId required | integer <int64> The ID of the Policy |
{- "lastVersion": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "rootId": 0,
- "name": "string",
- "displayName": "string",
- "description": "string",
- "blockingFlag": true,
- "rawContent": "string",
- "suite": "string",
- "evaluationEvent": "string",
- "filteringExpression": "string",
- "isLastVersion": true,
- "policyEngine": {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "id": 0,
- "name": "string",
- "displayName": "string",
- "adapterUrl": "string"
}
}
Validate the input Event with all the needed Policies
resourceType | string Enum: "DATA_PRODUCT" "ACTIVITY_TRANSITION" "ACTIVITY_RESULT" "TASK_RESULT" Resource type |
dataProductId | string ID of the Data Product evaluated (if the evaluation subject was a Data Product) |
dataProductVersion | string Version number of the Data Product evaluated (if the evaluation subject was a Data Product) |
event | string Enum: "DATA_PRODUCT_CREATION" "DATA_PRODUCT_UPDATE" "ACTIVITY_STAGE_TRANSITION" "TASK_EXECUTION_RESULT" "ACTIVITY_EXECUTION_RESULT" The event that triggered the evaluation |
currentState | object (JsonNode) JSON representation of the evaluated object |
afterState | object (JsonNode) JSON representation of the evaluated object |
{- "resourceType": "DATA_PRODUCT",
- "dataProductId": "string",
- "dataProductVersion": "string",
- "event": "DATA_PRODUCT_CREATION",
- "currentState": { },
- "afterState": { }
}
evaluation
"{\n \"id\": 1,\n \"dataProductId\": \"abc123\",\n \"dataProductVersion\": \"1.0.1\",\n \"inputObject\": \"{\"name\":\"dp-1\",\"description\":\"DataProduct1Draft\",\"domain\":\"Marketing\"}\",\n \"outputObject\": \"{\"allow\":true}\",\n \"result\": true,\n \"policyId\": 1,\n \"createdAt\": \"a\",\n \"updatedAt\": \"a\"\n}"