NEO Software Upgrade
File Name |
neo_software_upgrade.py |
|
Description |
This SDK execute NEO software upgrade using NEO's REST API. The script includes the following main operations:
|
|
Usage |
neo_software_upgrade.py [-h] -s SERVER -u USERNAME -p PASSWORD [-r {http,https}] |
|
Arguments |
-h |
Displays the help menu |
-s SERVER |
NEO server IP |
|
-u USERNAME |
NEO username |
|
-p PASSWORD |
NEO password |
|
--port |
The port used to communicate with NEO. If NEO is run on a physical machine:
If NEO run on a docker container:
|
|
-r {http,https} |
Connection protocol to NEO |
|
-o {getall,get} |
Script operations |
|
-f FILE |
A file in json format containing the payload of the request. |
'upgrade'
Required Arguments |
|
File Name |
For the 'upgrade' operation, you need to supply a file containing the payload of the request (see example below). |
Example:
{
"action"
: "sw_upgrade"
, "params"
: {
"description"
: "SW upgrade"
,
"protocol"
: "scp"
,
"server"
: "127.0.0.1"
,
"path"
: "/tmp/sw_upgrade_img"
, "image"
:
"image-X86_64-3.4.3000.img"
,
"username"
: "groot"
,
"password"
: "IAmGroot"
},
"object_type"
: "System"
,
"object_ids"
: ["10.224.14.215"
],
"description"
: "SW upgrade"
}
Output example:
[root@ufm_sdk]# /opt/neo/venv/bin/python neo_software_upgrade.py -s 10.209.37.77 -u admin -r https --port 443 -p 123456 - o upgrade -f sw_upgrade_example
======================================================================
<<< NEO - Upgrading software SDK >>>
----------------------------------------------------------------------
[*] Running Settings:
-> NEO server IP address: 10.209.37.77
-> NEO user name: admin
======================================================================
[*] Upgrading software stages:
-1- Setting Up data...
-2- Sending Upgrading software request...
======================================================================
[*] Upgrading software results:
>> Upgrading software request HTTP response status code: 202
>> Upgrading software request HTTP response text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="/neo/app/jobs/15">/ neo/app/jobs/15</a>. If not click the link.
======================================================================