- release_tracks: [ALPHA]

  help_text:
    brief: |
      Create a Looker instance.
    description: |
      Create a new Looker instance.

      This command can fail for the following reasons:
        * An instance with the same name already exists.
        * The active account does not have permission to create instances.
    examples: |
      To create a basic tier instance with the name `my-looker-instance` in region `us-central-1`
      with an edition of "STANDARD", run:

        $ {command} my-looker-instance --region=us-central1 --edition="STANDARD"

  arguments:
    resource:
      spec: !REF googlecloudsdk.command_lib.looker.resources:instance
      help_text: |
        Arguments and flags that specify the Looker instance you want
        to create.
    params:
    - arg_name: edition
      api_field: instance.platformEdition
      help_text: |
        The edition of the instance. Options are: STANDARD, ADVANCED, and ELITE
      choices:
      - enum_value: STANDARD
        arg_value: standard
        help_text:  |
          This edition provides a full-feature edition for product exploration
          and development. Exceptional for all your Analytics.
      - enum_value: ADVANCED
        arg_value: advanced
        help_text: |
          This edition provides a full-feature edition for product exploration and development.
          Scales as your organization and data add complexity.
      - enum_value: ELITE
        arg_value: elite
        help_text: |
          This edition provides a full-feature edition for product exploration and development.
          Drive your business through operational analytics.
      default: standard
    - arg_name: consumer-network
      api_field: instance.consumerNetwork
      help_text: |
        The network name within the consumer project. This MUST be delared if enabling private IP
    - arg_name: enable-public-ip
      api_field: instance.enablePublicIp
      type: bool
      help_text: |
        This specifies whether public IP is enabled on the Looker instance.
      default: true
    - arg_name: enable-private-ip
      api_field: instance.enablePrivateIp
      type: bool
      help_text: |
        This specifies whether private IP is enabled on the Looker instance.
    - group:
        required: false
        help_text: |
          Key resource - The Cloud KMS (Key Management Service) cryptokey that will be used to
          protect the Looker instance and backups. The 'Looker Service Agent' service account must hold
          permission 'Cloud KMS CryptoKey Encrypter/Decrypter'. The arguments in this group can
          be used to specify the attributes of this resource.
        params:
        - api_field: instance.encryptionConfig.kmsKeyName
          arg_name: kms-key
          help_text: |
            ID of the key or fully qualified identifier for the key. To
            set the *kms-key* attribute:
            * provide the argument *--kms-key* on the command line.

  request:
    ALPHA:
      api_version: v1alpha1

    collection: looker.projects.locations.instances
