CDP 4 User Manual

CDP4 Data store control

Data seeding

The CDP4 WebServices make use of a data store implementation which allows data to be retrieved and persisted when working with a ECSS-E-TM-10-25 compliant tool, (e.g. the CDP4 IME). To start working with the CDP4 WebServices, some data definitions (e.g. SiteDirectory reference data) are required. This can be seeded using the ECSS-E-TM-10-25 Annex-C exchange format. The data contained in an exchange archive can be imported into an existing data store (clearing all current data) or used to fill a new one.

To seed the CDP4 data store upload an ECSS-E-TM-10-25 Annex-C exchange file to the CDP4 WebServices endpoint via a HTTP multipart/form-data POST. This will seed the data store, and subsequently create a snapshot of the seeded data. If the archive is password protected included it in the request as a "form" variable. Don't forget to point the curl command to where the file is located on disk.

upload a exchange file with curl:

curl --form password="ARCHIVE_PASSWORD" --form file=@"LOFT_ECSS-E-TM-10-25_AnnexC.zip" http://HOSTNAME/Data/Exchange

NOTE: Depending on the amount of data in an uploaded exchange file, the seeding process can take a number of minutes to complete. If a gateway timeout is received in the meantime this can be safely ignored.

Data Restore

As mentioned above; a snapshot of the seeded data is automatically created. This snapshot file is stored on the server and can be used to restore the data store to its seeded state. This is a useful feature when running (unit) tests on the server and the data store needs to be reverted to a known state in between tests.

restore the data store for the seeded data snapshot with curl

curl -X POST --data '' http://HOSTNAME/Data/Restore

NOTE: The restore function will flush/remove any current data in the data store. This is a non-reversible action!

Application Configuration

The seeding and restore options should be used with care. As both option will wipe-out any existing data in the data store! By default the data store seeding and restore options are disabled in the application configuration. The following lines will allow you to control the state of either functionality, add it to your application config.json file:

 "Backtier": {
    ...
    ...
    "IsDbSeedEnabled": true,
    "IsDbRestoreEnabled": true
  }

NOTE: Restart the service for the settings to take effect.

Last modified 1 year ago.

^ Top