NEXUS IC Examples
Example 1: Get system version
Import
NEXUSIC_RESTAPI
from pynexusic import NEXUSIC_RESTAPI as apiInitialize
NEXUSIC_REST
classNX_REST = api.NEXUSIC_REST(baseURI, api_key=APIKey)where APIKey is the user’s API Key provided by the system administrator
Execute required function
result, result_status_code = NX_REST.getVersion()Output:
result = {'version': 'x.x.xxxxx.x', 'schema': 'x.xxx'} result_code = 200
Example 2: Run reports and get python object response
- Import
NEXUSIC_RESTAPI
from pynexusic import NEXUSIC_RESTAPI as apiInitialize
NEXUSIC_REST
classNX_REST = api.NEXUSIC_REST(baseURI, api_key=APIKey)where APIKey is the user’s API Key provided by the system administrator
Execute required report
result, result_status_code = NX_REST.getDashboard(report_name)where report_name is the name of the report to be executed in NEXUS IC
Output:
result = {'name': 'xxxxxxxxxxx', 'elements': [{'type': 'section', 'data': {}}, {'type': 'paragraph', 'data': {'text': [{'value': 'xxxxxx'}]}} ] } result_code = 200The values of the elements key will contain the data configured in the NEXUS IC report template