Reply
Accepted Solution

Netmri python API script_broker.run problem

csi-net
Techie
Posts: 14
1739     0

Hello,

I would like to run a CSS script using Netmri Python API,

 

here an extract of the python script on my linux machine.

 

#!/usr/bin/python3.6

from infoblox_netmri.client import InfobloxNetMRI

 

client = InfobloxNetMRI(
    defaults.get("host"),
    defaults.get("username"),
    defaults.get("password"),
)

 

# get Script broker
script_broker = client.get_broker('Script')

 

# Run script

job_id = script_broker.run(name='Script-Null',device_ids=[83,99])

 

 

the error is the following:

Traceback (most recent call last):
  File "./netmri-api1.py", line 50, in <module>
    job_id = script_broker.run(name='Script-Null',device_ids=[83,99])
  File "/usr/lib/python3.6/site-packages/infoblox_netmri-3.2.0.0-py3.6.egg/infoblox_netmri/api/broker/v3_2_0/script_broker.py", line 1350, in run
    return self.api_request(self._get_method_fullname("run"), kwargs)
  File "/usr/lib/python3.6/site-packages/infoblox_netmri-3.2.0.0-py3.6.egg/infoblox_netmri/api/broker/broker.py", line 27, in api_request
    if class_name in data:
TypeError: argument of type 'NoneType' is not iterable

 

What is wrong, in script_broker.run ?

 

I tried script_broker.index(name='Script-Null') and it work.

 

Highlighted

Re: Netmri python API script_broker.run problem

csi-net
Techie
Posts: 14
1739     0

J got the problem. The user I was using to run the Job didn't had a min Role to be able to run Jobs !!

Showing results for 
Search instead for 
Do you mean 

Recommended for You