Developer

 View Only
last person joined: 8 days ago 

Expand all | Collapse all

pyaoscx - upload cli config file from local PC to switch

This thread has been viewed 14 times
  • 1.  pyaoscx - upload cli config file from local PC to switch

    Posted Apr 04, 2022 06:37 AM
    Hello community,
    I am using pyaoscx module with a 6200F switch version v10.09. Is there a way to upload a local config file with commands like:
    interface 1/1/1
        no shutdown
        description test descr
        no routing
        vlan trunk native 10
        vlan trunk allowed 10,393
    ​

    with pyaoscx ?
    From what I Read i can upload a local config JSON file but I can't seem to find any way to upload a CLI-style config file.
    Or is there a way to transform a CLI-style config file into JSON with pyaoscx ?

    Thank you for your help,



  • 2.  RE: pyaoscx - upload cli config file from local PC to switch

    MVP GURU
    Posted Apr 04, 2022 06:52 AM
    Hi Lewis,

    It is not the idea of pyaoscx (or other API modules)

    You need to write your "workflow" to modify the interface, you can look https://pyaoscx.readthedocs.io/en/latest/#creating-workflows

    ------------------------------
    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: pyaoscx - upload cli config file from local PC to switch

    Posted Apr 04, 2022 07:35 AM

    The way I do it, is to generate a full config-file, and use this to upload the config file to the switch:

    https://github.com/aruba/aoscx-ansible-collection/blob/master/plugins/modules/aoscx_upload_config.py

    It supports both normal cli config and json config.
    If you upload directly to running config, the configuration will be merged with the existing configuration. To work around this, I upload to startup config, and copy it to the running config.