APIPythonOpen-Source Solutions

 View Only
Expand all | Collapse all

While provisioning a new VDB , how to find the "repository" name for a sourceconfig

Vyshak Bheema

Vyshak Bheema10-06-2017 03:46:00 AM

Adam Bowen

Adam Bowen10-06-2017 03:30:00 PM

  • 1.  While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 03:46:00 AM
    Provision a new VDB API Call
    #Masking


  • 2.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 11:23:00 AM


  • 3.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 12:56:00 PM

    Hi Adam,

    Thank you for your response. Yes, I am aware of this example . But I want to know how can I find it for my environment.

    Giving the value mentioned in the example yielded an error stating incorrect value. its environment specific parameter which I am unable to extract .

    Any knowledge about this parameter or command to fetch the oracle install is appreciated.



  • 4.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig
    Best Answer

    Posted 10-06-2017 01:19:00 PM
    Sure, this will get you all the repos in your engine, 
    curl -X GET -k http://delphix-server/resources/json/delphix/repository  \
        -b ~/cookies.txt -H "Content-Type: application/json"

    And this will get you all the repos for the specific server (environment):
    curl -X GET -k http://delphix-server/resources/json/delphix/repository?environment=UNIX_HOST_ENVIRONMENT-2  \
        -b ~/cookies.txt -H "Content-Type: application/json"

    =======My result====
    {
        "type": "ListResult",
        "status": "OK",
        "result": [
            {
                "type": "OracleInstall",
                "reference": "ORACLE_INSTALL-1",
                "namespace": null,
                "name": "/u01/app/oracle/product/11.2.0.4/db_1",
                "version": "11.2.0.4.0",
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "installationHome": "/u01/app/oracle/product/11.2.0.4/db_1",
                "oracleBase": "/u01/app/oracle",
                "groupName": "oinstall",
                "groupId": 500,
                "userName": "delphix",
                "userId": 501,
                "bits": 64,
                "rac": false,
                "discovered": true,
                "logsyncPossible": true,
                "appliedPatches": []
            },
            {
                "type": "OracleInstall",
                "reference": "ORACLE_INSTALL-4",
                "namespace": null,
                "name": "/u01/app/oracle/product/12.1.0/dbhome_1",
                "version": "12.1.0.2.0",
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "installationHome": "/u01/app/oracle/product/12.1.0/dbhome_1",
                "oracleBase": "/u01/app/oracle",
                "groupName": "oinstall",
                "groupId": 500,
                "userName": "delphix",
                "userId": 501,
                "bits": 64,
                "rac": false,
                "discovered": true,
                "logsyncPossible": true,
                "appliedPatches": []
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-10",
                "namespace": null,
                "name": "E-Business Suite R12.2 appsTier",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-5",
                "parameters": {
                    "name": "E-Business Suite R12.2 appsTier"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-12",
                "namespace": null,
                "name": "E-Business Suite R12.2 dbTechStack",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-3",
                "parameters": {
                    "name": "E-Business Suite R12.2 dbTechStack"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-14",
                "namespace": null,
                "name": "Unstructured Files",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-2",
                "parameters": {
                    "name": "Unstructured Files"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-15",
                "namespace": null,
                "name": "SugarCRM Application Repository",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-8",
                "parameters": {
                    "name": "SugarCRM Application Repository"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-16",
                "namespace": null,
                "name": "webapp",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-7",
                "parameters": {
                    "name": "webapp"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-1",
                "namespace": null,
                "name": "agilemasking",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-6",
                "parameters": {
                    "name": "agilemasking"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-2",
                "namespace": null,
                "name": "E-Business Suite R12.1 appsTier",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-1",
                "parameters": {
                    "name": "E-Business Suite R12.1 appsTier"
                }
            },
            {
                "type": "AppDataRepository",
                "reference": "APPDATA_REPOSITORY-4",
                "namespace": null,
                "name": "E-Business Suite R12.1 dbTechStack",
                "version": null,
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "toolkit": "APPDATA_TOOLKIT-4",
                "parameters": {
                    "name": "E-Business Suite R12.1 dbTechStack"
                }
            },
            {
                "type": "PgSQLInstall",
                "reference": "PGSQL_INSTALL-1",
                "namespace": null,
                "name": "/usr/pgsql-9.2",
                "version": "9.2.14",
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": false,
                "variant": "PostgreSQL",
                "installationPath": "/usr/pgsql-9.2",
                "bits": 64,
                "segmentSize": 16777216,
                "discovered": true
            },
            {
                "type": "MySQLInstall",
                "reference": "MYSQL_INSTALL-1",
                "namespace": null,
                "name": "/usr",
                "version": "5.6.36 MySQL Community/Enterprise",
                "linkingEnabled": true,
                "provisioningEnabled": true,
                "environment": "UNIX_HOST_ENVIRONMENT-2",
                "staging": true,
                "internalVersion": {
                    "type": "MySQLVersion",
                    "version": "5.6.36",
                    "variant": "CommunityServer"
                },
                "installationPath": "/usr",
                "discovered": true
            }
        ],
        "job": null,
        "action": null,
        "total": 24,
        "overflow": false
    }




  • 5.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 01:46:00 PM

    Thank you ! that really helped. I was able to get the repo name.

    but after trying to provision with the obtained values , I have the below error:


    {"type":"ErrorResult","status":"ERROR","error":{"type":"APIError","details":"A server error occurred while processing your request.","action":"Please contact Delphix support.","id":null,"commandOutput":null,"diagnoses":null}}.


    Steps followed:

    Step 1: Created Authentication

    Step 2: Login

    Step 3:Provision a new VDB . [Error!]

    Please let me know if I need to consider more factors along way.



  • 6.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 03:30:00 PM
    Can you post your vdb provision call?


  • 7.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 04:41:00 PM

    Hi ,


    FYI:


    ===============my request==============

    {
        "container": {
            "group":"GROUP-32",
            "name": "MBVDB",
            "type": "OracleDatabaseContainer"
        },
        "source": {
            "type": "OracleVirtualSource",
            "mountBase": "/mnt/provision",
            "allowAutoVDBRestartOnHostReboot": false
        },
        "sourceConfig": {
            "type": "OracleSIConfig",
            "databaseName": "MBVDB",
            "uniqueName": "MBVDB",
            "repository": "ORACLE_INSTALL-69",
            "instance": {
                "type": "OracleInstance",
                "instanceName": "MBVDB",
                "instanceNumber": 1
            }
        },
        "timeflowPointParameters": {
            "type": "TimeflowPointLocation",
            "timeflow": "ORACLE_TIMEFLOW-1093",
            "location": "LATEST_SNAPSHOT"
        },
        "type": "OracleProvisionParameters"
    }




  • 8.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 04:46:00 PM
    I saw a unicode character between the uniqueName and repository attributes. Copy and paste your body into a json formatter (like this https://jsonformatter.curiousconcept.com/) , then take that and try your post again. 


  • 9.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 05:03:00 PM

    No Change. Same issue.

    I want to confirm the steps I have followed is accurate:


    Step 1: Authentication API

    Step 2 : Login API

    Step 3: Provision Db API call

    Don't we have to specify Source ad Target hosts where the VDBs should get created ? If not , are there any other steps I need to follow to provision through web service APIs.




  • 10.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 05:30:00 PM
    "ORACLE_INSTALL-69" represents the Oracle Home on the host you want to provision into. The source of the data is represented by "ORACLE_TIMEFLOW-1093"

    Does that make sense? 

    Have you tried completing this operation via the CLI first?

    Watch my video from a couple of years ago. Though I go into using python, the same video follows for doing API's via curl, too.

    http://www.adam.today/2016/06/working-with-delphix-python-module.html



  • 11.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-06-2017 06:50:00 PM

    Hi ,


    I will try through CLI first. Thank you for the piece of advice.

    Also if I could logs for the operations I tried , it would be of great help. How can I extract those logs ?



  • 12.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-09-2017 09:18:00 PM

    Hi,


    As per your suggestion was able to provision a VDB through CLI [Thanks for that!]

    But need your help in provisioning through API.

    Please clarify few of my questions as below:


    1> There is no need to mention Source and Target in API call. How does it find these info ?

    2> what is the relation between repository name and time flow in that call ?


    Thanks,

    Vyshak






  • 13.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig
    Best Answer

    Posted 10-09-2017 09:22:00 PM
    From your earlier example, "ORACLE_INSTALL-69" represents the Oracle Home on the host you want to provision into. The source of the data is represented by "ORACLE_TIMEFLOW-1093". That is how Delphix knows where to get the data, and where to place it.


  • 14.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-09-2017 09:29:00 PM

    Thanks for the quick response.

    Now , I am trying to provision a VDB for a data source. This is my API call:


    {
       "container":{
          "group":"<same group as the datasource>",
          "name":"abcVDB",
          "type":"OracleDatabaseContainer"
       },
       "source":{
          "type":"OracleVirtualSource",
          "mountBase":"/mnt/provision",
          "allowAutoVDBRestartOnHostReboot":false
       },
       "sourceConfig":{
          "type":"OracleSIConfig",
          "databaseName":"abcVDB",
          "uniqueName":"abcVDB",
          "repository":"<target> ",
          "instance":{
             "type":"OracleInstance",
             "instanceName":"abcVDB",
             "instanceNumber":1
          }
       },
       "timeflowPointParameters":{
          "type":"TimeflowPointLocation",
          "timeflow":"source",
          "location":"LATEST_SNAPSHOT"
       },
       "type":"OracleProvisionParameters"

    Please let me know if there is some discrepancy.

    I am getting the below error for that:

    {"type":"ErrorResult","status":"ERROR","error":{"type":"APIError","details":"A server error occurred while processing your request.","action":"Please contact Delphix support.","id":null,"commandOutput":null,"diagnoses":null}}




  • 15.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-09-2017 09:33:00 PM
    Provision via the CLI with setopt trace=true, as per my video. Take the post body from that trace log and compare it to your body above. Note the differences. 


  • 16.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-09-2017 09:34:00 PM

    Thank you ! Could you please send the link to that exact video where it mentions on how to trace ?

    Appreciate your help.



  • 17.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-09-2017 09:42:00 PM
    Same video as before. I demonstrate the trace at the 4 minute mark. 

    http://www.adam.today/2016/06/working-with-delphix-python-module.html


  • 18.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-10-2017 05:21:00 PM
    Thank you! that helped. How can i get the Cluster Node information of my Database?


  • 19.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig
    Best Answer

    Posted 10-10-2017 05:30:00 PM
    look in the http://<delphixip>/api/#clusternode api

    ex.
    curl -X GET -k http://delphix-server/resources/json/delphix/environment/oracle/clusternode  \
        -b ~/cookies.txt -H "Content-Type: application/json"


  • 20.  RE: While provisioning a new VDB , how to find the "repository" name for a sourceconfig

    Posted 10-12-2017 04:40:00 PM

    Hi,

    If I need to get info about a datasource , is this the right API to use?

    curl -X GET -k http://delphix-server/resources/json/delphix/source?database=<datasource name> -b ~/cookies.txt -H "Content-Type: application/json"


    Because I am getting an error as below , if I give a data source value. I get proper info if I give a Virtual DB name.

    {"type":"ErrorResult","status":"ERROR","error":{"type":"APIError","details":"The reference ***** is invalid or of the incorrect type.","action":"Check the source of the reference and the documentation for the requested API. Try again with the correct reference type.","id":"exception.webservices.api.invalid.reference","commandOutput":null,"diagnoses":[]}}