// DestroyEntity removes an entity from the Nuage VRS
507576
func (vrsConnection *VRSConnection) DestroyEntityByVMName(vm_name string) error {

	condition := []string{ovsdb.NuageVMTableColumnVMName, "==", vm_name}
	if err := vrsConnection.vmTable.DeleteRow(vrsConnection.ovsdbClient, condition); err != nil {
		return fmt.Errorf("Unable to delete the entity from VRS %v", err)
	}

	return nil
}
1202006
func (s *Session) Destroy(ctx context.Context) error {
	sd := s.getSessionDataFromContext(ctx)

	sd.mu.Lock()
	defer sd.mu.Unlock()

	err := s.Store.Delete(sd.token)
	if err != nil {
		return err
	}

	sd.status = Destroyed

	// Reset everything else to defaults.
	sd.token = ""
	sd.Deadline = time.Now().Add(s.Lifetime).UTC()
	for key := range sd.Values {
		delete(sd.Values, key)
	}

	return nil
}
341057
func (s *appsService) Destroy(ctx context.Context, db *gorm.DB, app *App) error {
	if err := appsDestroy(db, app); err != nil {
		return err
	}

	return s.Scheduler.Remove(ctx, app.ID)
}
26802
func (nsLife_) destroyOp(entities mongo.Collection, docID string, update bson.D) (txn.Op, error) {
	op, err := nsLife.aliveOp(entities, docID)
	if err != nil {
		return txn.Op{}, errors.Trace(err)
	}
	setDying := bson.D{{"$set", bson.D{{"life", Dying}}}}
	op.Update = append(setDying, update...)
	return op, nil
}
1231474
func (s *StorageAPI) DestroyUnitStorageAttachments(args params.Entities) (params.ErrorResults, error) {
	canAccess, err := s.accessUnit()
	if err != nil {
		return params.ErrorResults{}, err
	}
	result := params.ErrorResults{
		Results: make([]params.ErrorResult, len(args.Entities)),
	}
	one := func(tag string) error {
		unitTag, err := names.ParseUnitTag(tag)
		if err != nil {
			return err
		}
		if !canAccess(unitTag) {
			return common.ErrPerm
		}
		return s.storage.DestroyUnitStorageAttachments(unitTag)
	}
	for i, entity := range args.Entities {
		err := one(entity.Tag)
		result.Results[i].Error = common.ServerError(err)
	}
	return result, nil
}
308460
func (c *Client) DestroyRelation(force *bool, maxWait *time.Duration, endpoints ...string) error {
	args := params.DestroyRelation{
		Endpoints: endpoints,
		Force:     force,
		MaxWait:   maxWait,
	}
	return c.facade.FacadeCall("DestroyRelation", args, nil)
}
1182847
func (s *DeleteMailboxPermissionsInput) SetEntityId(v string) *DeleteMailboxPermissionsInput {
	s.EntityId = &v
	return s
}
1009729
func (m *MockRPCClient) DestroyRPCClient(contextID string) {
	m.ctrl.Call(m, "DestroyRPCClient", contextID)
}
1127848
func DestroyContainer(ctx context.Context, client *docker.Client, container *docker.Container) error {
	return provision.FnRemove(client, container.ID)
}
55635
func (c *Compiler) Destroy() {
	c.setCallbackData(nil)
	if c.compiler != nil {
		c.compiler.finalize()
		c.compiler = nil
	}
}
1102301
func (api *APIv4) DestroyUnit(args params.Entities) (params.DestroyUnitResults, error) {
	v5args := params.DestroyUnitsParams{
		Units: make([]params.DestroyUnitParams, len(args.Entities)),
	}
	for i, arg := range args.Entities {
		v5args.Units[i].UnitTag = arg.Tag
	}
	return api.APIBase.DestroyUnit(v5args)
}
1015036
func (s *session) destroy(e error) {
	s.closeOnce.Do(func() {
		if nerr, ok := e.(net.Error); ok && nerr.Timeout() {
			s.logger.Errorf("Destroying session %s: %s", s.destConnID, e)
		} else {
			s.logger.Errorf("Destroying session %s with error: %s", s.destConnID, e)
		}
		s.sessionRunner.Remove(s.srcConnID)
		s.closeChan <- closeError{err: e, sendClose: false, remote: false}
	})
}
1322194
func DestroyVolumes(a mesos.AgentID, v ...mesos.Resource) *master.Call {
	return &master.Call{
		Type: master.Call_DESTROY_VOLUMES,
		DestroyVolumes: &master.Call_DestroyVolumes{
			AgentID: a,
			Volumes: v,
		},
	}
}
1232894
func (c *Client) DestroyModel(tag names.ModelTag, destroyStorage, force *bool, maxWait *time.Duration) error {
	var args interface{}
	if c.BestAPIVersion() < 4 {
		if destroyStorage == nil || !*destroyStorage {
			return errors.New("this Juju controller requires destroyStorage to be true")
		}
		args = params.Entities{Entities: []params.Entity{{Tag: tag.String()}}}
	} else {
		arg := params.DestroyModelParams{
			ModelTag:       tag.String(),
			DestroyStorage: destroyStorage,
		}
		if c.BestAPIVersion() > 6 {
			arg.Force = force
			arg.MaxWait = maxWait
		}
		args = params.DestroyModelsParams{Models: []params.DestroyModelParams{arg}}
	}
	var results params.ErrorResults
	if err := c.facade.FacadeCall("DestroyModels", args, &results); err != nil {
		return errors.Trace(err)
	}
	if n := len(results.Results); n != 1 {
		return errors.Errorf("expected 1 result, got %d", n)
	}
	if err := results.Results[0].Error; err != nil {
		return errors.Trace(err)
	}
	return nil
}
1205879
func (v *azureVolumeSource) DestroyVolumes(ctx context.ProviderCallContext, volumeIds []string) ([]error, error) {
	if v.maybeStorageClient == nil {
		return v.destroyManagedDiskVolumes(ctx, volumeIds)
	}
	return v.destroyUnmanagedDiskVolumes(ctx, volumeIds)
}
891838
func (a *Application) Destroy() (err error) {
	defer func() {
		logger.Tracef("Application(%s).Destroy() => %v", a.doc.Name, err)
		if err == nil {
			// This is a white lie; the document might actually be removed.
			a.doc.Life = Dying
		}
	}()
	return a.st.ApplyOperation(a.DestroyOperation())
}
901354
func (s *RemoteApplication) Destroy() error {
	_, err := s.DestroyWithForce(false, time.Duration(0))
	return err
}