- release_tracks: [ALPHA, BETA]

  help_text:
    brief: List volume restores.
    description: |
      List Backup for GKE volume restores.

      ## EXAMPLES

      To list all volume restores in project ``my-project'' in location ``us-central1'' under restore plan ``my-restore-plan'' under restores ``my-restore'', run:

        $ {command} --project=my-project --location=us-central1 --restore-plan=my-restore-plan --restore=my-restore

      To list all volume restores in project ``my-project'' across all locations under all restore plans and restores, run:

        $ {command} --project=my-project

  request:
    collection: gkebackup.projects.locations.restorePlans.restores.volumeRestores
    api_version: v1

  response:
    id_field: name

  arguments:
    resource:
      help_text: |
        Name of the restore from which to list volume restores (provided via options or through
        properties), e.g.
        `--project=<project> --location=<location> --restore-plan=<restore-plan> --restore=<restore>`.
      spec: !REF googlecloudsdk.command_lib.container.backup_restore.resources:default_restore

  output:
    format: |
      table(
         name.basename():label=NAME,
         name.segment(3):label=LOCATION,
         name.segment(5):label=RESTORE_PLAN,
         name.segment(7):label=RESTORE,
         format('{0}/{1}', targetPvc.namespace, targetPvc.name):label=TARGET_PVC,
         createTime.date('%Y-%m-%dT%H:%M:%S %Z', tz=LOCAL),
         completeTime.date('%Y-%m-%dT%H:%M:%S %Z', tz=LOCAL),
         state
       )
