// ReportInstanceDead removes all health checks of a particular instance from
// the cache.
424748
func (f *Facade) ReportInstanceDead(serviceID string, instanceID int) {
	f.hcache.DeleteInstance(serviceID, instanceID)
}
1114407
func (cr *cacheRecord) isDead() bool {
	return cr.dead || (cr.equalImmutable != nil && cr.equalImmutable.dead) || (cr.equalMutable != nil && cr.equalMutable.dead)
}
688236
func (c *VSphereCloud) DeleteInstance(i *cloudinstances.CloudInstanceGroupMember) error {
	glog.V(8).Infof("vSphere cloud provider DeleteInstance not implemented yet")
	return fmt.Errorf("vSphere cloud provider does not support deleting cloud instances at this time.")
}
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)
}
1070180
func SerializeInstancesToDenseARFF(inst FixedDataGrid, path, relation string) error {

	// Get all of the Attributes in a reasonable order
	attrs := NonClassAttributes(inst)
	cAttrs := inst.AllClassAttributes()
	for _, c := range cAttrs {
		attrs = append(attrs, c)
	}

	return SerializeInstancesToDenseARFFWithAttributes(inst, attrs, path, relation)

}
93616
func (s *Scheduler) ReportOnce(ctx context.Context) error {
	datapoints := func() []*datapoint.Datapoint {
		// Only take the mutex here so that we don't hold it during the HTTP call
		s.callbackMutex.Lock()
		defer s.callbackMutex.Unlock()
		datapoints := s.CollectDatapoints()
		s.previousDatapoints = datapoints
		return datapoints
	}()
	return s.Sink.AddDatapoints(ctx, datapoints)
}
341635
func (c *environClient) stopInstance(id instance.Id) error {
	uuid := string(id)
	if uuid == "" {
		return errors.New("invalid instance id")
	}

	s, err := c.conn.Server(uuid)
	if err != nil {
		return errors.Trace(err)
	}

	err = s.StopWait()
	logger.Tracef("environClient.StopInstance - stop server, %q = %v", uuid, err)

	err = s.Remove(gosigma.RecurseAllDrives)
	logger.Tracef("environClient.StopInstance - remove server, %q = %v", uuid, err)

	return nil
}
679540
func (c *Client) ReportInstanceDead(serviceID string, instanceID int) error {
	request := ReportDeadInstanceRequest{
		ServiceID:  serviceID,
		InstanceID: instanceID,
	}
	return c.call("ReportInstanceDead", request, nil)
}
336624
func NewInstanceIDHandler(svcs <-chan types.StorageService) types.Middleware {
	iidh := &instanceIDHandler{
		s2d: map[string]string{},
	}
	for s := range svcs {
		iidh.s2d[strings.ToLower(s.Name())] = strings.ToLower(s.Driver().Name())
	}
	return iidh
}
971869
func DeleteInstance(svc Service, instance *cloudinstances.CloudInstanceGroupMember) error {
	glog.V(2).Infof("Detaching instance %q from Elastigroup", instance.ID)

	return svc.Detach(
		context.Background(),
		instance.CloudInstanceGroup.Raw.(Elastigroup).Id(),
		[]string{instance.ID})
}
649840
func newStorageInstanceId(mb modelBackend, store string) (string, error) {
	seq, err := sequence(mb, "stores")
	if err != nil {
		return "", errors.Trace(err)
	}
	return fmt.Sprintf("%s/%v", store, seq), nil
}
897543
func DeleteInstance(c GCECloud, instanceSelfLink string) error {
	glog.V(2).Infof("Deleting GCE Instance %s", instanceSelfLink)
	u, err := ParseGoogleCloudURL(instanceSelfLink)
	if err != nil {
		return err
	}

	op, err := c.Compute().Instances.Delete(u.Project, u.Zone, u.Name).Do()
	if err != nil {
		if IsNotFound(err) {
			glog.Infof("Instance not found, assuming deleted: %q", instanceSelfLink)
			return nil
		}
		return fmt.Errorf("error deleting Instance %s: %v", instanceSelfLink, err)
	}

	return c.WaitForOp(op)
}
891755
func (_m *FacadeInterface) ReportHealthStatus(key health.HealthStatusKey, value health.HealthStatus, expires time.Duration) {
	_m.Called(key, value, expires)
}
224246
func (c *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error) {
	instanceID, err := KubernetesInstanceID(providerID).MapToAWSInstanceID()
	if err != nil {
		return false, err
	}

	request := &ec2.DescribeInstancesInput{
		InstanceIds: []*string{instanceID.awsString()},
	}

	instances, err := c.ec2.DescribeInstances(request)
	if err != nil {
		return false, err
	}
	if len(instances) == 0 {
		return false, nil
	}
	if len(instances) > 1 {
		return false, fmt.Errorf("multiple instances found for instance: %s", instanceID)
	}

	state := instances[0].State.Name
	if *state == ec2.InstanceStateNameTerminated {
		klog.Warningf("the instance %s is terminated", instanceID)
		return false, nil
	}

	return true, nil
}
1201908
func (m *metadata) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error) {
	return false, cloudprovider.NotImplemented
}
376318
func CheckInstance(endpoint string) InstanceStatus {
	if inst, exist := connectionPool[endpoint]; exist {
		if inst.connection.Ping() == nil {
			return InstanceOK
		}
		return InstanceERROR
	}
	return InstanceUnregistered
}
936184
func (env *environ) StopInstances(ctx context.ProviderCallContext, instances ...instance.Id) error {
	var ids []string
	for _, id := range instances {
		ids = append(ids, string(id))
	}

	prefix := env.namespace.Prefix()
	err := env.gce.RemoveInstances(prefix, ids...)
	return google.HandleCredentialError(errors.Trace(err), ctx)
}