Redgate Data Modeler

Importing the physical model

To import a physical model from an XML file as a new document, send an HTTP POST request to the URL: /api/v2/model/new with the XML file as content (body). Related curl example:

curl -u "$TOKEN:" -H "Accept: application/json" -H "Content-Type: text/xml" --data-binary "@/tmp/physical_model.xml" https://datamodeler.redgate-platform.com/api/v2/model/new

As a response, the server will return an "ok" status and the ID of the created document (in case of correct execution) or an error message (in case of incorrect execution).

In the example above, a new document will be created in the root folder and given a default name. To have the document created in a different folder and with a name in the API request, the folderId and name parameters should be added to the URL.

Related curl example:

curl -u "$TOKEN:" -H "Accept: application/json" -H "Content-Type: text/xml" --data-binary "@/tmp/physical_model.xml" 'https://datamodeler.redgate-platform.com/api/v2/model/new?folderId=$FOLDER_ID&name=My_custom_name'

To import a physical model from an XML file to an existing document by overwriting its content, send an HTTP POST request to the URL: /api/v2/model/overwrite/$MODEL_ID with the XML file as content (body).

Related curl example:

curl -u "$TOKEN:" -H "Accept: application/json" -H "Content-Type: text/xml" --data-binary "@/tmp/physical_model.xml" https://datamodeler.redgate-platform.com/api/v2/model/overwrite/$MODEL_ID

To import a physical model from an XML file by adding new objects to an existing document, send an HTTP POST request to the URL: /api/v2/model/add/$MODEL_ID with the XML file as content (body).

Related curl example:

curl -u "$TOKEN:" -H "Accept: application/json" -H "Content-Type: text/xml" --data-binary "@/tmp/physical_model.xml" https://datamodeler.redgate-platform.com/api/v2/model/add/$MODEL_ID

In both of the above scenarios, the server will return an "ok" status (in case of correct execution) or an error message (in case of incorrect execution).


Didn't find what you were looking for?