Luiza, here is the api transaction log of me adding a windows source to my DE via the CLI. I talk about how to generate this type of information in
https://www.delphix.com/blog/data-virtualization/delphixpy-delphix-python-module-part-2 , as this is how I use it all the time. In the below information, "proxy" is the host reference id of the "Connector Environment" you see in the GUI.
=== POST /resources/json/delphix/environment ===
{
"type": "HostEnvironmentCreateParameters",
"primaryUser": {
"type": "EnvironmentUser",
"name": "delphix\\delphix_admin",
"credential": {
"type": "PasswordCredential",
"password": "delphix"
}
},
"hostEnvironment": {
"type": "WindowsHostEnvironment",
"name": "WINDOWSSOURCE",
"proxy": "WINDOWS_HOST-6"
},
"hostParameters": {
"type": "WindowsHostCreateParameters",
"host": {
"type": "WindowsHost",
"address": "WINDOWSSOURCE"
}
}
}
I then converted that to python that looks like this:
Begin Code
+++++
#!/usr/bin/env python
#Adam Bowen Sept 2016
VERSION="v.0.0.001"
#just a quick and dirty example of adding a windows source
from delphixpy.delphix_engine import DelphixEngine
from delphixpy.web import environment
from delphixpy.web.vo import HostEnvironmentCreateParameters, EnvironmentUser, PasswordCredential, \
WindowsHostEnvironment, WindowsHostCreateParameters, WindowsHost
engine_address = "192.168.2.37"
engine_username = "delphix_admin"
engine_password = "landshark"
def serversess(f_engine_address, f_engine_username, f_engine_password):
"""
Function to setup the session with the Delphix Engine
"""
server_session= DelphixEngine(f_engine_address, f_engine_username, f_engine_password, "DOMAIN")
return server_session
server = serversess(engine_address, engine_username, engine_password)
envCreateParams = HostEnvironmentCreateParameters()
envCreateParams.primary_user = EnvironmentUser()
envCreateParams.primary_user.name = "delphix\delphix_admin"
envCreateParams.primary_user.credential = PasswordCredential()
envCreateParams.primary_user.credential.password = "delphix"
envCreateParams.host_environment = WindowsHostEnvironment()
envCreateParams.host_environment.name = "WINDOWSSOURCE"
envCreateParams.host_environment.proxy = "WINDOWS_HOST-6" #This is the Host ID of the Windows Server that houses the connector
envCreateParams.host_parameters = WindowsHostCreateParameters()
envCreateParams.host_parameters.host = WindowsHost()
envCreateParams.host_parameters.host.address = "WINDOWSSOURCE"
environment.create(server, envCreateParams)
+++++++++++
End code