- layers = {
- "l2": {"mode": "l2", "suffix": "eth"},
- "l3_ip4": {"mode": "l3", "suffix": "ipv4"},
- "l3_ip6": {"mode": "l3", "suffix": "ipv6"}
- }
-
- if layer == "L4":
- raise NotImplementedError
- else:
- try:
- data = {
- "access-lists": {
- "acl": [
- {
- "type": "ietf-access-control-list:{0}-acl"
- .format(layers[layer]['suffix']),
- "name": list_name
- }
- ],
- "default-action": default_action,
- "mode": layers[layer]['mode']
- }