release_tracks: [ALPHA]
command_type: CONFIG_EXPORT
help_text:
  brief: Export the configuration for a Monitoring alert policy.
  description: |
    *{command}* exports the configuration for a Monitoring alert policy.

    Alert policy configurations can be exported in
    Kubernetes Resource Model (krm) or Terraform HCL formats. The
    default format is `krm`.

    Specifying `--all` allows you to export the configurations for all
    alert policies within the project.

    Specifying `--path` allows you to export the configuration(s) to
    a local directory.
  examples: |
    To export the configuration for an alert policy, run:

      $ {command} my-alert-policy

    To export the configuration for an alert policy to a file, run:

      $ {command} my-alert-policy --path=/path/to/dir/

    To export the configuration for an alert policy in Terraform
    HCL format, run:

      $ {command} my-alert-policy --resource-format=terraform

    To export the configurations for all alert policies within a
    project, run:

      $ {command} --all
arguments:
  resource:
    help_text: Alert policy to export the configuration for.
    spec: !REF googlecloudsdk.command_lib.monitoring.resources:policy
