Delphix Products

 View Only
  • 1.  restart masking engine using API

    Posted 01-26-2023 12:08:00 AM
    Edited by parvez ahmad ap 01-26-2023 12:09:05 AM
    Hi Experts,

    I need help in understanding on how to START/STOP masking engine after masking key is changed using API client. any help is much appreciated.


    ------------------------------
    Parvez Ahmad
    Consultant
    BTP-Icon PTE Ltd.
    ------------------------------


  • 2.  RE: restart masking engine using API

    Posted 01-26-2023 10:52:00 AM

    Hi Ahmad,

    Just to ensure I'm getting the need correctly.

    You are looking for an API call to stop / start masking app not full masking engine VM ?

    Best,

    Mouhssine



    ------------------------------
    Mouhssine Saidi
    Technical Services
    Delphix
    ------------------------------



  • 3.  RE: restart masking engine using API

    Posted 01-26-2023 11:26:00 AM

    Hi Ahmed,

    I did anticipate and providing you with a script automating (reboot of the engine, stop masking app, start masking app)

    You can the script passing the action to take as a parameter like reboot in this example

    reboot_engine.sh reboot


    Best,

    #!/bin/bash
    #
    # sample script to start or stop a VDB.
    #
    # set this to the FQDN or IP address of the Delphix Engine
    DE="192.168.203.3"
    # set this to the Delphix admin user name
    DELPHIX_ADMIN="sysadmin"
    # set this to the password for the Delphix admin user
    DELPHIX_PASS="delphix"
    # set this to the object reference for the VDB
    #
    
    auth()
    {
    #
    # 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": 3
       }
    }
    EOF
    
    echo
    
    #
    # authenticate to the DE
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/login \
       -b ~/cookies.txt -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
    {
       "type": "LoginRequest",
       "username": "${DELPHIX_ADMIN}",
       "password": "${DELPHIX_PASS}"
    }
    EOF
    
    echo
    }
    
    reboot()
    {
    #
    # reboot engine
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/system/reboot \
        -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
    {
    }
    EOF
    echo
    }
    
    
    stop_masking()
    {
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/system/stopMasking \
        -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
    {
    }
    EOF
    echo
    }
    
    
    start_masking()
    {
    curl -s -X POST -k --data @- http://${DE}/resources/json/delphix/system/startMasking \
        -b ~/cookies.txt -H "Content-Type: application/json" <<EOF
    {
    }
    EOF
    echo
    }
    
    
    
    case $1 in
            reboot)
                    echo "Reboot the engine ${DE}"
                    auth
                    reboot
                    ;;
            start)
                    echo "Start masking stack on ${DE}"
                    auth
                    start_masking
                    #break
                    ;;
            stop)
                    echo "Stop masking stack on ${DE}"
                    auth
                    stop_masking
                    #break
                    ;;
            *)
                    echo "Usage: $0 <reboot | start | stop>" 
                    exit 1
                    ;;
      esac


    ------------------------------
    Mouhssine Saidi
    Technical Services
    Delphix
    ------------------------------



  • 4.  RE: restart masking engine using API

    Posted 01-26-2023 10:29:00 PM
    Dear Mouhssine,

    Thanks a ton for your help and reply, let me test this at customer end and get back to you.


    Regards
    Parvez AP

    ------------------------------
    Parvez Ahmad
    Consultant
    BTP-Icon PTE Ltd.
    ------------------------------



  • 5.  RE: restart masking engine using API

    Posted 01-27-2023 01:41:00 AM

    Hello Parvez,
    which "key" did you change ? There are two types of keys:

    System Key > only for some internal processes, this key might (?) need an engine restart.
    Algorithm Security Key > every algorithm instance has a key that can be changed via API, this does clearly not need an engine restart.

    BR .. Tino



    ------------------------------
    Tino Pironti
    Masking SME
    Technical Manager
    Delphix
    ------------------------------