// Destroy the specified secret instance.
512990
func (_class SecretClass) Destroy(sessionID SessionRef, self SecretRef) (_err error) {
	_method := "secret.destroy"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertSecretRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg)
	return
}
1175109
func (vm *VM) Destroy() error {
	svc, err := getService(vm.Region)
	if err != nil {
		return fmt.Errorf("failed to get AWS service: %v", err)
	}

	if vm.InstanceID == "" {
		// Probably need to call Provision first.
		return ErrNoInstanceID
	}
	_, err = svc.TerminateInstances(&ec2.TerminateInstancesInput{
		InstanceIds: []*string{
			aws.String(vm.InstanceID),
		},
	})
	if err != nil {
		return err
	}

	if !vm.DeleteKeysOnDestroy {
		return nil
	}

	vm.ResetKeyPair()
	return nil
}
489435
func Destroy(env environs.Environ, ctx context.ProviderCallContext) error {
	logger.Infof("destroying model %q", env.Config().Name())
	if err := destroyInstances(env, ctx); err != nil {
		return errors.Annotate(err, "destroying instances")
	}
	if err := destroyStorage(env, ctx); err != nil {
		return errors.Annotate(err, "destroying storage")
	}
	return nil
}
605214
func (conn *CpConn) Destroy() error {
	if conn.pool == nil {
		return errors.New("Connection not belong any connection pool.")
	}
	err := conn.pool.Remove(conn.Conn)
	if err != nil {
		return err
	}
	conn.pool = nil
	return nil
}
508762
func (env *sessionEnviron) Destroy(ctx callcontext.ProviderCallContext) error {
	if err := DestroyEnv(env, ctx); err != nil {
		// We don't need to worry about handling credential errors
		// here - this is implemented in terms of common operations
		// that call back into this provider, so we'll handle them
		// further down the stack.
		return errors.Trace(err)
	}
	err := env.client.DestroyVMFolder(env.ctx, path.Join(
		controllerFolderName("*"),
		env.modelFolderName(),
	))
	HandleCredentialError(err, ctx)
	return err
}
265224
func (t *Tray) Destroy() (err error) {
	if err = t.isActionable(); err != nil {
		return
	}
	_, err = synchronousEvent(t.c, t, t.w, Event{Name: EventNameTrayCmdDestroy, TargetID: t.id}, EventNameTrayEventDestroyed)
	return
}
1266352
func (vpcApi *VpcApi) Destroy(id string) (bool, error) {
	_, err := vpcApi.entityService.Delete(id, []byte{}, map[string]string{})
	return err == nil, err
}
218271
func (s *secrets) Remove(secrets []string) {
	s.mu.Lock()
	defer s.mu.Unlock()
	for _, secret := range secrets {
		delete(s.m, secret)
	}
}
687376
func (_class SubjectClass) Destroy(sessionID SessionRef, self SubjectRef) (_err error) {
	_method := "subject.destroy"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertSubjectRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg)
	return
}
244837
func (im *Image) Destroy() {
	if im.Pixmap != 0 {
		xproto.FreePixmap(im.X.Conn(), im.Pixmap)
		im.Pixmap = 0
	}
}
197991
func (s *sentFolderDownloadState) destroy() []protocol.FileDownloadProgressUpdate {
	updates := make([]protocol.FileDownloadProgressUpdate, 0, len(s.files))
	for name, info := range s.files {
		updates = append(updates, protocol.FileDownloadProgressUpdate{
			Name:       name,
			Version:    info.version,
			UpdateType: protocol.UpdateTypeForget,
		})
		delete(s.files, name)
	}
	return updates
}
496792
func (db *PGStore) destroy(session *sessions.Session) error {
	_, err := db.DbPool.Exec("DELETE FROM http_sessions WHERE key = $1", session.ID)
	return err
}
975636
func (b *BackupEngineInfo) Destroy() {
	C.rocksdb_backup_engine_info_destroy(b.c)
	b.c = nil
}
624125
func (opts *UniversalCompactionOptions) Destroy() {
	C.rocksdb_universal_compaction_options_destroy(opts.c)
	opts.c = nil
}
680118
func (s *Session) Destroy(w http.ResponseWriter) {
	s.store.Destroy(w, s.name)
}
586885
func (_class VLANClass) Destroy(sessionID SessionRef, self VLANRef) (_err error) {
	_method := "VLAN.destroy"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVLANRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg)
	return
}
779468
func (vm *VM) Destroy() error {
	s, err := vm.getService()
	if err != nil {
		return err
	}

	return s.delete()
}