Open gssajith opened 4 years ago
The argument is not called name, it is called agentname
The majority of the good full examples are under the powershell section as that is what the majority of Orion admins are using. See this one:
https://github.com/solarwinds/OrionSDK/blob/master/Samples/PowerShell/DeployAgentViaVerb.ps1
In fact looking at your code it appears you are just trying to populate all the default fields of an agent row in the db. That is not the way the SWIS verbs work at all. They all have pre-defined arguments. You will have a MUCH easier time if you install the Orion SDK on a Windows box to learn to navigate the table relationships verbs, otherwise it is a lot of work to constantly be looking up the syntax for everything in the schema and from the swagger.
http://solarwinds.github.io/OrionSDK/2019.4/schema/index.html http://solarwinds.github.io/OrionSDK/swagger-ui/
Thanks for the guidelines
What is the best way to install agent (add agent) to a newly created VM in the network? Tried Orion.AgentManagement.Agent.Deploy but not fruitful. Is there any example somewhere?
Method1:
Failed with: _Traceback (most recent call last): File "./add_agent.py", line 52, in
main()
File "./addagent.py", line 45, in main
response = swis.invoke('Orion.AgentManagement.Agent', 'Deploy', **props)
TypeError: invoke() got an unexpected keyword argument 'Name'
Method2:
Failed with: _Traceback (most recent call last): File "./add_agent.py", line 53, in
main()
File "./add_agent.py", line 46, in main
"10.201.16.11","7.7", "9","0")
File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 31, in invoke
"Invoke/{}/{}".format(entity, verb), args).json()
File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 63, in _req
resp.raise_for_status()
File "/usr/lib/python2.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Agent '"' must be assigned to existing polling engine for url: https://solarwindsEndpint:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.AgentManagement.Agent/Deploy_