Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs(EDC): Administrative Level 1 Endpoint #632

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion docs/edc/EDC_BPDM_Setup.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "aab9dc22-2777-4429-8e0e-e72311c54d6b",
"_postman_id": "f7afefd6-5d06-49ea-8d77-76fba406e904",
"name": "EDC BPDM Setup",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "29584075"
Expand Down Expand Up @@ -917,6 +917,45 @@
}
},
"response": []
},
{
"name": "GET Administrative Areas Level 1",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 201\", function () {",
" pm.response.to.have.status(201);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"@context\": {},\n \"asset\": {\n \"@type\": \"Asset\",\n \"@id\": \"{{ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}\",\n \"properties\": {\n \"description\": \"GET Administrative Areas Level 1 ({{BPDM_POOL_URL}}/ui/swagger-ui/index.html#/metadata-controller/getAdminAreasLevel1)\",\n \"company\": \"{{COMPANY_ID}}\"\n }\n },\n \"dataAddress\": {\n \"@type\": \"DataAddress\",\n \"type\": \"HttpData\",\n \"baseUrl\": \"{{BPDM_POOL_URL}}/api/catena/administrative-areas-level1\",\n \"oauth2:tokenUrl\": \"{{ASSET_TOKEN_URL}}\",\n \"oauth2:clientId\": \"{{ASSET_CLIENT_ID}}\",\n \"oauth2:clientSecretKey\": \"{{ASSET_CLIENT_SECRET}}\",\n \"proxyQueryParams\": \"true\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{PROVIDER_MANAGEMENT_URL}}/assets",
"host": [
"{{PROVIDER_MANAGEMENT_URL}}"
],
"path": [
"assets"
]
}
},
"response": []
}
]
},
Expand Down Expand Up @@ -1519,6 +1558,11 @@
"key": "ASSET_POST_GENERIC_OUTPUT_SEARCH",
"value": "POST_GENERIC_OUTPUT_SEARCH",
"type": "string"
},
{
"key": "ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1",
"value": "GET_ADMINISTRATIVE_AREAS_LEVEL_1",
"type": "string"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "478bfefa-0ab2-4299-993e-1800562484f5",
"_postman_id": "fbdc004d-e141-4531-9425-4d61be61c990",
"name": "EDC-BPDM Automated Test",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "29584075"
Expand Down Expand Up @@ -4793,6 +4793,212 @@
"response": []
}
]
},
{
"name": "GET Administrative Level 1",
"item": [
{
"name": "Initiate EDR Negotation",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"@context\": {\n\t\t\"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n\t},\n\t\"@type\": \"NegotiationInitiateRequestDto\",\n\t\"connectorAddress\": \"{{PROVIDER_PROTOCOL_URL}}\",\n\t\"protocol\": \"dataspace-protocol-http\",\n\t\"connectorId\": \"{{PROVIDER_ID}}\",\n\t\"providerId\": \"{{PROVIDER_ID}}\",\n\t\"offer\": {\n\t\t\"offerId\": \"{{OFFERID_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}\",\n\t\t\"assetId\": \"{{ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}\",\n\t\t\"policy\": {\n\t\t\t\"@type\": \"odrl:Set\",\n\t\t\t\"odrl:permission\": {\n\t\t\t\t\"odrl:target\": \"{{ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}\",\n\t\t\t\t\"odrl:action\": {\n\t\t\t\t\t\"odrl:type\": \"USE\"\n\t\t\t\t},\n\t\t\t\t\"odrl:constraint\": {\n\t\t\t\t\t\"odrl:or\": {\n\t\t\t\t\t\t\"odrl:leftOperand\": \"BusinessPartnerNumber\",\n\t\t\t\t\t\t\"odrl:operator\": {\n \"@id\": \"odrl:eq\"\n },\n\t\t\t\t\t\t\"odrl:rightOperand\": \"{{POLICY_BPN}}\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"odrl:prohibition\": [],\n\t\t\t\"odrl:obligation\": [],\n\t\t\t\"odrl:target\": \"{{ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}\"\n\t\t}\n\t}\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{CONSUMER_ADAPTER_URL}}/edrs",
"host": [
"{{CONSUMER_ADAPTER_URL}}"
],
"path": [
"edrs"
]
}
},
"response": []
},
{
"name": "Query EDRs Cached",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"// Parse the JSON response",
"var responseBody = pm.response.json();",
"",
"// Check if the response is an array and has elements",
"if (Array.isArray(responseBody) && responseBody.length > 0) {",
" // Get the last object in the array",
" var lastObject = responseBody[responseBody.length - 1];",
"",
" // Check if the last object has the \"edc:transferProcessId\" property",
" if (lastObject.hasOwnProperty(\"edc:transferProcessId\")) {",
" // Copy the value of \"edc:transferProcessId\" to a variable",
" var transferProcessId = lastObject[\"edc:transferProcessId\"];",
"",
" // Log the value to the Postman console",
" console.log(\"Transfer Process ID: \" + transferProcessId);",
"",
" // You can also use the value of transferProcessId as needed",
" // For example, you can set it as an environment variable",
" pm.collectionVariables.set(\"TRANSFERID_AUTOTEST\", transferProcessId);",
" } else {",
" console.log(\"The last object does not have 'edc:transferProcessId' property.\");",
" }",
"} else {",
" console.log(\"Response is not an array or it has no elements.\");",
"}",
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{CONSUMER_ADAPTER_URL}}/edrs?assetId={{ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}",
"host": [
"{{CONSUMER_ADAPTER_URL}}"
],
"path": [
"edrs"
],
"query": [
{
"key": "assetId",
"value": "{{ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1}}"
}
]
}
},
"response": []
},
{
"name": "Get EDR by tp ID",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"// Parse the JSON response",
"var responseBody = pm.response.json();",
"",
"// Check if the response contains the \"edc:authCode\" property",
"if (responseBody.hasOwnProperty(\"edc:authCode\")) {",
" // Get the value of \"edc:authCode\"",
" var authCode = responseBody[\"edc:authCode\"];",
"",
" // Set the collection variable with the value of \"edc:authCode\"",
" pm.collectionVariables.set(\"AUTH_CODE\", authCode);",
"",
" // Log the value to the Postman console",
" console.log(\"edc:authCode: \" + authCode);",
"} else {",
" console.log(\"Response does not contain 'edc:authCode' property.\");",
"}"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{CONSUMER_ADAPTER_URL}}/edrs/{{TRANSFERID_AUTOTEST}}",
"host": [
"{{CONSUMER_ADAPTER_URL}}"
],
"path": [
"edrs",
"{{TRANSFERID_AUTOTEST}}"
]
}
},
"response": []
},
{
"name": "Public API GET",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{AUTH_CODE}}",
"type": "string"
},
{
"key": "key",
"value": "Authorization",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{PROVIDER_PUBLIC_API}}",
"host": [
"{{PROVIDER_PUBLIC_API}}"
]
}
},
"response": []
}
]
}
]
},
Expand Down Expand Up @@ -6553,6 +6759,11 @@
"value": "POST_GENERIC_OUTPUT_SEARCH",
"type": "string"
},
{
"key": "ASSET_GET_ADMINISTRATIVE_AREAS_LEVEL_1",
"value": "GET_ADMINISTRATIVE_AREAS_LEVEL_1",
"type": "string"
},
{
"key": "TRANSFERID_AUTOTEST",
"value": ""
Expand Down Expand Up @@ -6707,6 +6918,11 @@
{
"key": "OFFERID_test-gate-api-asset-2",
"value": ""
},
{
"key": "OFFERID_GET_ADMINISTRATIVE_AREAS_LEVEL_1",
"value": "",
"type": "string"
}
]
}