Delphix Products

 View Only
  • 1.  Add dSource to MSSQL- delphixpy python library

    Posted 11-17-2022 02:19:00 AM
    Hi,

    We are building an API integration framework using delphixpy library and our engine version is 6.0.13. We want to integrate API to add dSource to the existing MSSQL environment. Kindly please help us with some sample code to integrate  for our reference. Thanks in advance!

    ------------------------------
    ArunKumar Shanmugam
    TDM Specialist
    Cognizant Technology Solutions
    ------------------------------


  • 2.  RE: Add dSource to MSSQL- delphixpy python library

    Posted 11-17-2022 09:30:00 AM
    Hi ArunKumar,
    I think you'll find the command and example/syntax here in github: https://github.com/delphix/delphixpy-examples/blob/master/dx_provision_dsource.py

    I hope this helps.

    Michael 

    @Corey Brune

    ------------------------------
    Michael Torok
    Digital Customer Experience, Senior Director
    Delphix
    ------------------------------



  • 3.  RE: Add dSource to MSSQL- delphixpy python library

    Posted 11-22-2022 01:42:00 AM
      |   view attached
    Thanks Michael.

    Luckily, I was referring the same repo to create dSource ,  but later I figured it was created 2 years ago and there are lot of API configuration and design changes happened. Hence, I created below code based on my understanding the API documentation and attaching the error message here for your reference and suggestion if any correction.

    _engine = dx_EngineLogin(_cookie['engine'], _cookie['user'], _cookie['password'], _cookie['domain'])
    link_params = LinkParameters()
    link_params.name = 'dScrc_API'
    link_params.group = find_item_by_name(_engine, group, 'API Group').reference
    link_params.link_data = MSSqlLinkData()
    link_params.link_data.sync_parameters=MSSqlSyncParameters()
    link_params.link_data.sync_parameters.type=MSSqlNewCopyOnlyFullBackupSyncParameters
    link_params.link_data.config = find_item_by_name(_engine, sourceconfig, 'DB_API').reference
    link_params.link_data.ppt_repository = find_dbrepo_envInstanceName(_engine,"MSSqlInstance",find_item_by_name(_engine, environment, <ENVNAME>).reference,'MSSQLSERVER').reference
    link_params.link_data.sourcing_policy = SourcingPolicy()
    link_params.link_data.db_user =<DBUSER>
    link_params.link_data.db_credentials = {"type": "PasswordCredential",""password":<DBPWD>}
    database.link(_engine, link_params)

    ------------------------------
    ArunKumar Shanmugam
    TDM Specialist
    Cognizant Technology Solutions
    ------------------------------



  • 4.  RE: Add dSource to MSSQL- delphixpy python library
    Best Answer

    Posted 11-21-2022 03:35:00 AM
    Edited by Michael Torok 11-30-2022 04:41:43 PM
    Hello Arun 
    You can install the dxtoolkit on target server and configure the delphix engine in dxtool.conf file.
    write simple unix script and with the help of dx_ctl_dsource <Pass parameters >  API you can do that operation.

    ------------------------------
    Pankaj Asegaonkar
    Delphix
    Infosys
    ------------------------------