Hi Dafna,
The main idea from my understanding is to write a python script that help you automate the upgrade process.
Let's break tasks as follow :
1/ Check for the image filename to matching delphix upgrade pattern, because if the upgrade image isn't conforme with delphix standard the engine will not accept it
2/ Get a connexion to the engine as SYSTEM user
3/ You can set a control point if you're reuploading an existing image by checking the version from image file and calling this api "resources/json/delphix/system/version"
4/ if step 3 is ok upload the image using this curl API call by passinfg the image file as parameter to it
"/resources/json/system/uploadUpgrade"
5/ keep looping on the job status to check if the upload is ok.
You can take a look on how the api is called with python from the great delphixpy tool by
@Adam Bowen for examle this file
https://github.com/delphix/delphixpy-examples/blob/da86c4c0b581e8efa5dee928e0edc451d78d449b/via_httplib.pyAlso please feel free to take a look on the great dxtool by
@Marcin Przepiorowski perl base coded it can give you some inspiration.
Hope this clarifies things for you
BR,
Mouhssine
------------------------------
Mouhssine SAIDI
Community Member
Delphix Community Members
------------------------------
Original Message:
Sent: 07-02-2020 09:02:37 AM
From: Dafna Myers
Subject: Engine Upgrade
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
Original Message:
Sent: 07-02-2020 03:04:21 AM
From: Mouhssine SAIDI
Subject: Engine Upgrade
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
Original Message:
Sent: 06-24-2020 04:03:31 PM
From: Dafna Myers
Subject: Engine Upgrade
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
------------------------------