ODM Platform Product Plane Policy Service API Reference (0.9.0)

Download OpenAPI specification:Download

ODM Platform Team: odm.info@quantyca.it License: Apache 2.0

This page describe tha API exposed by the Policy Service Server of the Product Plane of the Open Data Mesh Platform.

Overview

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.

Policy Evaluation Results

Endpoints associated to Policy Evaluation Results

Get a PolicyEvaluationResult

Get the PolicyEvaluationResult identified by the given ID

path Parameters
id
required
integer <int64>

Responses

Response samples

Content type
{
  • "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": {
    }
}

Update a PolicyEvaluationResult

Update the given PolicyEvaluationResult

path Parameters
id
required
integer <int64>

ID of the PolicyEvaluationResult to update

Request Body schema:

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)

Responses

Request samples

Content type

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}"

Response samples

Content type
application/json

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

Delete a PolicyEvaluationResult given its ID

path Parameters
id
required
integer <int64>

ID of the PolicyEvaluationResult to delete

Responses

Response samples

Content type
application/json
{
  • "status": 0,
  • "code": "string",
  • "description": "string",
  • "message": "string",
  • "path": "string",
  • "timestamp": 0
}

Get all PolicyEvaluationResults

Get all the registered PolicyEvaluationResult paginated

query Parameters
required
object (Pageable)
required
object (PolicyEvaluationResultSearchOptions)

Responses

Response samples

Content type
[
  • {
    }
]

Create a PolicyEvaluationResult

Create a single PolicyEvaluationResult

Request Body schema:

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)

Responses

Request samples

Content type

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}"

Response samples

Content type
application/json

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}"

PolicyEngines

Endpoints associated to PolicyEngines

Get a PolicyEngine

Get the PolicyEngine identified by the given ID

path Parameters
id
required
integer <int64>

Responses

Response samples

Content type
{
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "id": 0,
  • "name": "string",
  • "displayName": "string",
  • "adapterUrl": "string"
}

Update a PolicyEngine

Update the given PolicyEngine

path Parameters
id
required
integer <int64>

ID of the PolicyEngine to update

Request Body schema:

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

Responses

Request samples

Content type

Example of a PolicyEngine for OPA

{}

Response samples

Content type
application/json

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"
}

Delete a PolicyEngine

Delete a PolicyEngine given its ID

path Parameters
id
required
integer <int64>

ID of the PolicyEngine to delete

Responses

Response samples

Content type
application/json
{
  • "status": 0,
  • "code": "string",
  • "description": "string",
  • "message": "string",
  • "path": "string",
  • "timestamp": 0
}

Get all PolicyEngines

Get all the registered PolicyEngine paginated

query Parameters
required
object (Pageable)
searchOptions
required
object (PolicyEngineSearchOptions)

Responses

Response samples

Content type
[
  • {
    }
]

Create a PolicyEngine

Create a single PolicyEngine

Request Body schema:

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

Responses

Request samples

Content type

Example of a PolicyEngine for OPA

{}

Response samples

Content type
application/json

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"
}

Policies

Endpoints associated to Policies

Get a Policy

Get the active Policy (i.e., the last version) identified by the given Root ID

path Parameters
id
required
integer <int64>

The root ID of the Policy

Responses

Response samples

Content type
{
  • "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": {
    }
}

Update a Policy

Update the given Policy

path Parameters
id
required
integer <int64>

The ID of the Policy to update

Request Body schema:

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

Responses

Request samples

Content type

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}"

Response samples

Content type
application/json

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}"

Delete a Policy

Delete a Policy given its ID

path Parameters
id
required
integer <int64>

ID of the Policy to Delete

Responses

Response samples

Content type
application/json
{
  • "status": 0,
  • "code": "string",
  • "description": "string",
  • "message": "string",
  • "path": "string",
  • "timestamp": 0
}

Get all Policies

Get all the registered Policy paginated

query Parameters
required
object (Pageable)
required
object (PolicySearchOptions)

Responses

Response samples

Content type
[
  • {
    }
]

Create a Policy

Create a single Policy

Request Body schema:

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

Responses

Request samples

Content type

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}"

Response samples

Content type
application/json

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 a Policy version

Get the Policy version identified by the given ID, whether it is active or not

path Parameters
versionId
required
integer <int64>

The ID of the Policy

Responses

Response samples

Content type
{
  • "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": {
    }
}

Validation

Endpoints associated to Policy validation

Validate a input Event

Validate the input Event with all the needed Policies

Request Body schema:
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

Responses

Request samples

Content type
{
  • "resourceType": "DATA_PRODUCT",
  • "dataProductId": "string",
  • "dataProductVersion": "string",
  • "event": "DATA_PRODUCT_CREATION",
  • "currentState": { },
  • "afterState": { }
}

Response samples

Content type
application/json

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}"