- release_tracks: [BETA, GA]

  help_text:
    brief: List Network Connectivity Center operations.
    description: |
      Retrieve and display a list of operations in the specified region, sorted by creation time.

      To specify the maximum number of operations to return, use the `--limit` flag.

    examples: |
      To list all operations in region `us-central1`, run:

        $ {command} --region=us-central1

      To list a maximum of five operations in `us-central1`, run:

        $ {command} --region=us-central1 --limit=5

  arguments:
    resource:
      spec: !REF googlecloudsdk.command_lib.network_connectivity.resources:region
      help_text: Region of the operations to display.

  request: &request
    BETA:
      api_version: v1beta
    GA:
      api_version: v1
    collection: networkconnectivity.projects.locations.operations

  output:
    # Columns: ID, TYPE, TARGET, CREATE_TIME, END_TIME, DONE
    format: |
       table(
          name.basename():label=ID,
          metadata.verb:label=TYPE,
          metadata.target.basename(),
          metadata.createTime.date('%Y-%m-%d %H:%M:%S %Oz', undefined=''):sort=1,
          metadata.endTime.date('%Y-%m-%d %H:%M:%S %Oz', undefined=''),
          done
        )
