// InstanceType returns the type of the node with the specified nodeName.
506559
func (c *Cloud) InstanceType(ctx context.Context, nodeName types.NodeName) (string, error) {
	if c.selfAWSInstance.nodeName == nodeName {
		return c.selfAWSInstance.instanceType, nil
	}
	inst, err := c.getInstanceByNodeName(nodeName)
	if err != nil {
		return "", fmt.Errorf("getInstanceByNodeName failed for %q with %q", nodeName, err)
	}
	return aws.StringValue(inst.InstanceType), nil
}
456793
func (s *BrokerNodeGroupInfo) SetInstanceType(v string) *BrokerNodeGroupInfo {
	s.InstanceType = &v
	return s
}
508679
func (env *azureEnviron) InstanceTypes(ctx context.ProviderCallContext, c constraints.Value) (instances.InstanceTypesWithCostMetadata, error) {
	types, err := env.getInstanceTypes(ctx)
	if err != nil {
		return instances.InstanceTypesWithCostMetadata{}, errors.Trace(err)
	}
	result := make([]instances.InstanceType, len(types))
	i := 0
	for _, iType := range types {
		result[i] = iType
		i++
	}
	result, err = instances.MatchingInstanceTypes(result, "", c)
	if err != nil {
		return instances.InstanceTypesWithCostMetadata{}, errors.Trace(err)
	}

	return instances.InstanceTypesWithCostMetadata{
		InstanceTypes: result,
		CostUnit:      "",
		CostCurrency:  "USD"}, nil
}
709421
func (s *DescribeNotebookInstanceOutput) SetInstanceType(v string) *DescribeNotebookInstanceOutput {
	s.InstanceType = &v
	return s
}
421916
func (o *Compute) SetInstanceTypes(v *InstanceTypes) *Compute {
	if o.InstanceTypes = v; o.InstanceTypes == nil {
		o.nullFields = append(o.nullFields, "InstanceTypes")
	}
	return o
}
921214
func (s *CreateNotebookInstanceInput) SetInstanceType(v string) *CreateNotebookInstanceInput {
	s.InstanceType = &v
	return s
}
157394
func (s *BrokerInstanceOption) SetHostInstanceType(v string) *BrokerInstanceOption {
	s.HostInstanceType = &v
	return s
}
940488
func (c *Cloud) findInstanceByNodeName(nodeName types.NodeName) (*ec2.Instance, error) {
	privateDNSName := mapNodeNameToPrivateDNSName(nodeName)
	filters := []*ec2.Filter{
		newEc2Filter("private-dns-name", privateDNSName),
		// exclude instances in "terminated" state
		newEc2Filter("instance-state-name", aliveFilter...),
	}

	instances, err := c.describeInstances(filters)
	if err != nil {
		return nil, err
	}

	if len(instances) == 0 {
		return nil, nil
	}
	if len(instances) > 1 {
		return nil, fmt.Errorf("multiple instances found for name: %s", nodeName)
	}
	return instances[0], nil
}
1170872
func (as *availabilitySet) GetInstanceTypeByNodeName(name string) (string, error) {
	machine, err := as.getVirtualMachine(types.NodeName(name))
	if err != nil {
		klog.Errorf("as.GetInstanceTypeByNodeName(%s) failed: as.getVirtualMachine(%s) err=%v", name, name, err)
		return "", err
	}

	return string(machine.HardwareProfile.VMSize), nil
}
175757
func (s *CreateEnvironmentEC2Input) SetInstanceType(v string) *CreateEnvironmentEC2Input {
	s.InstanceType = &v
	return s
}
489928
func (s *Fleet) SetInstanceType(v string) *Fleet {
	s.InstanceType = &v
	return s
}
1220629
func (s *NodeSummary) SetInstanceType(v string) *NodeSummary {
	s.InstanceType = &v
	return s
}
40809
func mapInstanceToNodeName(i *ec2.Instance) types.NodeName {
	return types.NodeName(aws.StringValue(i.PrivateDnsName))
}
719642
func (i *Instances) InstanceType(ctx context.Context, name types.NodeName) (string, error) {
	srv, err := getServerByName(i.compute, name)

	if err != nil {
		return "", err
	}

	return srvInstanceType(srv)
}
746178
func (s *ContainerDetail) SetInstanceType(v string) *ContainerDetail {
	s.InstanceType = &v
	return s
}
804021
func (s *InstanceTypeConfig) SetInstanceType(v string) *InstanceTypeConfig {
	s.InstanceType = &v
	return s
}
638228
func (s *CreateServerInput) SetInstanceType(v string) *CreateServerInput {
	s.InstanceType = &v
	return s
}