APIPythonOpen-Source Solutions

Expand all | Collapse all

Engine Upgrade

  • 1.  Engine Upgrade

    Posted 17 days ago
    I would like to automate engine upgrade. First step is to upload the binaries, has anyone done this using python api call, if so-please share code.

    It should look something like this :
    obf = open(binary_file, 'rb')
    result = session.post(url+'/system/uploadUpgrade', file=obf, allow_redirects=False)
    obf.close()
    result_json = json.loads(result.text)
    if result_json['status'] != 'OK':
    raise Exception('Error Uploading Binary File')
    return result_json['result']
    But I am curious about the opening of the binary file and what the result of the api call will look like.

    Thanks

    ------------------------------
    Dafna Meyers

    ------------------------------


  • 2.  RE: Engine Upgrade

    Posted 9 days ago
    Hi Dafna,

    You have a snippet of curl code you can find here "https://docs.delphix.com/docs534/reference/web-service-api-guide/api-cookbook-common-tasks-workflows-and-examples/api-cookbook-uploadupgrade", this will allow you to check the result of the API call.

    Regarding the binary file will result in uploading the upgrade image to a specific directory into the engine, after while an automated routine will check it's presence and will check the image, uncompressed it, etc. until you get the verification step done.

    Regards,

    Mouhssine

    ------------------------------
    Mouhssine SAIDI
    Community Member
    Delphix Community Members
    ------------------------------



  • 3.  RE: Engine Upgrade

    Posted 9 days ago
    Hi Mouhssine,

    I've seen that link you attached. However I've been told that Running this api call in python is a bit different than in curl. Specifically with opening the binary file, how to include it in the api call-either file='open_binary_file' or file = {file='open_binary_file'}
    Once that api call is submitted, what is the expected output? 
    Is it necessary to check the status of the upload?

    ------------------------------
    Dafna Myers
    Assoc
    JPMorgan Chase
    ------------------------------