Original Message:
Sent: 02-27-2023 02:48:11 PM
From: Vijayender Singidi
Subject: API for linking Data Sources and sync data with SQL server
Hi,
for creating environments you have execute different payload at endpoint , you can generate api payload through CLi by setting "setopt trace=true"
$EnvironmentPayload = "{
\"type\": \"HostEnvironmentCreateParameters\",
\"primaryUser\": {
\"type\": \"EnvironmentUser\",
\"name\": \"${EnvironmentUserName}\",
\"credential\": {
\"type\": \"PasswordCredential\",
\"password\": \"${EnvironmentPassword}\"
},
\"environment\" : \"$StagEnviRef\" },
\"hostEnvironment\": {
\"type\": \"WindowsHostEnvironment\",
\"name\": \"${Envi_Name}\",
\"proxy\": \"${proxyref}\" }, ## staging environmen's host reference
\"hostParameters\": {
\"type\": \"WindowsHostCreateParameters\",
\"host\": {
\"type\": \"WindowsHost\",
\"address\": \"$Envi_Address\"
}
}
}"
CREATE_ENVIRONMENT=$(curl -b $cookies_Login -sX POST --header 'Content-Type: application/json' -d "${environment_payload}" -k "https://${dlpx_engine}/resources/json/delphix/environment")
------------------------------
Vijayender Singidi
Original Message:
Sent: 02-27-2023 01:34:53 PM
From: Abhishek Ramesh babu
Subject: API for linking Data Sources and sync data with SQL server
Hi Vijayender,
Thank for you response.
Can i use the same API for creating Enviornment and target.
------------------------------
Abhishek Ramesh babu
Cloud Automation Engineer - Delphix
Credit Suisse AG
Original Message:
Sent: 02-27-2023 09:25:01 AM
From: Vijayender Singidi
Subject: API for linking Data Sources and sync data with SQL server
Hi Abhishek,
here the steps and endpoints for Create the D-source through API
- Create session
- Get Authenticate
- Create source environment if not exist
- Get SourceConfig reference of Database being onboard
sourceconfiglist=$(curl -b $cookies_Login -sX GET --header 'Content-Type: application/json' -k "https://${dlpx_engine}/resources/json/delphix/sourceconfig")
- link the source
linkpayload="{ "\"type"\": "\"LinkParameters"\", "\"name"\": "\"$sourcedbname"\", "\"group"\": "\"$SourceGroupReference"\", "\"linkData"\": { "\"type"\": "\"MSSqlLinkData"\", "\"config"\": "\"$sourceconfigref"\", "\"sourcingPolicy"\": { "\"type"\": "\"SourcingPolicy"\", "\"logsyncEnabled"\": false }, "\"sharedBackupLocations"\": [ ], "\"syncParameters"\": { "\"type"\": "\"MSSqlNewCopyOnlyFullBackupSyncParameters"\", "\"compressionEnabled"\": true, "\"backupPolicy"\": "\"PRIMARY"\" }, "\"mssqlUser"\": { "\"type"\": "\"MSSqlEnvironmentUser"\", "\"user"\": "\"$TargetEnvironmentprimaryuser"\" }, "\"pptRepository"\": "\"$TarepositoryReference"\", "\"pptHostUser"\": "\"$TargetEnvironmentprimaryuser"\", "\"ingestionStrategy"\": { "\"type"\": "\"DelphixManagedBackupIngestionStrategy"\", "\"compressionEnabled"\": true, "\"backupPolicy"\": "\"PRIMARY"\" } }}" d_source=`curl -b $cookies_Login -sX POST --header 'Content-Type: application/json' -d "$linkpayload" -k "${VIRTUALIZATION_ENGINE}/database/link"`
------------------------------
Vijayender Singidi
Original Message:
Sent: 02-27-2023 07:30:00 AM
From: Abhishek Ramesh babu
Subject: API for linking Data Sources and sync data with SQL server
Thank Michael for your quick response.
------------------------------
Abhishek Ramesh babu
Cloud Automation Engineer - Delphix
Credit Suisse AG
Original Message:
Sent: 02-24-2023 03:32:51 PM
From: Michael Torok
Subject: API for linking Data Sources and sync data with SQL server
Hi Abhishek,
I think you might find a very good start here in this thread about using the dxToolkit for a similar request: https://community.delphix.com/discussion/snapsynch-creation-using-dxtoolkit-for-mssql-db.
Let me know if that helps.
Thanks,
Michael
------------------------------
Michael Torok
Digital Customer Experience, Senior Director
Delphix
Original Message:
Sent: 02-24-2023 02:59:39 PM
From: Abhishek Ramesh babu
Subject: API for linking Data Sources and sync data with SQL server
I want to automate the process of linking Source database to target enviornment in delphix engine with the help of API's.
As there are manual steps to do that, i want to automate it by API's, i am requesting if anyone can help on that
------------------------------
Abhishek Ramesh babu
Cloud Automation Engineer - Delphix
Credit Suisse AG
------------------------------