Destroy the container
 @param [Boolean] force force destruction
 @return [Boolean] true if container was destroyed

 If container is running and `force` parameter is true
 it will be stopped first. Otherwise it will raise exception.
555037
def destroy(force=false)
      unless exists?
        raise ContainerError, "Container does not exist."
      end

      if running?
        if force == true
          stop
        else
          raise ContainerError, "Container is running. Stop it first or use force=true"
        end  
      end

      run("destroy")

      !exists?
    end
546300
def remove_container(self, container_id, force=False):
        
        logger.info("removing container '%s' from filesystem", container_id)
        logger.debug("container_id = '%s'", container_id)
        self.d.remove_container(container_id, force=force)
968801
def destroy
      run_callbacks(:before_destroy)
      new_data = self.class.all.reject { |item| item.persisted_attributes == self.persisted_attributes }.map { |item| item.persisted_attributes }
      self.class.write_contents(new_data)
      self.is_destroyed = true
      run_callbacks(:after_destroy)
      true
    rescue IOError
      false
    end
1082429
def kill(container, rm=True):
    '''
    
    '''
    container = get_container(container)
    if not container:
        raise Exception('No such container: %s' % container)
    unbind_all(container['ip']) # legacy, only here for backwards compatibility

    sudo('docker kill %s' % container['name'])
    if rm:
        sudo('docker rm %s' % container['name'])
1026028
def destroy
        response = JSON.parse(CrateAPI::Base.call("#{CrateAPI::Base::CRATES_URL}/#{CrateAPI::Crates::CRATE_ACTIONS[:destroy] % ["#{self.id}"]}", :post))
        raise CrateDestroyError, response["message"] unless response["status"] != "failure"
      end
310098
def destroy(self):
        

        # if this unit didn't come from fleet, we can't destroy it
        if not self._is_live():
            raise RuntimeError('A unit must be submitted to fleet before it can destroyed.')

        return self._client.destroy_unit(self.name)
1101085
def cancel(force = false)
      if state == :scheduled
        [Concurrent::Promises.resolvable_future.tap { |f| f.fulfill delay_record.cancel }]
      else
        event = force ? ::Dynflow::Action::Cancellable::Abort : ::Dynflow::Action::Cancellable::Cancel
        steps_to_cancel.map do |step|
          world.event(id, step.id, event)
        end
      end
    end
756371
async def destroy(self, force=False):
        
        facade = client.ClientFacade.from_connection(self.connection)

        log.debug(
            'Destroying machine %s', self.id)

        await facade.DestroyMachines(force, [self.id])
        return await self.model._wait(
            'machine', self.id, 'remove')
269001
function (force) {
    var $overlay = $('.mdui-overlay');

    if (!$overlay.length) {
      return;
    }

    var level = force ? 1 : $overlay.data('overlay-level');
    if (level > 1) {
      $overlay.data('overlay-level', --level);
      return;
    }

    $overlay
      .data('overlay-level', 0)
      .removeClass('mdui-overlay-show')
      .data('isDeleted', 1)
      .transitionEnd(function () {
        if ($overlay.data('isDeleted')) {
          $overlay.remove();
        }
      });
  }
1043415
def destroy(zpool, force=False):
    '''
    

    '''
    # destroy zpool
    res = __salt__['cmd.run_all'](
        __utils__['zfs.zpool_command'](
            command='destroy',
            flags=['-f'] if force else None,
            target=zpool,
        ),
        python_shell=False,
    )

    return __utils__['zfs.parse_command_result'](res, 'destroyed')
1157397
def destroy(self, stream=False):
        
        self._setup_tf(stream=stream)
        args = ['-refresh=true', '-force', '.']
        logger.warning('Running terraform destroy: %s', ' '.join(args))
        out = self._run_tf('destroy', cmd_args=args, stream=stream)
        if stream:
            logger.warning('Terraform destroy finished successfully.')
        else:
            logger.warning("Terraform destroy finished successfully:\n%s", out)
1072287
def cleanup(self, force=False, delete=False):
        
        # TODO: this method could be part of API, like:
        try:
            self.stop()
        except subprocess.CalledProcessError as stop:
            logger.debug("unable to stop container via stop", stop)
            if not force:
                raise stop
            try:
                self.kill()
            except subprocess.CalledProcessError as kill:
                logger.debug("unable to stop container via kill", kill)
                pass
        if delete:
            self.delete(force=force)
541734
def destroy
      @resource = model.find(params[:id])
      authorize @resource

      @resource_title = t(_resource_title.singularize)

      before_destroy_hook(@resource)
      @resource.destroy

      return if _override_views.include? :destroy
      render 'faalis/dashboard/resource/destroy'
    end
1236229
def destroy(instance_id, call=None):
    '''
    
    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )

    instance_data = show_instance(instance_id, call='action')
    name = instance_data['instance_name']

    __utils__['cloud.fire_event'](
        'event',
        'destroying instance',
        'salt/cloud/{0}/destroying'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    params = {
        'action': 'TerminateInstances',
        'zone': _get_specified_zone(provider=get_configured_provider()),
        'instances.1': instance_id,
    }
    result = query(params)

    __utils__['cloud.fire_event'](
        'event',
        'destroyed instance',
        'salt/cloud/{0}/destroyed'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    return result
453545
def do_destroy(record)
      record ||= destroy_find_record
      begin
        self.successful = record.destroy
      rescue StandardError => exception
        flash[:warning] = as_(:cant_destroy_record, :record => ERB::Util.h(record.to_label))
        self.successful = false
        logger.warn do
          "\n\n#{exception.class} (#{exception.message}):\n    " +
            Rails.backtrace_cleaner.clean(exception.backtrace).join("\n    ") +
            "\n\n"
        end
      end
    end
328295
def clean(self, force: bool=False):
        '''
        '''
        with (yield from self._lock):
            for connection in tuple(self.ready):
                if force or connection.closed():
                    connection.close()
                    self.ready.remove(connection)
190101
def destroy(self, force=False):
        
        if force:
            super(UnmanagedLXC, self).destroy()
        else:
            raise UnmanagedLXCError('Destroying an unmanaged LXC might not '
                'work. To continue please call this method with force=True')