NEO Provisioning
File Name |
neo_provisioning.py |
|
Description |
This SDK execute NEO provisioning operations using NEO's REST API. The script includes the following main operations:
|
|
Usage |
neo_provisioning.py [-h] -s SERVER -u USERNAME -p PASSWORD [-r {http,https}] --port {80,443,3080,3443} [-b] -o {execute,list,details}[-t PARAMETERS] [-f FILE] |
|
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 {list,details,execute} |
Script operations |
|
-t PARAMETERS |
URL parameters. Valid formats:
|
|
-b |
Blocks any action while running a provisioning task Can only be used for the 'execute' operation. |
|
-f FILE |
A file in json format containing the payload of the request. |
'list'
Output example:
[root@ufm_sdk]# /opt/neo/venv/bin/python neo_provisioning.py -s localhost -u admin -r https --port 443 -p 123456 -o list
======================.================================================
<<< NEO - Getting template list SDK >>>
----------------------------------------------------------------------
[*] Running Settings:
-> NEO server IP address: localhost
-> NEO user name: admin
======================================================================
[*] Getting template list stages:
-1- Setting Up data...
-2- Sending Getting template list request...
======================================================================
[*] Template list:
Enable-Protocol-PIM Create-LAG
Add-Port-To-LAG Enable-PFC
.
.
.
======================================================================
[*] Getting template list results:
>> Getting template list request HTTP response status code: 200
======================================================================
'details'
Required Arguments |
|
Parameters |
|
Output example:
[root@r-ufm209 sdk]# /opt/neo/venv/bin/python neo_provisioning.py -s localhost -r https --port 443 -u admin -p 123456 -o details -t "template_name=Create-MLAG"
======================================================================
<<< NEO - Getting template details SDK >>>
----------------------------------------------------------------------
[*] Running Settings:
-> NEO server IP address: localhost
-> NEO user name: admin
======================================================================
[*] Getting template details stages:
-1- Setting Up data...
-2- Sending Getting template details request...
======================================================================
[*] Template details:
{
"global_args": {
"IPL_IP_mask": "Subnet mask for IPL interfaces (0-32)",
"MLAG_VIP": "Virtual IP address for MLAG",
"MLAG_VIP_mask": "Subnet mask for MLAG Virtual IP (0-32)",
"MLAG_system_MAC": "Virtual System MAC.",
"VLAN_ID": "VLAN Interface ID for IPL (1-4094)"
},
"local_args": {
"IPL_IP_address": "IP Address of IPL Interface",
"IPL_LAG_ID": "LAG ID to use with IPL ports",
"IPL_peer_IP_address": "IP Address of peer IPL Interface",
"IPL_port_range": "Port range to use for IPL"
}
}
======================================================================
[*] Getting template details results:
>> Getting template details request HTTP response status code: 200
======================================================================
'execute'
Required Arguments |
|
File Name |
|
{ } "object_ids": ["10.209.24.39"], "object_type": "System" |
|
Parameters |
|
Output example:
[root@ufm_sdk]# /opt/neo/venv/bin/python neo_provisioning.py -s 10.209.37.77 -u admin -r https --port 443 -p 123456 -o execute -t "template_name=Add-VLAN" -f provisioning_example
======================================================================
<<< NEO - Executing provisioning task SDK >>>
----------------------------------------------------------------------
[*] Running Settings:
-> NEO server IP address: 10.209.37.77
-> NEO user name: admin
======================================================================
[*] Executing provisioning task stages:
-1- Setting Up data...
-2- Sending Executing provisioning task request...
======================================================================
[*] Executing provisioning task results:
>> Executing provisioning task request HTTP response status code: 202
>> Executing provisioning task 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/7">/neo/ app/jobs/7</a>. If not click the link.
======================================================================
For executing the task and waiting until it's done, use the -b argument.