Generate Metadata for All Tables(View)

If user wants to generate metadata for all of tables of a database in a go, this service can fulfill the purpose. What this service will be doing is reading all of the entities of the given/connected database, sort them in order in such a way that parent metadata should be created before child, and use the existing service ( /metadata/write/generateMetadataForExistingTable) to generate metadata for all of the entities.

The explanation of request packet is as below:

  • databaseName (optional): This param should contain database name that is currently connected to with the service for which we want to generate metadata.

  • schemaName (optional): This param should contain schema name of the database which we are going to generate metadata. This is an optional parameter and if no value provided, it’s default values are as follows:

    • For SQLServer, its default value is ``dbo'' .

    • For PostgreSQL, its default value is ``public''.

  • overwritePolicy (mandatory): This param should contain only following values either skip or abort. This will be used to determine what to do if there’s metadata already available for any entity.

    • skip ( will skip if metadata already available of a particular entity)

    • abort (will abort the operation in case of any already available metadata fond for any entity)

  • tableType (mandatory): This param is used to determine against what type of table, metadata is to be generated. This param should contain only below values and is mandatory.

    • table (for creating metadata of tables only)

    • view (for creating metadata of views only)

    • table_view (for creating metadata for both tables and views)

  • exclusionList (optional): This param is an optional param and is used to exclude any unwanted table/view while generating metadata for all. Table/view’s entity name should be provided e.g., well'', well_completion''.

1. Request URL

/{PDM Server domain}/metadata/write/generateMetadataForAll

Method: POST

2. Request headers

Name Value

Content-Type

application/json

3. Request body

{
    "BUSINESS OBJECT": {
        "language": "en",
        "readBack": true,
        "timezone": "GMT+08:00",
        "data": [
            {
                "databaseName": "dspdm_dev_demo",
                "schemaName": "public",
                "overwritePolicy": "skip",
                "tableType": "table_view",
                "exclusionList": []
            }
        ]
    }
}

Try it myself

4. Responses

{
    "status": {
        "statusCode": 1,
        "statusLabel": "Success"
    },
    "messages": [
        {
            "message": "1 business objects(s) metadata generated successfully.",
            "status": {
                "statusCode": 1,
                "statusLabel": "Success"
            }
        }
    ],
    "exception": {},
    "data": {},
    "version": "0.0.0.0A",
    "threadName": "**system_52184",
    "requestTime": "2021-06-01 13:03:56.325 +08:00",
    "responseTime": "2021-06-01 13:03:57.053 +08:00"
}