- release_tracks: [GA, ALPHA]
  help_text:
    brief: Create a new Cloud TPU VM node.
    description: Create a new Cloud TPU VM node.
    examples: |
      To create a TPU VM node with ID `my-tpu` in the default user project, network and
      compute/zone (with other defaults supplied by API), run:

        $ {command} my-tpu


      To create a TPU VM node in a specific network, run:

        $ {command} my-tpu --zone=us-central1-a --network=my-tf-network --description='My TPU VM' --version='v2-alpha'

      To create a small TPU VM v2 pod, run:

        $ {command} my-tpu --zone=us-central1-a --accelerator-type='v2-32' --description='My TPU VM' --version='v2-alpha'

  request:
    _COMMON_: create_request
    ALPHA:
      api_version: v2alpha1
      modify_request_hooks:
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:MergeMetadata:api_version=v2alpha1
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:ParseBootDiskConfigurations:api_version=v2alpha1
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:SetImage:api_version=v2alpha1
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:CreateReservationName
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:SetProvisioningModel:api_version=v2alpha1
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:RemoveConflictingDefaults
      - googlecloudsdk.command_lib.util.hooks.request_modifiers:SetParentRequestHook
    GA:
      api_version: v2
      modify_request_hooks:
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:MergeMetadata:api_version=v2
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:ParseBootDiskConfigurations:api_version=v2
      - googlecloudsdk.command_lib.compute.tpus.tpu_vm.util:RemoveConflictingDefaults
      - googlecloudsdk.command_lib.util.hooks.request_modifiers:SetParentRequestHook


  async:
    collection: tpu.projects.locations.operations
    result_attribute: response
    extract_resource_result: false

  arguments:
    resource:
      help_text: Name of the Cloud TPU VM node to create.
      spec: !REF googlecloudsdk.command_lib.compute.tpus.tpu_vm.resources:tpu

    params:
    - group:
        help_text: Specify a TPU node in either chips or cores
        required: false
        mutex: true
        params:
        - group:
            help_text: Core based TPU configuration
            params:
            - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:accelerator_type
        - group:
            help_text: Chip based TPU configuration
            required: false
            mutex: false
            params:
            - _REF_: googlecloudsdk.command_lib.compute.tpus.flags:type
              api_field: node.acceleratorConfig.type
              required: true
              release_tracks: [ALPHA]
            - _REF_: googlecloudsdk.command_lib.compute.tpus.flags:ga-type
              api_field: node.acceleratorConfig.type
              required: true
              release_tracks: [GA]
            - _REF_: googlecloudsdk.command_lib.compute.tpus.flags:topology
              api_field: node.acceleratorConfig.topology
              required: true
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:description
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:network
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:subnetwork
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:enable_external_ips
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:queue_count
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:version
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:preemptible
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:spot
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:reserved
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:range
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:service_account
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:service_account_scopes
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:labels
    - _REF_: googlecloudsdk.command_lib.compute.tpus.flags:metadata
    - _REF_: googlecloudsdk.command_lib.compute.tpus.flags:metadata_from_file
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:tags
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:data_disks
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:enable_secure_boot
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:boot_disk
    - _REF_: googlecloudsdk.command_lib.compute.tpus.flags:image
      release_tracks: [ALPHA]
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:autocheckpoint_enabled
      release_tracks: [ALPHA]
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:reservation
      release_tracks: [ALPHA]
    - _REF_: googlecloudsdk.command_lib.compute.tpus.tpu_vm.flags:provisioning_model
      release_tracks: [ALPHA]
