- release_tracks: [BETA, GA]

  help_text:
    brief: List groups.
    description: Retrieve and display a list of all groups in the specified hub.

    examples: |
      To list all groups across all hubs, run:

        $ {command} --hub=-

      To list all groups in hub `my-hub`, run:

        $ {command} --hub=my-hub

  arguments:
    resource:
      spec: !REF googlecloudsdk.command_lib.network_connectivity.resources:hubDefaultAll
      help_text: Parent hub of the groups to display.

  request: &request
    BETA:
      api_version: v1beta
    GA:
      api_version: v1
    collection: networkconnectivity.projects.locations.global.hubs.groups

  output:
    # Columns: NAME, HUB, DESCRIPTION
    format: table(name.basename():sort=2, name.segment(5):label=HUB:sort=1, description)
