CLI and REST API calls are giving different results for /sourconfig

  • 0
  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I am not getting some values in the API response /resources/json/delphix/sourceconfig?environment=UNIX_HOST_ENVIRONMENT-14 however they were shown when executed in CLI.
When provisioning mysql vdb, db expects unique portno. I wanted to run through all existing ports and pick next port(3312; assuming i have ports from 3308 to 3311) by calling REST API 
API Response: 

CLI Response:
{    "type": "ListResult",
    "status": "OK",
    "result": [
            "type": "MySQLServerConfig",
            "reference": "MYSQL_SERVER_CONFIG-22",
            "namespace": null,
            "name": "/var/tmp/delphix/provision/VNTLS_QA_MYSQL_SRC-FVK/datafile",
            "linkingEnabled": true,
            "discovered": false,
            "environmentUser": "HOST_USER-28",
            "repository": "MYSQL_INSTALL-4",
            "dataDirectory": "/var/tmp/delphix/provision/VNTLS_QA_MYSQL_SRC-FVK/datafile",
            "port": 3308,
            "user": "xxxxx",
            "credentials": {
                "type": "PasswordCredential",
                "password": "***********"
From the above 2 results, portno, user, etc are missing in API. 
We are using DE version. Is this a bug in this version?
Photo of Viswas Patnala

Viswas Patnala

  • 512 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Neal Stack

Neal Stack, Employee

  • 3,422 Points 3k badge 2x thumb
Official Response
Hi Viswas,

Do you set the current API version in your script? Check what the current version is from the CLI with `/version`.

For example, I have:

#!/bin/bash# Set API version
curl -s -X POST -k --data @- \
    -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
    "type": "APISession",
    "version": {
        "type": "APIVersion",
        "major": 1,
        "minor": 8,
        "micro": 1

# Login
echo -e "\n"
curl -s -X POST -k --data @- \
    -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
    "type": "LoginRequest",
    "username": "delphix_admin",
    "password": "delphix"

# List MySQL sourceconfig
echo -e "\n\nListing MySQL sourceconfig..."
curl -X GET -k \
    -b ~/cookies.txt -H "Content-Type: application/json"

Which results in:

Listing MySQL sourceconfig...

I tested with Delphix 5.1.3 but sometimes not setting the API version correctly produces different results.