Developer

 View Only
last person joined: yesterday 

Expand all | Collapse all

New to pyaoscx

This thread has been viewed 48 times
  • 1.  New to pyaoscx

    Posted Jan 21, 2022 02:11 PM
    Hello,

    I'm trying to run my first python pyaoscx v2 script. The only documentation I found was in the workflow.py file.

    So my python script is:

    #!/home/user/pyaoscx-env/bin/python
    from pyaoscx.session import Session
    from pyaoscx.pyaoscx_factory import PyaoscxFactory
    from pyaoscx.interface import Interface

    version = '10.04'
    switch_ip = '10.100.10.106'
    s = Session(switch_ip, version)
    s.open('user', 'passwd')
    port = Interface(s, '1/1/11')
    port.get()
    print(port)

    When I run it I get:

    AttributeError: module 'pyaoscx' has no attribute 'interface'

    Any idea why I'm getting this error?  Also are there any pointers to documentation for v2 pyaoscx?

    Thank you
    ~

    ------------------------------
    Mike R
    ------------------------------


  • 2.  RE: New to pyaoscx

    MVP GURU
    Posted Jan 24, 2022 03:02 PM
    Hi Mike,

    Do you are using virtual env of Python ?

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 3.  RE: New to pyaoscx

    Posted Jan 24, 2022 03:16 PM

    Yes, I set up a virtual environment for pyaoscx.

     






  • 4.  RE: New to pyaoscx

    Posted Dec 09, 2023 09:20 PM

    Hey Miker,

    Did  you ever get anywhere with this? I have a similar error.




  • 5.  RE: New to pyaoscx

    MVP GURU
    Posted Dec 11, 2023 04:17 AM

    with the same script ?

    You have install pyaoscx v2 ?



    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 6.  RE: New to pyaoscx

    Posted Dec 11, 2023 07:14 AM

    Not with the same script, no @Alagoutte, and my thinking that the error is similar could be indicative of my lack of experience but I'm on pyaoscx 2.5.1 and have detailed my issue more fully here: https://community.arubanetworks.com/discussion/gettings-started-with-napalm-and-pyaoscx