Skip to content
device_p4.py 1.08 KiB
Newer Older
"""
P4 device example configuration.
"""

from common.tools.object_factory.ConfigRule import json_config_rule_set
from common.tools.object_factory.Device import json_device_p4_disabled

DEVICE_P4_ID = 0
DEVICE_P4_NAME = 'device:leaf1'
DEVICE_P4_ADDRESS = '127.0.0.1'
DEVICE_P4_PORT = '50101'
DEVICE_P4_VENDOR = 'Open Networking Foundation'
DEVICE_P4_HW_VER = 'BMv2 simple_switch'
DEVICE_P4_SW_VER = 'Stratum'
DEVICE_P4_PIPECONF = 'org.onosproject.pipelines.fabric'
DEVICE_P4_WORKERS = 2
DEVICE_P4_GRACE_PERIOD = 60

DEVICE_P4_UUID = {'device_uuid': {'uuid': DEVICE_P4_NAME}}
DEVICE_P4 = json_device_p4_disabled(DEVICE_P4_UUID)

DEVICE_P4_CONNECT_RULES = [
    json_config_rule_set('_connect/address', DEVICE_P4_ADDRESS),
    json_config_rule_set('_connect/port', DEVICE_P4_PORT),
    json_config_rule_set('_connect/settings', {
        'id'      : int(DEVICE_P4_ID),
        'name'    : DEVICE_P4_NAME,
        'hw-ver'  : DEVICE_P4_HW_VER,
        'sw-ver'  : DEVICE_P4_SW_VER,
        'pipeconf': DEVICE_P4_PIPECONF
    }),
]

DEVICE_P4_CONFIG_RULES = [
    json_config_rule_set('key1', 'value1'),