Commit 6ebb2988 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ added examples for tdl2json export

parent 3804aba5
Loading
Loading
Loading
Loading
+143 −0
Original line number Diff line number Diff line
{
  "ieee802_dot1q_bridge_bridges": {
    "bridge": [
      {
        "name": "ne2",
        "address": "10-10-10-10-10-10",
        "bridge-type": "ieee802-dot1q-bridge:customer-vlan-bridge",
        "component": [
          {
            "name": "cv0",
            "id": "0",
            "type": "ieee802-dot1q-bridge:c-vlan-component",
            "bridge-port": [
              "eth1",
              "eth2",
              "eth3"
            ],
            "filtering-database": {
              "vlan-registration-entry": [
                {
                  "database-id": "1",
                  "vids": "200",
                  "entry-type": "static",
                  "port-map": [
                    {
                      "port-ref": "1",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "tagged"
                      }
                    },
                    {
                      "port-ref": "3",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "tagged"
                      }
                    }
                  ]
                },
                {
                  "database-id": "1",
                  "vids": "300",
                  "entry-type": "static",
                  "port-map": [
                    {
                      "port-ref": "2",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "untagged"
                      }
                    },
                    {
                      "port-ref": "3",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "tagged"
                      }
                    }
                  ]
                }
              ]
            },
            "bridge-vlan": {
              "vlan": [
                {
                  "vid": "200",
                  "name": "E-Line 200",
                  "egress-ports": [
                    "eth1",
                    "eth3"
                  ]
                },
                {
                  "vid": "300",
                  "name": "E-Line 300",
                  "untagged-ports": [
                    "eth2"
                  ],
                  "egress-ports": [
                    "eth2",
                    "eth3"
                  ]
                }
              ]
            }
          }
        ]
      }
    ]
  },
  "ietf_interfaces_interfaces": {
    "interface": [
      {
        "name": "eth1",
        "type": "iana-if-type:ethernetCsmacd",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2022-04-06T11:00:00+02:00"
        },
        "ieee802-dot1q-bridge:bridge-port": {
          "bridge-name": "ne2",
          "component-name": "cv0",
          "port-type": "ieee802-dot1q-bridge:c-vlan-bridge-port",
          "pvid": "1",
          "acceptable-frame": "admit-only-VLAN-tagged-frames",
          "enable-ingress-filtering": "true",
          "port-number": "1"
        }
      },
      {
        "name": "eth2",
        "type": "iana-if-type:ethernetCsmacd",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2022-04-06T11:00:00+02:00"
        },
        "ieee802-dot1q-bridge:bridge-port": {
          "bridge-name": "ne2",
          "component-name": "cv0",
          "port-type": "ieee802-dot1q-bridge:c-vlan-bridge-port",
          "pvid": "300",
          "acceptable-frame": "admit-only-untagged-and-priority-tagged",
          "enable-ingress-filtering": "true",
          "port-number": "2"
        }
      },
      {
        "name": "eth3",
        "type": "iana-if-type:ethernetCsmacd",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2022-04-06T11:00:00+02:00"
        },
        "ieee802-dot1q-bridge:bridge-port": {
          "bridge-name": "ne2",
          "component-name": "cv0",
          "port-type": "ieee802-dot1q-bridge:c-vlan-bridge-port",
          "pvid": "1",
          "acceptable-frame": "admit-only-VLAN-tagged-frames",
          "enable-ingress-filtering": "true",
          "port-number": "3"
        }
      }
    ]
  }
}
 No newline at end of file
+143 −0
Original line number Diff line number Diff line
{
  "ieee802-dot1q-bridge:bridges": {
    "bridge": [
      {
        "name": "ne2",
        "address": "10-10-10-10-10-10",
        "bridge-type": "ieee802-dot1q-bridge:customer-vlan-bridge",
        "component": [
          {
            "name": "cv0",
            "id": "0",
            "type": "ieee802-dot1q-bridge:c-vlan-component",
            "bridge-port": [
              "eth1",
              "eth2",
              "eth3"
            ],
            "filtering-database": {
              "vlan-registration-entry": [
                {
                  "database-id": "1",
                  "vids": "200",
                  "entry-type": "static",
                  "port-map": [
                    {
                      "port-ref": "1",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "tagged"
                      }
                    },
                    {
                      "port-ref": "3",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "tagged"
                      }
                    }
                  ]
                },
                {
                  "database-id": "1",
                  "vids": "300",
                  "entry-type": "static",
                  "port-map": [
                    {
                      "port-ref": "2",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "untagged"
                      }
                    },
                    {
                      "port-ref": "3",
                      "static-vlan-registration-entries": {
                        "vlan-transmitted": "tagged"
                      }
                    }
                  ]
                }
              ]
            },
            "bridge-vlan": {
              "vlan": [
                {
                  "vid": "200",
                  "name": "E-Line 200",
                  "egress-ports": [
                    "eth1",
                    "eth3"
                  ]
                },
                {
                  "vid": "300",
                  "name": "E-Line 300",
                  "untagged-ports": [
                    "eth2"
                  ],
                  "egress-ports": [
                    "eth2",
                    "eth3"
                  ]
                }
              ]
            }
          }
        ]
      }
    ]
  },
  "ietf-interfaces:interfaces": {
    "interface": [
      {
        "name": "eth1",
        "type": "iana-if-type:ethernetCsmacd",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2022-04-06T11:00:00+02:00"
        },
        "ieee802-dot1q-bridge:bridge-port": {
          "bridge-name": "ne2",
          "component-name": "cv0",
          "port-type": "ieee802-dot1q-bridge:c-vlan-bridge-port",
          "pvid": "1",
          "acceptable-frame": "admit-only-VLAN-tagged-frames",
          "enable-ingress-filtering": "true",
          "port-number": "1"
        }
      },
      {
        "name": "eth2",
        "type": "iana-if-type:ethernetCsmacd",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2022-04-06T11:00:00+02:00"
        },
        "ieee802-dot1q-bridge:bridge-port": {
          "bridge-name": "ne2",
          "component-name": "cv0",
          "port-type": "ieee802-dot1q-bridge:c-vlan-bridge-port",
          "pvid": "300",
          "acceptable-frame": "admit-only-untagged-and-priority-tagged",
          "enable-ingress-filtering": "true",
          "port-number": "2"
        }
      },
      {
        "name": "eth3",
        "type": "iana-if-type:ethernetCsmacd",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2022-04-06T11:00:00+02:00"
        },
        "ieee802-dot1q-bridge:bridge-port": {
          "bridge-name": "ne2",
          "component-name": "cv0",
          "port-type": "ieee802-dot1q-bridge:c-vlan-bridge-port",
          "pvid": "1",
          "acceptable-frame": "admit-only-VLAN-tagged-frames",
          "enable-ingress-filtering": "true",
          "port-number": "3"
        }
      }
    ]
  }
}
 No newline at end of file
+54 −0
Original line number Diff line number Diff line
{
  "authors": [
    {
      "name": "Alfonso"
    },
    {
      "name": "Alfred"
    }
  ],
  "books": [
    {
      "title": "Book One",
      "authors": [
        {
          "name": "Author One"
        },
        {
          "name": "Author Two"
        }
      ]
    },
    {
      "title": "Book Two",
      "authors": [
        {
          "name": "Alfonso"
        }
      ]
    },
    {
      "title": "Book Three",
      "year": "2022",
      "authors": [
        {
          "name": "Alfred"
        }
      ]
    },
    {
      "title": "Instance Book 2"
    },
    {
      "year": "2023",
      "title": "Instance Book 2"
    },
    {
      "title": "2023 override"
    },
    {
      "title": "2023 override and extra year",
      "year": "2023"
    }
  ]
}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
{
  "title": "Instance Book 2"
}
 No newline at end of file
+88 −0
Original line number Diff line number Diff line
Package generated_from_model_json {
    Type String
    Type TODO_RESOLVE_REFERENCED
    Use "model.json" as SOURCE_MAPPING
    Type JSON_String
    Structure JSON_model_json (
        JSON_authors authors,
        JSON_books books
    )
    Collection JSON_authors of JSON_authors_item
    Structure JSON_authors_item (
        JSON_String name
    )
    Collection JSON_books of JSON_books_item
    Structure JSON_books_item (
        JSON_String title,
        JSON_authors authors,
        JSON_String year
    )
    
    JSON_books_item b2 (
        title = "Instance Book 2"
    )
    
    JSON_model_json JSON_instance (
        authors = [
            (
                name = "Alfonso"
            ),
            (
                name = "Alfred"
            )
        ],
        books = [
            (
                title = "Book One",
                authors = [
                    (
                        name = "Author One"
                    ),
                    (
                        name = "Author Two"
                    )
                ]
            ),
            (
                title = "Book Two",
                authors = [
                    (
                        name = "Alfonso"
                    )
                ]
            ),
            (
                title = "Book Three",
                year = "2022",
                authors = [
                    (
                        name = "Alfred"
                    )
                ]
            ),
            b2 (),
            b2 (
            	year = "2023"
            ),
            b2 (
            	title = "2023 override"
            ),
            b2 (
            	title = "2023 override and extra year",
            	year = "2023"
            ),
        ]
    )
    Map JSON_model_json to "JSON" in SOURCE_MAPPING as JSON_SOURCE_MAPPING {
        authors -> "authors",
        books -> "books"
    }
    Map JSON_authors_item to "JSON.authors.item" in SOURCE_MAPPING as JSON_authors_item_SOURCE_MAPPING {
        name -> "name"
    }
    Map JSON_books_item to "JSON.books.item" in SOURCE_MAPPING as JSON_books_item_SOURCE_MAPPING {
        title -> "title",
        authors -> "authors",
        year -> "year"
    }
}
 No newline at end of file