# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::BatchAI::Mgmt::V2018_05_01
  module Models
    #
    # Information about a Cluster.
    #
    class Cluster < ProxyResource

      include MsRestAzure

      # @return [String] VM size. The size of the virtual machines in the
      # cluster. All nodes in a cluster have the same VM size.
      attr_accessor :vm_size

      # @return [VmPriority] VM priority. VM priority of cluster nodes.
      # Possible values include: 'dedicated', 'lowpriority'. Default value:
      # 'dedicated' .
      attr_accessor :vm_priority

      # @return [ScaleSettings] Scale settings. Scale settings of the cluster.
      attr_accessor :scale_settings

      # @return [VirtualMachineConfiguration] VM configuration. Virtual machine
      # configuration (OS image) of the compute nodes. All nodes in a cluster
      # have the same OS image configuration.
      attr_accessor :virtual_machine_configuration

      # @return [NodeSetup] Node setup. Setup (mount file systems, performance
      # counters settings and custom setup task) to be performed on each
      # compute node in the cluster.
      attr_accessor :node_setup

      # @return [UserAccountSettings] User account settings. Administrator user
      # account settings which can be used to SSH to compute nodes.
      attr_accessor :user_account_settings

      # @return [ResourceId] Subnet. Virtual network subnet resource ID the
      # cluster nodes belong to.
      attr_accessor :subnet

      # @return [DateTime] Creation time. The time when the cluster was
      # created.
      attr_accessor :creation_time

      # @return [ProvisioningState] Provisioning state. Provisioning state of
      # the cluster. Possible value are: creating - Specifies that the cluster
      # is being created. succeeded - Specifies that the cluster has been
      # created successfully. failed - Specifies that the cluster creation has
      # failed. deleting - Specifies that the cluster is being deleted.
      # Possible values include: 'creating', 'succeeded', 'failed', 'deleting'
      attr_accessor :provisioning_state

      # @return [DateTime] Provisioning State Transition time. Time when the
      # provisioning state was changed.
      attr_accessor :provisioning_state_transition_time

      # @return [AllocationState] Allocation state. Allocation state of the
      # cluster. Possible values are: steady - Indicates that the cluster is
      # not resizing. There are no changes to the number of compute nodes in
      # the cluster in progress. A cluster enters this state when it is created
      # and when no operations are being performed on the cluster to change the
      # number of compute nodes. resizing - Indicates that the cluster is
      # resizing; that is, compute nodes are being added to or removed from the
      # cluster. Possible values include: 'steady', 'resizing'
      attr_accessor :allocation_state

      # @return [DateTime] Allocation state transition time. The time at which
      # the cluster entered its current allocation state.
      attr_accessor :allocation_state_transition_time

      # @return [Array<BatchAIError>] Errors. Collection of errors encountered
      # by various compute nodes during node setup.
      attr_accessor :errors

      # @return [Integer] Current node count. The number of compute nodes
      # currently assigned to the cluster.
      attr_accessor :current_node_count

      # @return [NodeStateCounts] Node state counts. Counts of various node
      # states on the cluster.
      attr_accessor :node_state_counts


      #
      # Mapper for Cluster class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Cluster',
          type: {
            name: 'Composite',
            class_name: 'Cluster',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              vm_size: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.vmSize',
                type: {
                  name: 'String'
                }
              },
              vm_priority: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.vmPriority',
                default_value: 'dedicated',
                type: {
                  name: 'Enum',
                  module: 'VmPriority'
                }
              },
              scale_settings: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.scaleSettings',
                type: {
                  name: 'Composite',
                  class_name: 'ScaleSettings'
                }
              },
              virtual_machine_configuration: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.virtualMachineConfiguration',
                type: {
                  name: 'Composite',
                  class_name: 'VirtualMachineConfiguration'
                }
              },
              node_setup: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.nodeSetup',
                type: {
                  name: 'Composite',
                  class_name: 'NodeSetup'
                }
              },
              user_account_settings: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.userAccountSettings',
                type: {
                  name: 'Composite',
                  class_name: 'UserAccountSettings'
                }
              },
              subnet: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.subnet',
                type: {
                  name: 'Composite',
                  class_name: 'ResourceId'
                }
              },
              creation_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.creationTime',
                type: {
                  name: 'DateTime'
                }
              },
              provisioning_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.provisioningState',
                type: {
                  name: 'String'
                }
              },
              provisioning_state_transition_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.provisioningStateTransitionTime',
                type: {
                  name: 'DateTime'
                }
              },
              allocation_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.allocationState',
                type: {
                  name: 'String'
                }
              },
              allocation_state_transition_time: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.allocationStateTransitionTime',
                type: {
                  name: 'DateTime'
                }
              },
              errors: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.errors',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'BatchAIErrorElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'BatchAIError'
                      }
                  }
                }
              },
              current_node_count: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.currentNodeCount',
                type: {
                  name: 'Number'
                }
              },
              node_state_counts: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.nodeStateCounts',
                type: {
                  name: 'Composite',
                  class_name: 'NodeStateCounts'
                }
              }
            }
          }
        }
      end
    end
  end
end
