Is there any API available to add dSource in Delphix?

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • Answered
If I have a already added environment in Delphix, can I add dSource from it using APIs?
I am unable to find required API in documentation, please provide exact link or provide a sample curl script top do so.

Thanks in advance
Anshul
Photo of anshul gupta

anshul gupta

  • 364 Points 250 badge 2x thumb
  • confused

Posted 3 months ago

  • 0
  • 1
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,632 Points 4k badge 2x thumb
Hi Anshul,

Simple script to rework. Please update variables and APIsession to sweet your case



#!/bin/bash
#
DE="192.168.2.131"
# set this to the Delphix admin user name
DELPHIX_ADMIN="delphix_admin"
# set this to the password for the Delphix admin user
DELPHIX_PASS="delphix"
#
# create our session
curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/session \
    -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
    "type": "APISession",
    "version": {
        "type": "APIVersion",
        "major": 1,
        "minor": 4,
        "micro": 1
    }
}
EOF

echo
#
# authenticate to the DE
curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/login \
    -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
    "type": "LoginRequest",
    "username": "${DELPHIX_ADMIN}",
    "password": "${DELPHIX_PASS}"
}
EOF
echo


curl -X POST -k --data @- ${BaseURL}/environment -b "${COOKIE}" -H "${CONTENT_TYPE}" <<EOF
{ "type": "HostEnvironmentCreateParameters",
 "primaryUser": { "type": "EnvironmentUser", "name": "delphix",
 "credential": { "type": "PasswordCredential", "password": "delphix" } },
 "hostEnvironment": { "type": "UnixHostEnvironment", "name": "Linux Host" },
 "hostParameters": { "type": "UnixHostCreateParameters",
 "host": { "type": "UnixHost", "address": "172.16.160.133",
 "toolkitPath": "/var/opt/delphix/toolkit" } }}
 EOF

Regards,

Mouhssine
Photo of anshul gupta

anshul gupta

  • 364 Points 250 badge 2x thumb
Will this add a new environment or will it create a dsource from the environment?
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,632 Points 4k badge 2x thumb
Hi,

Thi will create an environnement only.

But you may find your "happiness" here https://github.com/duckback00/dxapikit/tree/master/API

Regards,

Mouhssine