Ambassador - Service that returns all kind names with # of records
As a GCZ Developer, I want to develop a service within the Transformer's Ambassador that scans the current OSDU instance for kinds and returns a list of kinds + record count.
This service will assist with GCZ deployments, and may be used by AdminUI later on.
Acceptance Criteria
- Ambassador Service developed which returns a list of an OSDU instance's kinds + # of records per version.
- Endpoint documented.
- Service included in Postman Collection
- Add
supportedKinds
array toapplication.yml
master-data--Well:
master-data--Wellbore:
master-data--SeismicAcquisitionSurvey:
work-product-component--WellboreTrajectory:
work-product-component--WellLog:
work-product-component--WellboreMarkerSet:
work-product-component--SeismicTraceData:
Service Guidelines
- Query a list of all kinds in OSDU:
{{Storage_Host}}/query/kinds
- Identify all kinds/versions from list that match
supportedKinds
array inapplication.yml
- For each identified kind: query total count using the search service with below payload:
{ "kind": "{{insert_kind_here}}", "limit": 1, "returnedFields": [""] }
- Return sorted output of all kinds + counts
- Example Output of Ambassador Service:
{
"kinds": [
{
"name": "osdu:wks:master-data--Well:1.0.0",
"recordCount": 674
},
{
"name": "osdu:wks:master-data--Well:1.1.0",
"recordCount": 34
},
{
"name": "osdu:wks:master-data--Wellbore:1.0.0",
"recordCount": 700
}
]
}