Skip to main content

PyPI - Python Version

What it does ?

This return Cisco configuration and information like :

  • Sytem informations
  • Static routes
  • Interfaces
  • DHCP
  • ACL

Informations

bastion_ip and bastion_port are optional

Get system informations

from getRoutersConfig import setInformations

router = setInformations(host_ip: str='', host_port: str='22', host_snmp_community: str='public', user: str='', password: str='', bastion_ip: str='', bastion_port: str='')

system_information = router.getSystemInformation()

router.disconnect()

The Schema is :

{
    "serie": "C800",
    "model": "C891F-K9",
    "version": "15.4(3)M6",
    "hostname": "THE_ROUTER",
    "uptime": {
        "years": 0,
        "weeks": 1,
        "days": 1,
        "hours": 11,
        "minutes": 25
    },
    "system_image": "c800-universalk9-mz.SPA.154-3.M6.bin",
    "serial_number": "FCZ1234A5BC"
}

Get Ipv4 static routes

from getRoutersConfig import setInformations

router = setInformations(host_ip: str='', host_port: str='22', host_snmp_community: str='public', user: str='', password: str='', bastion_ip: str='', bastion_port: str='')

static_routes = router.getIpv4StaticRoutes()

router.disconnect()

The Schema is :

[
    {
        "subnet_address": "1.1.1.1",
        "mask": {
        "octets": "255.255.255.255",
        "cidr": 29
        },
        "vrf": "TEST",
        "gateway": "2.2.2.2",
        "metric": 250,
        "tag": 408,
        "permanent": "false",
        "name": "the description",
        "track": 20
    },
    ...
]

Get interfaces

from getRoutersConfig import setInformations

router = setInformations(host_ip: str='', host_port: str='22', host_snmp_community: str='public', user: str='', password: str='', bastion_ip: str='', bastion_port: str='')

interfaces = router.getInterfaces()

router.disconnect()

The Schema is :

{
    "switched": [
        {
          "name": "FastEthernet0",
          "switchport_mode": "access",
          "vlan": "1"
        },
        ...
    ],
    "routed": [
        {
          "name": "FastEthernet4",
          "description": "",
          "ip": "192.168.1.101",
          "mask": {
            "octets": "255.255.255.0",
            "cidr": 24
          },
          "vrf": ""
        },
        ...
    ]
},

Get DHCP

from getRoutersConfig import setInformations

router = setInformations(host_ip: str='', host_port: str='22', host_snmp_community: str='public', user: str='', password: str='', bastion_ip: str='', bastion_port: str='')

dhcp = router.getDhcp()

router.disconnect()

The Schema is :

[
    {
        "name": "DATA",
        "network": {
            "subnet_address": "10.0.0.0",
            "mask": {
                "octets": "10.0.0.0",
                "cidr": 24
            }
        },
        "default_router": "10.0.0.1",
        "dns_server": [
            "8.8.8.8",
            ...
        ],
        "option": [
            {
                "code": 2,
                "string_type": "ascii",
                "string": "opt2"
            },
            ...
        ]
    },
    ...
]

Get ACL

from getRoutersConfig import setInformations

router = setInformations(host_ip: str='', host_port: str='22', host_snmp_community: str='public', user: str='', password: str='', bastion_ip: str='', bastion_port: str='')

acl = router.getIpv4Acl()

router.disconnect()

The Schema is :

[
    {
        "type": "Extended",
        "name": "acl-premium",
        "rule": [
            {
                "sequence_number": 10,
                "pass": "permit",
                "protocol": "udp",
                "source": "any",
                "source_port": "all",
                "destination": "host 192.168.10.3",
                "destination_port": "snmp",
                "macthes": 2417837
            },
            ...
        ]
    },
    ...
]

Get full configuration

from getRoutersConfig import setInformations

router = setInformations(host_ip: str='', host_port: str='22', host_snmp_community: str='public', user: str='', password: str='', bastion_ip: str='', bastion_port: str='')

config = router.getFullConfiguration()

router.disconnect()

The Schema is :

{
    "system": {},
    "ipv4StaticRoutes": [],
    "interfaces": [],
    "dhcp": [],
    "acl": []
}

Metadata

Release files for getRoutersConfig 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getRoutersConfig 0.0.7
File Size Uploaded
getRoutersConfig-0.0.7.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for getRoutersConfig 0.0.7
File Interpreter ABI Platform
getRoutersConfig-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 kB

Release files / getRoutersConfig-0.0.7.tar.gz

Download URL getRoutersConfig-0.0.7.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9ea75a407bbb2749360a3004fc0c59bde7f33bb60f63c42e32eae051a697f48b
BLAKE2b-256 checksum
How to use checksums
a8c9ea7f36478d1409f1d1a91934157bf47eaafad2ca172c157096d8417cee54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / getRoutersConfig-0.0.7-py3-none-any.whl

Download URL getRoutersConfig-0.0.7-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ccd4e8f27429cabb10a277ab9109a512614da0af1bba8e45e605131903d8592
BLAKE2b-256 checksum
How to use checksums
c52251ff21251f407d7ea1571e03f59a586751fd06110f980790b176b0721772
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page