Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyeapi/api/__pycache__/staticroute.cpython-39.pyc
Ðазад
a b�h�7 � @ sB d Z ddlZddlmZ e�dej�ZG dd� de�Zdd� ZdS ) a Module for working with EOS static routes The staticroute resource provides configuration management of static route resources on an EOS node. It provides the following class implementations: * StaticRoute - Configure static routes in EOS StaticRoute Attributes: ip_dest (string): The ip address of the destination in the form of A.B.C.D/E next_hop (string): The next hop interface or ip address next_hop_ip (string): The next hop address on destination interface distance (int): Administrative distance for this route tag (int): Route tag route_name (string): Route name Notes: The 'default' prefix function of the 'ip route' command, 'default ip route ...', currently equivalent to the 'no ip route ...' command. � N)�EntityCollectionz�(?<=^ip route) (\d+\.\d+\.\d+\.\d+\/\d+) (\d+\.\d+\.\d+\.\d+|\S+)(?: (\d+\.\d+\.\d+\.\d+))? (\d+)(?: tag (\d+))?(?: name (\S+))?c @ s` e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dS )�StaticRoutez`The StaticRoute class provides a configuration instance for working with static routes c C s dS )Nr � )�selfr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pyeapi/api/staticroute.py�__str__S s zStaticRoute.__str__c C s | � � �|�S )aB Retrieves the ip route information for the destination ip address specified. Args: name (string): The ip address of the destination in the form of A.B.C.D/E Returns: dict: An dict object of static route entries in the form:: { ip_dest: { next_hop: { next_hop_ip: { distance: { 'tag': tag, 'route_name': route_name } } } } } If the ip address specified does not have any associated static routes, then None is returned. Notes: The keys ip_dest, next_hop, next_hop_ip, and distance in the returned dictionary are the values of those components of the ip route specification. If a route does not contain a next_hop_ip, then that key value will be set as 'None'. )�getall�get)r �namer r r r V s #zStaticRoute.getc C s� t �| j�}t� }|D ]�}|d }|d }|d dkr:dn|d }t|d �}i }|d dkrbdn t|d �|d<