Get list of available system updates
In ProgressHi,
I am looking to upgrade NX to latest version via API. So for that I am looking for following things
- Get list of available update versions
- And upgrade the system to specific version
As per the documentation there are few requests related to NX update like
- /ec2/startUpdate
- /ec2/updateInformation?version=
Will updateInformation, I have to specify the version number and I get download url and other information.
So, is there any api request available to get list of upgrade versions which I can use in "updateInformation" request.
Also, is there any sample request for "/ec2/startUpdate" which can direct start the upgrade process for my Nx Server.
Thanks
-
Thanks for your question. It is glad to hear that you are doing some cool things via our API and integration resource. Please see our answer below to your questions.
1. Get a list of available update versions, So, is there any api request available to get list of upgrade versions which I can use in "updateInformation" request.
We don't have a public list for "available update version", but we have the current release and past release list available on the website. So I am afraid this is likely not possible via current APIs to get this list.
However, there is a JSON that contains the available version information, likely you can parse the file to get the list/information. (Please referred to HERE)2. upgrade the system to specific version
Yes, this is possible. As you may know you can use the updateInformation to get the manifest of a specific version you want to upgrade, and this means you would be able to achieve this goal by doing "query the version", "get the manifest", "request the server to update" and check the final result.
3. sample request for "/ec2/startUpdate"
The request body is the same as the response of "reply" part in updateInformation.
{
"cloudHost": "nxvms.com",
"description": "",
"eula": ....,
"eulaLink": "",
"eulaVersion": 1,
"packages": [ {.....} ],
"releaseDate": "0",
"releaseDeliveryDays": 0,
"releaseNotesUrl": "https://www.networkoptix.com/all-nx-witness-release-notes",
"url": "https://beta.networkoptix.com/beta-builds/default/6.0.0.38983/packages.json",
"version": "6.0.0.38983"
}4. Once the status is "redytoInstall", then you can call the API - POST /api/installUpdates
The request body is blank(empty), but please attach the parameter "peers" to the URL, ex:peers=serverId1,serverId2,serverId3
https://127.0.0.1:7001/api/instalUpdates?peers=serverId1,serverId2,serverId3
5. You may also want to finish the update process. (sometime may as well as ignore those pending or incomplete.) You can use POST /ec2/finishUpdate to close the process by using one optional parameter
ignorePendingPeers
. The request body is{
"ignorePendingPeers": "true"
}Hope this helps.
Thanks. -
Hi Ichiro,
I tried "/ec2/startUpdate" request using the response of "reply" part in updateInformation. But I am getting blank response with StatusCode = 200. Thus that mean success or failure? How can I know the status?
I did request "/ec2/updateStatus" to get status but response didn't had any details. Below is the response
{
"error": "0",
"errorId": "ok",
"errorString": "",
"reply": []
}I also tried "/api/installUpdates" request but I am getting error
Request
https://localhost:7001/api/installUpdate?peers=325ae564-ed97-21be-e508-310848f19fb8
Here ServerID is the "id" received in "GetServer" response.
Response
{
"error": "3",
"errorId": "cantProcessRequest",
"errorString": "Not every participant is ready for update installation"
}Look forward to your reply.
Thanks
-
Hi Gaurav Khanna,
Thanks for your question. From the response, as it stated the endpoint(servers) have not been in "readyToInstall" likely. (based on ""Not every participant is ready for update installation"")
What is the response and result of "/api/updateStatus" to the system?
The API installUpdate needs to be executed while the server is in "redayToInstall".
We kindly ask you to check again the status code. If it is not in the proper state, please execute the "startUpdate" to rebuild the status and manifest for the update procedure.
i.e- /ec2/updateInformation?version=xxxxxxx (get the update manifest)
- /ec2/startUpdate (set the update)
- /ec2/updateStatus (confirm the status code)
- /api/installUpdates?peers=xxxxx (trigger the installation procedure)
Thanks.
-
Hi everyone,
I followed the given instructions, yet the error message persists. I'm trying to update to version 6.0.0.39503 from my current server version of 5.1.5.39242. and my API Base Path is https://localhost:7001
My actions are
1) /ec2/updateInformation?version=6.0.0.39503. I can get the complete package data output from this API by OS.
2) /ec2/startUpdate pass first step output reply object as input, however it returns a 200 ok code instead of a response.
3) /ec2/updateStatus I tried this api after an hour, but the outcome remains the same.
{"error": "0","errorId": "ok","errorString": "","reply": [{"code": "idle","errorCode": "noError","message": "Update information is empty","progress": 0,"serverId": "My Server ID"}]}4) /api/installUpdate?peers=My server id I only have one server in my nx, and the output looks like this.
{"error": "3","errorId": "cantProcessRequest","errorString": "Not every participant is ready for update installation"}Could you help me use the API to update the version? and what I'm missing from here
Please sign in to leave a comment.
Comments
4 comments