Applicable Delphix Versions
- This document is relevant to the Masking Engine 6.0.2 and upwards
Major Release All Sub Releases 6.0 18.104.22.168
How to Export Using the Masking API
In 6.0.2, there are currently two methods of exporting an environment for import into another masking engine.
Method 1: Environment export/import from the Masking GUI, as below.
This method is xml-based.
This method is being deprecated in favor of method 2.
Method 2: Environment Sync using the Masking API
This technical note focuses on the second method, using the Masking API to sync environments.
You already have source and target masking engines configured, and you seek to export the objects within the environment from the source engine and import them to a target engine. An environment must exist or be created on the target engine to receive the environment objects being exported. Please refer to the documentation for further information on Managing Environments.
To export and import an environment:
- Exporting the Environment from the Source Masking Engine using the Masking Client API.
This example uses the following URL to access the masking api client front-end of the source engine:
a) Log in into the Source engine via the Masking API Client (and Authorize). For information on logging into the Masking API Client please see our document Logging into and Connecting to the Masking API Client (KBA5754)
b) Get the object-id details of the environment to be exported. To do this, expand the sync section and then expand the GET /syncable-objects call.
From the object_type list, select 'Environment', as below, then click on
A successful 'get' will return a Response Body similar to:
For our example we are interested in the environment with the objectIdentifier id of 2.
We take a note of the string required for the next step:
The export call takes a JSON object that is a list of the objects to export. While we only need a single object for the task at hand, it is written to handle multiple objects if needed. In JSON, lists are denoted with square brackets ([ and ]) So you will note that the desired object above is wrapped in square brackets in the export call below because the export call is expecting a list.
c) Export the environment using
Add the 'object identifier' block from above, into the Parameter value field, then click Try it Out.
A successful export should return a Response Body similar-looking to :
Copy the whole block of data from the Response Body, this will be used to import the environment objects into the target engine.
2) Importing the Environment into the Target Masking Engine using the Masking Client API
a) Log in into the Masking API client of the target engine, and Authorize
b) Navigate to
Scroll down to:
Paste or copy into the Parameter value field the block of data gathered from the Environment export. Enter the environment_id that will be used to import the environment objects into.
Click Try it out to execute the import. If there are no errors and you get a 'Response Code' of 200 then the task is completed.
c) It is possible that during the environment import you will get an algorithm-related error as per the sample error below.
In this case you should also do a Sync export of the referenced algorithm and its related domain.
To do this return to the source Masking Engine and export the domain that is related to the algorithm referenced in the error. The domain Sync export will also include the masking key for the referenced algorithm.
i) Use , , object_type=DOMAIN, to get the object Id/information to use for exporting the domain:
In this scenario we are interested in the domain linked with the algorithm in the error, domain 'DOB':
ii) Provide this information in the Parameter value field for 'Sync - Export Masking Object', as below:
Click on Try it out. If successful (Response Code 200),the exportResponseMetadata for the domain will be found under "Response Body" as per example below:
Copy the information in the Response Body, this will be used to import the domain into the target masking engine.
iii) At the target engine, click Post - Import Masking Objects, paste in the copied domain-related information into
the Parameter Value field, click Try it out. A successful domain import will return a response body as per example below.
iv) Now attempt to import the Environment again. This time a successful Environment import will return a response body whereby an import status of "SUCCESS' returned.
The following articles may provide more information or related information to this article: