I am trying to create a new source environment, via a call to the API.
It Looks like I’m getting my API call rejected because of the engine not recognising the WindowsHostEnvironment Type. I checked the documentation and this seems to be the corect type to use. Our API version is 1.8.1
I was able to successfully make the call to create the environment using the CLI.
What I saw from the json tracking of a successful create via the CLI:
=== POST /resources/json/delphix/environment ===
{
"type": "HostEnvironmentCreateParameters",
"primaryUser": {
"type": "EnvironmentUser",
"name": "REDACTED",
"credential": {
"type": "PasswordCredential",
"password": "REDACTED"
}
},
"hostEnvironment": {
"type": "WindowsHostEnvironment",
"name": "REDACTED",
"proxy": "WINDOWS_HOST-13"
},
"hostParameters": {
"type": "WindowsHostCreateParameters",
"host": {
"type": "WindowsHost",
"address": "REDACTED"
}
}
}
Using the API I issued a post request to ‘https://SERVERNAME/resources/json/delphix/environment’
{
"type": "HostEnvironmentCreateParameters",
"primaryUser": {
"type": "EnvironmentUser",
"name": "REDACTED",
"credential": {
"type": "PasswordCredential",
"password": "REDACTED"
}
},
"hostEnvironment": {
"type": "WindowsHostEnvironment",
"name": "REDACTED",
"proxy": "WINDOWS_HOST_ENVIRONMENT-81"
},
"hostParameters": {
"type": "WindowsHostCreateParameters",
"host": {
"type": "WindowsHost",
"address": "REDACTED"
}
}
}
And got the following response:
{
"type": "ErrorResult",
"status": "ERROR",
"error": {
"type": "APIError",
"details": {
"hostEnvironment": {
"proxy": {
"details": "Reference to invalid object type \"WindowsHostEnvironment\". Expected \"Host\" or sub type.",
"action": null,
"id": "exception.validation.referenceto.invalid",
"commandOutput": null,
"diagnoses": null
}
}
},
"action": "Check your input parameters and try again.",
"id": "exception.validation.bad.input",
"commandOutput": null,
"diagnoses": null
}
}
I have tried settting it as the parent class "HostEnvironment" but this was also not recognised. I also tried as 'Host' and ommitting the type but these calls also failed.
I'd appreciate any pointers to what I should try next.
#Virtualization#dxToolkit