// AddInstancesToInstanceGroup adds the given instances to the given
// instance group.
424663
func (g *Cloud) AddInstancesToInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newInstanceGroupMetricContext("add_instances", zone)
	// TODO: should cull operation above this layer.
	if len(instanceRefs) == 0 {
		return nil
	}
	req := &compute.InstanceGroupsAddInstancesRequest{
		Instances: instanceRefs,
	}
	return mc.Observe(g.c.InstanceGroups().AddInstances(ctx, meta.ZonalKey(name, zone), req))
}
673129
func (i *IPAddressPerTask) AddGroup(group string) *IPAddressPerTask {
	if i.Groups == nil {
		i.EmptyGroups()
	}

	groups := *i.Groups
	groups = append(groups, group)
	i.Groups = &groups

	return i
}
941789
func (gce *Cloud) DeleteInstanceGroup(name string, zone string) error {
	op, err := gce.service.InstanceGroups.Delete(
		gce.projectID, zone, name).Do()
	if err != nil {
		return err
	}
	return gce.waitForZoneOp(op, zone)
}
854544
func matchInstanceGroup(mig *compute.InstanceGroupManager, c *kops.Cluster, instancegroups []*kops.InstanceGroup) (*kops.InstanceGroup, error) {
	migName := LastComponent(mig.Name)
	var matches []*kops.InstanceGroup
	for _, ig := range instancegroups {
		name := NameForInstanceGroupManager(c, ig, LastComponent(mig.Zone))
		if name == migName {
			matches = append(matches, ig)
		}
	}

	if len(matches) == 0 {
		return nil, nil
	}
	if len(matches) != 1 {
		return nil, fmt.Errorf("found multiple instance groups matching MIG %q", mig.Name)
	}
	return matches[0], nil
}
113254
func (s *CreateLaunchConfigurationInput) SetInstanceType(v string) *CreateLaunchConfigurationInput {
	s.InstanceType = &v
	return s
}
1123898
func (groups *Groups) AddGroup(newGroup *Group) {
	if newGroup.GroupID != "" {
		for key, group := range groups.Groups.Items {
			if group.GroupID == newGroup.GroupID {
				groups.Groups.Items[key] = newGroup
				return
			}
		}
	}

	newGroup.parent = groups

	groups.Groups.Items = append(groups.Groups.Items, newGroup)
}
769618
func newInstanceGroups(c *KopsV1alpha2Client, namespace string) *instanceGroups {
	return &instanceGroups{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
878901
func (o *ImportGKEGroup) SetInstanceTypes(v *InstanceTypesGKE) *ImportGKEGroup {
	if o.InstanceTypes = v; o.InstanceTypes == nil {
		o.nullFields = append(o.nullFields, "InstanceTypes")
	}
	return o
}
489928
func (s *Fleet) SetInstanceType(v string) *Fleet {
	s.InstanceType = &v
	return s
}
1152085
func (o *Task) SetInstanceGroupType(v *string) *Task {
	if o.InstanceGroupType = v; o.InstanceGroupType == nil {
		o.nullFields = append(o.nullFields, "InstanceGroupType")
	}
	return o
}
880717
func (r *PCPRegistry) AddInstanceDomain(indom InstanceDomain) error {
	if r.HasInstanceDomain(indom.Name()) {
		return errors.New("InstanceDomain is already defined for the current registry")
	}

	r.indomlock.Lock()
	defer r.indomlock.Unlock()

	if r.mapped {
		return errors.New("Cannot add an indom when a mapping is active")
	}

	r.instanceDomains[indom.Name()] = indom.(*PCPInstanceDomain)
	r.instanceCount += indom.InstanceCount()

	if !r.version2 {
		for _, v := range indom.Instances() {
			if len(v) > MaxV1NameLength {
				r.version2 = true
			}
		}
	}

	if indom.(*PCPInstanceDomain).shortDescription != "" {
		r.stringcount++
	}

	if indom.(*PCPInstanceDomain).longDescription != "" {
		r.stringcount++
	}

	return nil
}
48573
func (s *TransformResources) SetInstanceType(v string) *TransformResources {
	s.InstanceType = &v
	return s
}
782198
func (p *AuroraSchedulerManagerClient) AddInstances(ctx context.Context, key *InstanceKey, count int32) (r *Response, err error) {
  var _args143 AuroraSchedulerManagerAddInstancesArgs
  _args143.Key = key
  _args143.Count = count
  var _result144 AuroraSchedulerManagerAddInstancesResult
  if err = p.Client_().Call(ctx, "addInstances", &_args143, &_result144); err != nil {
    return
  }
  return _result144.GetSuccess(), nil
}
1289425
func (s *Bundle) SetInstanceType(v string) *Bundle {
	s.InstanceType = &v
	return s
}
1042648
func (mm *methodManager) AddInstanceMethods(
	obj interface{}, option ...Options) {
	mm.addInstanceMethods(obj, mm.addFuncField, option...)
}
374162
func (gce *Cloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error) {
	// TODO: use PageToken to list all not just the first 500
	return gce.service.InstanceGroups.List(gce.projectID, zone).Do()
}
512618
func (s *ServerLaunchConfiguration) SetInstanceType(v string) *ServerLaunchConfiguration {
	s.InstanceType = &v
	return s
}