4 Replies Latest reply on Jan 8, 2020 1:13 AM by Pavel Henrykhsen

    Is it possible to assign advanced masking rules with TDM REST API?

    Pavel Henrykhsen New Member

      Hi,

       

      New feature of TDM was introduced in 10.2.0 HF1 allows you to use REST API to talk with TDM from 3rd party tools.

       

      One of the functions that was exposed is Rulesassignment (Assign a Masking Rule to a Column). The documentation is really scarce and I would like to understand before jumping into it, what are the limitations of the API.

       

      Thank you,

      Pavel

        • 1. Re: Is it possible to assign advanced masking rules with TDM REST API?
          Abishek M Active Member

          Limitation wise in the current scenario , you need to be sure on the Rule ID which you are planning to associate . Use the 'View Rules in the Project to Identify the Rule ID ' chapter to identify the list of the Rules under the Project.


          The Developers should have a basic knowledge on the REST API's for better understanding and making use of this feature in the TDM.

           

          As we deal using the REST API , instead of GUI . The Advantage in viewing the immediate changes will be difficult.

          • 2. Re: Is it possible to assign advanced masking rules with TDM REST API?
            Pavel Henrykhsen New Member

            Hi Abishek,

             

            Thank you for the reply.

             

            The advanced rules in TDM can have more than one input and output ports, such as few address lines. There is a limitation in TDM UI to automatically assign such rules by means of discovery and data domains.

             

            I am wondering, if I can overcome this limitation with REST API and it seems that I cannot, which turns the REST API into a prototype, but not a production ready interface.

             

            Best Regards,

            Pavel

            • 3. Re: Is it possible to assign advanced masking rules with TDM REST API?
              Dion Mills New Member

              With an EBF released December 15th, 2019 (sorry I don't have the EBF number), the API provides the ability to POST advancedruleassignments.  Rules with multiple input and output port can be assigned through the API.

               

              {

                "id": 0,

                "name": "string",

                "rule_id": 0,

                "policy": 0,

                "join_condition": "string",

                "input_map": [

                  {

                    "port_id": 0,

                    "rule_port_id": 0

                  }

                ],

                "output_map": [

                  {

                    "port_id": 0,

                    "rule_port_id": 0

                  }

                ]

              }

               

              Multiple {"port_id": 0 "rule_port_id": 0} separated by commas can be included in the input_map and output_map sections.

               

              Through trial and error I learned to leave "id" set to 0.  "name", "policy" and "join_condition" can be left as-is too.  The challenge is finding the rule_port_id values.  They don't seem to be available through the API.  I found them by querying the TDM repository.

               

              SELECT t0.ID_PORT

                ,t1.ID_PORT as ID_TARGET_PORT

                    ,t0.ID_PROJECT as ID_SOURCE_PROJECT

                ,t1.ID_PROJECT as ID_TARGET_PROJECT

                    ,t0.SOURCE_NAME as TABLE_NAME

                    ,t0.PORT_NAME

                    ,t0.ID_RULE_ASSIGNMENT

                    ,t0.RULE_NAME

                    ,t0.MASKING_TYPE

                    ,t0.RULE_TYPE

                    ,t0.ID_RULE

                    ,t0.ID_RULE_PORT

                    ,t0.PORT_TYPE

                    ,t0.ID_GROUP

                FROM INFA_TDM_REPO_2.ILM_ALL_COL_ASSIGNS t0

                inner join

                INFA_TDM_REPO_2.ILM_ALL_COLUMNS t1

                on t0.SOURCE_NAME = t1.SOURCE_NAME and t0.PORT_NAME = t1.PORT_NAME

                where t0.id_project = '4020' and t1.id_project = '8646' and t0.id_rule > '0' and t0.ID_GROUP IS NOT NULL

                order by id_group asc

               

              By feeding the output of this SQL query into a program using the API, I was able to assign masking rules to a target project based upon table and column name matches from a source project. 

              1 of 1 people found this helpful
              • 4. Re: Is it possible to assign advanced masking rules with TDM REST API?
                Pavel Henrykhsen New Member

                Hi Dion,

                 

                Thank you a lot for the information!

                 

                I will check the EBFs.

                 

                Happy New Year,

                Pavel