Uploaded image for project: 'Fast Datapath Product'
  1. Fast Datapath Product
  2. FDP-694

Add a generic ovn-nbctl show command

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • FDP-25.B
    • None
    • OVN
    • 8
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide

      Given a system administrator runs the new `ovn-nbctl show-table` command with a valid table and record name (e.g., `ovn-nbctl show-table logical_switch sw0`),

      When the command is executed,

      Then, it should display the same information as the `list` command but in a nested, human-readable format similar to `show`, expanding references to names and including the full content of the referenced records (e.g., ACLs, ports) without requiring additional commands.

      Show
      Given a system administrator runs the new `ovn-nbctl show-table` command with a valid table and record name (e.g., `ovn-nbctl show-table logical_switch sw0`), When the command is executed, Then, it should display the same information as the `list` command but in a nested, human-readable format similar to `show`, expanding references to names and including the full content of the referenced records (e.g., ACLs, ports) without requiring additional commands.
    • rhel-sst-network-fastdatapath
    • ssg_networking
    • FDP 24.G, FDP 24.H, FDP 25.A, FDP 25.B
    • 4

      Currently ovn-nbctl displays OVN (NB database) related information in two ways:

      1. custom show commands ("ovn-nbctl show", "ovn-nbctl lr-list", "ovn-nbctl lr-route-list", etc) that require custom handlers to display information in a nicely formatted way.
      2. "automatic" show commands implemented through OVS's db-ctl-base library.

      The former require manual intervention every time a feature changes.

      The latter only operate on single database tables.  It would be useful to enhance this second type of commands in order to achieve a way of automatically traverse the links between database tables.

      For example, listing a logical switch today looks like this:

      $ ovn-nbctl list logical_switch sw0
      _uuid               : 70d89082-9c72-43f7-ba6c-711c189ab3fd
      acls                : [c136b913-3268-4e3b-b435-307ea2eabb3f]
      copp                : []
      dns_records         : []
      external_ids        : {}
      forwarding_groups   : []
      load_balancer       : []
      load_balancer_group : []
      name                : sw0
      other_config        : {}
      ports               : [3ccb93dd-ce54-413d-ba1b-fac8f6d25a55, fcd6a74f-5187-4044-bc2b-a28d757c1079]
      qos_rules           : [] 

      But a better display might be:

      $ ovn-nbctl --all list logical_switch sw0
      _uuid               : 70d89082-9c72-43f7-ba6c-711c189ab3fd
      acls                : [
        ACL1
      ]
      copp                : []
      dns_records         : []
      external_ids        : {}
      forwarding_groups   : []
      load_balancer       : []
      load_balancer_group : []
      name                : sw0
      other_config        : {}
      ports               : [
         PORT1, 
         PORT2]
      qos_rules           : []

      Where ACL1 expands to the c136b913-3268-4e3b-b435-307ea2eabb3f NB.ACL record contents and PORT1 and PORT2 expand to the 3ccb93dd-ce54-413d-ba1b-fac8f6d25a55 and fcd6a74f-5187-4044-bc2b-a28d757c1079 NB.Logical_Switch_Port contents.

      A potential way of doing that is expanding the IDL API that's automatically generated (https://github.com/ovn-org/ovn/blob/main/lib/ovsdb_automake.mk) with the help of ovsdb-idlc.in (https://github.com/openvswitch/ovs/blob/main/ovsdb/ovsdb-idlc.in) to also generate print functions for each table.  These print functions could, based on the schema, automatically expand all database references.

              roriorde@redhat.com Rosemarie O'Riorden
              dceara@redhat.com Dumitru Ceara
              Jianlin Shi Jianlin Shi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: