- release_tracks: [ALPHA, BETA]

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

      ## EXAMPLES

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

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

      To list all volume backups in project 'my-project' in location 'us-central1' under all backup plans under all backups, run:

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

      To list all volume backups in project 'my-project' across all locations under all backup plans under all backups, run:

        $ {command} --project=my-project


  request:
    collection: gkebackup.projects.locations.backupPlans.backups.volumeBackups
    api_version: v1

  response:
    id_field: name

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

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