NVIDIA NEO SDK v2.7.20
NVIDIA NEO SDK v2.7.20

NEO Get Data

File Name

neo_get_data.py

Description

This SDK retrieves NEO resources using NEO's REST API. The script can retrieve the following resources:

  • 'groups'

  • 'users'

  • 'systems'

  • 'jobs'

  • 'ports'

  • 'task'

  • 'events'

  • 'logs'

Usage

neo_get_data.py [-h] -s SERVER -u USERNAME -p PASSWORD [-r {http,https}] --port {80,443,3080,3443}

-o {groups,users,systems,jobs,ports,tasks,events,logs}

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:

  • Port 80 is used for HTTP

  • Port 443 is used for HTTPS

If NEO run on a docker container:

  • Port 3080 is used for HTTP

  • Port 3443 is used for HTTPS

-r {http,https}

Connection protocol to NEO

-o {groups, users, systems, jobs, ports, tasks, events, logs}

Script operations

'systems'

Output example:

Copy
Copied!
            

[root@ufm_sdk]# /opt/neo/venv/bin/python neo_get_data.py -s 10.209.37.77 -u admin -r https --port 443 -p 123456 -o systems ---------------------------------------------------------------------- [*] Running settings: -> NEO server: 10.209.37.77 -> Protocol: http -> NEO user name: admin -> Selected REST API: systems ---------------------------------------------------------------------- [*] Execution Stages: -1- Starting NEO Session... -2- Reading Data From REST API: /neo/resources/systems ---------------------------------------------------------------------- [*] Output: [{'caption': '', 'healthState': 'Unknown', 'id': '10.209.24.137.system', 'ipAddress': '10.209.24.137', 'isManagement': True, 'model': '', 'name': 'r-smg34', 'profile': 'Not Applicable', 'status': 'Unknown', 'swVersion': 'Ubuntu 14.04 LTS Linux 3.13.0-83-generic #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016 x86_64', 'sysType': 'Linux Host', 'vendor': ''}, {'caption': '', 'healthState': 'Major', 'id': '10.209.37.9.system', 'ipAddress': '10.209.37.9', 'isManagement': True, 'model': 'SX6036',


'ports'

Output example:

Copy
Copied!
            

[root@ufm_sdk]# /opt/neo/venv/bin/python neo_get_data.py -s 10.209.37.77 -u admin -r https --port 443 -p 123456 -o ports ---------------------------------------------------------------------- [*] Running settings: -> NEO server: 10.209.37.77 -> Protocol: http -> NEO user name: admin -> Selected REST API: ports ---------------------------------------------------------------------- [*] Execution Stages: -1- Starting NEO Session... -2- Reading Data From REST API: /neo/resources/ports ---------------------------------------------------------------------- [*] Output: [{'activeSpeed': 'N/A', 'adminState': 'Enabled', 'health': 'OK', 'id': '10.209.24.137.network_port.p2p1', 'lagMembership': None, 'lagMode': None, 'mtu': 'N/A', 'name': 'p2p1', 'operationalState': 'UP', 'portNumber': -1, 'protocol': 'Ethernet', 'systemID': '10.209.24.137.system', 'systemIP': '10.209.24.137', 'systemName': 'r-smg34', 'vlanMode': None, 'vlans': []}, . . . ] ----------------------------------------------------------------------

Warning

For all other script options, the usage is the same (except for the -o), and no additional arguments need to be added.


© Copyright 2023, NVIDIA. Last updated on Nov 16, 2023.