Metadata APIs
Use METADATA_BASE_URL=https://<host>/metadata and /base for system lookup. Locate systems and sources before searching objects and reading definitions, fields, and history. Paths below include service prefixes.
Core interfaces
| Method and complete path | Purpose | Key inputs |
|---|---|---|
POST /base/modelCategory/getModelCategories | Systems | No required body; array with categoryId, categoryName |
POST /base/modelCategory/getModelCategoryById | System detail | Required Long query categoryId |
POST /metadata/models/fromre/page | Harvested sources | Body Long categoryId, modelName, currentPage, pageSize; query Boolean showLogicalModel, default false |
GET /metadata/models/{modelId}/schemas | Schemas | Required Long source ID; returns strings |
POST /metadata/entities/searchMetadata | Objects | Body modelIds, schemas, types, keyword, currentPage, pageSize |
GET /metadata/entities/{objectId}/get | Definition | Required Long object ID |
GET /metadata/entities/{objectId}/columns | Table fields | Table ID; optional query keyword |
GET /metadata/entities/{objectId}/history | Object revisions | Required Long object ID |
POST /metadata/dataReport/search | Reports | Body keyword, String array path, currentPage, pageSize |
GET /metadata/dataReport/{dataReportId} | Report and associations | Required Long report ID |
Search criteria
modelIds is a Long array; schemas is a String array. Common types are TABLE, COLUMN, VIEW, STORED_PROCEDURE, FUNCTION. Files, APIs, and metamodels also use SHARE_FILE, API, META_MODEL, and typeIds. Follow actual metamodel types.
{
"currentPage": 1,
"pageSize": 20,
"modelIds": [1001],
"schemas": ["demo_sales"],
"types": ["TABLE", "VIEW"],
"keyword": "customer"
}Replace fictional source and schema. Responses contain totalItems, currentPage, pageSize, and content. Records include id, name, type, definition, and path; use the returned id for detail lookup rather than a display name as a unique key.
Detail fields
| Fields | Meaning |
|---|---|
objectId, modelId, schema, typeId | Source, granularity, type |
physicalName, logicalName, definition | Physical and business names, description |
domains, standardCodes, tags | Applicable standards, reference codes, tags |
owner, udps, properties | Ownership, custom and technical properties |
Field type, notNull, defaultValue, ordinal | Data type, nullability, default, order |
The schema spells precision percision; preserve that actual key. History includes version, createTime, changeHistory, and source details. It describes metadata changes, not database row change logs.
Select the query by source
Query reverse-engineered tables, fields, procedures, and functions as dataset objects; use actual types for metamodel instances. DDM dictionaries and DDL produce table/field metadata, not attachment records. Harvested file-server resources are file objects. BI and custom reports share report queries, with possible relatedTable, path, and url fields.
See Metadata Management. Metadata, catalog details, and business data samples are separate; /entities/data/sample is not a default integration endpoint here.
Synchronize a data dictionary
- Map external systems to authorized
categoryIdandmodelIdvalues. - Page through sources, schemas, and types; read details and fields.
- Store IDs, semantics, technical properties, standards, and synchronization time.
- Compare history and snapshots. Without a suitable incremental cursor, use controlled scans and differences.
- Before treating a missing object as retired, exclude permission changes, failed harvesting, and incomplete pagination.
Validate customer objects and record pagination, permissions, and errors.
Create, schedule, and execute harvesting tasks
Source creation and scheduling are separate. Confirm account access, plugins, and schema scope before execution.
| Method and complete path | Purpose | Inputs |
|---|---|---|
POST /metadata/jobs/createJob | Create harvest/sync task | DatablauJobDescriptor: name, typeName, boundResourceId, boundResourceType, runCycle, schedule, parameters, disabled, @class |
POST /metadata/jobs/startJob | Start now | Long query name described below; String task parameter body |
POST /metadata/jobs/stopJob | Stop | Deployed ID and parameter format |
POST /metadata/jobs/enableJob / disableJob | Enable or disable schedule | Task ID |
POST /metadata/jobs/rescheduleJob | Change schedule | Same query name; schedule body |
POST /metadata/jobs/query/jobs/byDto | Find tasks | Name, type, state, resource, ID, cycle, creator, time |
POST /metadata/jobs/query/jobResults/byCriteria | Results | Task, instance, state, time |
POST /metadata/jobs/query/jobEvents/byCriteria | Events | Instance, event type, time |
POST /metadata/simplejobs/status | Simple job state | Long query jobId |
The source definition's Chinese query name is \u4efb\u52a1ID in Unicode escape notation. Decode it to the literal parameter name if required; confirm gateway handling. Do not translate wire identifiers.
Example task structure:
{
"name": "metadata-sync-demo",
"typeName": "META_DATA_SYNC",
"boundResourceId": 1001,
"boundResourceType": "MODEL",
"runCycle": "CRON",
"schedule": "0 0 2 * * ?",
"parameters": {},
"disabled": false,
"@class": "com.datablau.job.dto.DatablauJobDescriptor"
}Reconfirm @class, typeName, schedule, and ID parameter names after upgrades or gateway transformations. After start timeout, check instances before retrying.
Compare models with DDM
Use harvested database metadata as the baseline and a DDM design model as the target: reverse-engineer, edit in DDM, compare, review, and apply approved changes.
| Method and complete path | Purpose |
|---|---|
GET /metadata/models/{modelId}/compareMappings | Available mappings |
GET /metadata/models/{modelId}/{modelVersionId}/compareResult/{mappingId}/{ddmModelId}/{ddmModelVersionId} | Versioned differences |
GET /metadata/models/{modelId}/{modelVersionId}/compareResultFile/{mappingId}/{ddmModelId}/{ddmModelVersionId} | Export differences |
GET /metadata/models/{modelId}/{mappingId}/compareResultHistory | Comparison history |
POST /metadata/models/{modelId}/{modelVersionId}/updateCompareResultFile | Apply reviewed comparison file |
POST /metadata/models/model/{baseModelId}/compare/{targetModelId} | Compare models |
POST /metadata/models/model/{baseModelId}/compare/{targetModelId}/download | Download report |
Comparison does not replace DDM approval and publication. Retain revisions, mappings, reports, and rollback snapshots.
Controlled updates and bulk maintenance
| Method and complete path | Contract | Guidance |
|---|---|---|
PUT /metadata/entities/{dataObjectId}/summary | Long ID; DataObjectDto body explicitly requires the complete modified object | Not a partial PATCH with only logicalName |
POST /metadata/models/{modelId}/exportAsync | Query tableIds, String tagIds, isSimple; DataObjectExportDto body including schemas | String response requires confirmed job/download handling |
POST /metadata/models/{modelId}/updateMetadata/{ignoreError} | Long model ID, Boolean ignoreError, binary file | Use same-environment export template; editable columns follow template |
Read and snapshot the complete object, modify only approved fields, submit, and read back. writable is an indicator; server authorization remains decisive. Re-read before concurrent updates rather than testing overwrite behavior with empty or omitted fields.
For batches, export, enrich, import, and inspect outcomes. Retain IDs, columns, and failed rows. Validate partial-success behavior for ignoreError; it does not guarantee atomicity.
The current definition declares binary upload under application/json and only String responses for import/export. Confirm actual media type, task tracking, and downloads with the service owner. Until then, use UI bulk maintenance.
