Giter VIP home page Giter VIP logo

ixnetwork_client_python's People

Contributors

ajbalogh avatar xerothermic avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

ixnetwork_client_python's Issues

Ixnetwork Rest Port rejects requests sometimes

Hi,
When we are making thousands of requests to Ixnetwork rest port from ixn_client_python, it rejects the request sometimes(very rarely, once in thousands). This give an connection refused error at socket interface and disrupts the automation scripts. We can try catch in our scripts or may try with some sleep, but that will not be the best possible solution.

Can we put a try catch block in IxnHttp.py line 188, and retry for a few times before discarding the request?
Or there will be any collateral if we do that.

  • Error Code:

Traceback (most recent call last): File "ConfigConverter.py", line 122, in <module> config_convertor.convert() File "ConfigConverter.py", line 35, in convert N2xConverter(self._from_tree, self._ixnhttp).convert() File "/home/subha/PycharmProjects/configuration_converter/N2xConverter.py", line 51, in convert N2XconvertStreamGroupList(self) File "/home/subha/PycharmProjects/configuration_converter/N2XconvertStreamGroupList.py", line 19, in __init__ self._convert_agt_stream_group_list() File "/home/subha/PycharmProjects/configuration_converter/N2XconvertStreamGroupList.py", line 439, in _convert_agt_stream_group_list frameSize = self.highLevelStream.query.clear().node('frameSize', properties=['*']).go().frameSize File "/home/subha/configuration_converter/lib/python3.5/site-packages/ixnetwork/IxnQuery.py", line 97, in go async_response = self._ixnhttp.post('/operations/query', self._query) File "/home/subha/configuration_converter/lib/python3.5/site-packages/ixnetwork/IxnHttp.py", line 152, in post response = self._send_recv('POST', url, payload, fid, file_content) File "/home/subha/configuration_converter/lib/python3.5/site-packages/ixnetwork/IxnHttp.py", line 188, in _send_recv self._connection.request(method, url, json.dumps(payload), headers) File "/usr/lib/python3.5/http/client.py", line 1106, in request self._send_request(method, url, body, headers) File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request self.endheaders(body) File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders self._send_output(message_body) File "/usr/lib/python3.5/http/client.py", line 934, in _send_output self.send(msg) File "/usr/lib/python3.5/http/client.py", line 877, in send self.connect() File "/usr/lib/python3.5/http/client.py", line 849, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.5/socket.py", line 711, in create_connection raise err File "/usr/lib/python3.5/socket.py", line 702, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

  • If the above code is hard to read please refer this picture:

capture

Sample Create New Session Failing - [Spyder - headless]

Hi,
We are testing the usability of ixnetwork_client_python, with headless ixnetwork centos based rest api.
While testing with the simplest sample (ixnetwork/samples/sessions/create_new_session.py) we found this error -

Traceback (most recent call last):
  File "/home/subha/PycharmProjects/ixnetwork_client_python/ixnetwork/samples/sessions/create_new_session.py", line 16, in <module>
    session = ixnhttp.create_session()
  File "/home/subha/PycharmProjects/ixnetwork_client_python/ixnetwork/IxnHttp.py", line 86, in create_session
    self.post('/api/v1/sessions/%s/operations/start' % session.id, payload=body)
  File "/home/subha/PycharmProjects/ixnetwork_client_python/ixnetwork/IxnHttp.py", line 153, in post
    response = self._process_async_response(url, response)
  File "/home/subha/PycharmProjects/ixnetwork_client_python/ixnetwork/IxnHttp.py", line 134, in _process_async_response
    response = self._send_recv('GET', response.url)
  File "/home/subha/PycharmProjects/ixnetwork_client_python/ixnetwork/IxnHttp.py", line 205, in _send_recv
    response = requests.request(method, url, data=None, headers=headers, verify=self._verify_cert)
  File "/home/subha/configuration_converter/lib/python3.5/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/subha/configuration_converter/lib/python3.5/site-packages/requests/sessions.py", line 498, in request
    prep = self.prepare_request(req)
  File "/home/subha/configuration_converter/lib/python3.5/site-packages/requests/sessions.py", line 441, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/subha/configuration_converter/lib/python3.5/site-packages/requests/models.py", line 309, in prepare
    self.prepare_url(url, params)
  File "/home/subha/configuration_converter/lib/python3.5/site-packages/requests/models.py", line 377, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: 10.117.159.205:443https:

Build -

ixnetwork-rest==0.55a57
ixnetwork headless server (spyder) -8.50EA

P.S -> The session is getting successfully created.

Error while POST - ing some pattern in multivalue object

  • Build used:

Ixnetwork client: 8.40 EA

  • Problem:

While performing post operation for some multivalue patterns - repeatableRandomRange, repeatableRandom.

Ixnetwork returns error.

  • Example:

request type: POST
URL: /api/v1/sessions/<session_id>/ixnetwork/multivalue/<id>/random
response:

{
  "links": [
    {
      "rel": "self",
      "method": "GET",
      "href": "/api/v1/sessions/<session_id>/ixnetwork/multivalue/<id>/random"
    }
  ]
}

But for
request type: POST
URL: /api/v1/sessions/<session_id>/ixnetwork/multivalue/<id>/repeatableRandomRange
response:

{
  "method": "POST",
  "pathAndQuery": "/api/v1/sessions/<session_id>/ixnetwork/multivalue/<id>/repeatableRandomRange",
  "errors": [
    {
      "code": 10000,
      "detail": "One of the identified items was in an invalid format."
    }
  ]
}

exporting config to Ixncfg format

Hi @ajbalogh ,
Trying to export a config in ixncfg format rather than the default json version.
This piece of code is throwing error -
Are we using in the correct way? Or is it a bug?

from ixnetwork import IxnHttp, IxnConfigManagement
ixnhttp = IxnHttp(host, rest_port=rest_port)
ixnhttp.auth('admin', 'admin')
ixnhttp.create_session()
# made a configuration
# now trying to export in ixncfg
config_mgmt = IxnConfigManagement(ixnhttp)
xpaths = [
			'/vport/descendant-or-self::*',
			'/topology/descendant-or-self::*',
			'/traffic/descendant-or-self::*'
		]
config_mgmt.export_config(xpaths=xpaths, local_filename=converted_filename,export_format = 'ixncfg')

ixnet_object -> delete method not working in 8.50 EA

Hi,
We use the delete method of IxnObject class,
which used to work perfectly in IxNetwork 8.40EA but now we are moving to IxNetwork 8.50EA and it is not working.

The following snippet should create an IxnObject instance and delete it.

w_topology = ixnhttp.root.create_child('topology')
w_topology.delete()

This is the traceback we are getting for 8.50EA
Exception: 405 Method Not Allowed {"Message":"The requested resource does not support http method 'DELETE'."}

Can you please look into it?

Find child Ixn...Emulation instances using parent Ixn...Emulation instance

Ixn...Emulation classes should offer the functionality to find a child emulation host using a parent host

find a specific ethernet emulation using a virtual port name
eth = IxnEthernetEmulation(ixnhttp).find(vport_name='PE2-6/8')

find the igmp host emulation using the eth emulation host
igmp = IxnIgmpHostEmulation(ixnhtt).find(eth)

reconnect existing sessions broken on Connection Manager

Hi,

I'm testing ixnetwork_client_python with IxNetwork Connection Manager 8.40.1124.8 in GUI mode.
I was able to use the API to create a few sessions. However, when I tried to connect to existing sessions, I got a 404 error.

It turned out the Connection Manager does not like GET request /api/v1/sessions?links=true. If I manually issue _send_recv('GET', '/api/v1/sessions') then I could query a list of sessions in the Connection manager.

What is the best way to address this issue?

Patrick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.