// TrashRemove permanently deletes the trashed RBD with the specified id.
541115
func TrashRemove(ioctx *rados.IOContext, id string, force bool) error {
	c_id := C.CString(id)
	defer C.free(unsafe.Pointer(c_id))

	return GetError(C.rbd_trash_remove(C.rados_ioctx_t(ioctx.Pointer()), c_id, C.bool(force)))
}
860758
func (d *driver) VolumeRemove(
	ctx types.Context,
	volumeID string,
	opts *types.VolumeRemoveOpts) error {
	// Initialize for logging
	fields := map[string]interface{}{
		"provider": d.Name(),
		"volumeID": volumeID,
	}

	// review volume with attachments to any host
	ec2vols, err := d.getVolume(ctx, volumeID, "")
	if err != nil {
		return goof.WithFieldsE(fields, "error getting volume", err)
	}
	// tagName: e.g. "vol1"
	tagName := d.getName(ec2vols[0].Tags)
	if tagName == "" {
		return goof.WithFields(fields, "error empty Name tag")
	}
	// get fcvol constituent disks by Name tag
	ec2vols, err = d.getVolume(ctx, "", tagName)
	if err != nil {
		return goof.WithFieldsE(fields, "error getting FittedCloud volumes", err)
	}

	// Remove constituent disks
	for _, volume := range ec2vols {
		// Skip volumes without FittedCloudCreated tag
		if d.fittedcloudCreated(volume.Tags) == "" {
			log.Warn(goof.WithFields(fields, "not a FittedCloudCreated volume"))
			continue
		}
		// Delete volume via EC2 API call
		dvInput := &awsec2.DeleteVolumeInput{
			VolumeId: volume.VolumeId,
		}
		_, err := mustSession(ctx).DeleteVolume(dvInput)
		if err != nil {
			return goof.WithFieldsE(fields, "error deleting volume", err)
		}
	}

	return nil
}
1191707
func FnRemove(client *docker.Client, containerID string) (err error) {
	err = client.RemoveContainer(docker.RemoveContainerOptions{ID: containerID, Force: true})
	return
}
553112
func (j *Jobs) Deregister(jobID string, purge bool, q *WriteOptions) (string, *WriteMeta, error) {
	var resp JobDeregisterResponse
	wm, err := j.client.delete(fmt.Sprintf("/v1/job/%v?purge=%t", jobID, purge), &resp, q)
	if err != nil {
		return "", nil, err
	}
	return resp.EvalID, wm, nil
}
538403
func (s *ServerMethods) Delete(id int) error {
	_, err := s.ExecCmd(NewCmd("serverdelete").WithArgs(NewArg("sid", id)))
	return err
}
575569
func SecretRemove(id string) error {
	return mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		return cli.SecretRemove(ctx, id)
	})
}
965430
func (e *Engine) VirtualizationRemove(ctx context.Context, ID string, removeVolumes, force bool) error {
	return e.client.ContainerRemove(ctx, ID, dockertypes.ContainerRemoveOptions{RemoveVolumes: removeVolumes, Force: force})
}
1110067
func (f *Factory) recursiveDelete(n *node) {
	parent := n.parent
	if parent == nil {
		return
	}
	delete(parent.children, n.name)
	if len(parent.children) == 0 {
		f.recursiveDelete(parent)
	}
}
996406
func (mongo *MongoDB) DeleteOne(id string) error {
	_, err := mongo.Collection.RemoveAll(bson.M{"id": id})
	return err
}
689496
func HyperxlNicRemove(ctx LibxlCtxPtr, domid uint32, mac string) int {
	return (int)(C.hyperxl_nic_remove((*C.struct_libxl__ctx)(ctx), (C.uint32_t)(domid), C.CString(mac)))
}
654498
func (cl *CommandList) DeleteID(id int) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("deleteid %d", id), nil, cmdNoReturn})
}
1136949
func (s *File) Delete(id string) error {
	name := s.Prefixed.Name(id)
	if err := os.Remove(s.join(name)); err != nil {
		return err
	}
	if s.RemoveEmpty && filepath.Dir(name) != "." {
		return s.removeIfEmpty(filepath.Dir(name))
	}
	return nil
}
732332
func (c *Files) PermanentlyDelete(in *PermanentlyDeleteInput) (err error) {
	body, err := c.call("/files/delete", in)
	if err != nil {
		return
	}
	defer body.Close()

	return
}
681274
func NodeRemove(id string) error {
	return mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		return cli.NodeRemove(ctx, id, types.NodeRemoveOptions{})
	})
}
794252
func (s *ServerRPC) ImageRemove(ctx context.Context, req *types.ImageRemoveRequest) (*types.ImageRemoveResponse, error) {
	resp, err := s.daemon.CmdImageDelete(req.Image, req.Force, req.Prune)
	if err != nil {
		return nil, err
	}

	return &types.ImageRemoveResponse{
		Images: resp,
	}, nil
}
1174456
func (svmMap *serviceVMMap) deleteID(id string) error {
	svmMap.Lock()
	defer svmMap.Unlock()
	svm, ok := svmMap.svms[id]
	if !ok {
		return errVMUnknown
	}
	if svm.refCount != 0 {
		return errVMStillHasReference
	}
	delete(svmMap.svms, id)
	return nil
}
1241749
func (cli *Client) NetworkRemove(ctx context.Context, networkID string) error {
	resp, err := cli.delete(ctx, "/networks/"+networkID, nil, nil)
	defer ensureReaderClosed(resp)
	return wrapResponseError(err, resp, "network", networkID)
}