DELETE /projects/{projectName}

<p>Removes a project.
326937
@Delete("/projects/{projectName}")
    @RequiresRole(roles = ProjectRole.OWNER)
    public CompletableFuture<Void> removeProject(Project project, Author author) {
        // Metadata must be updated first because it cannot be updated if the project is removed.
        return mds.removeProject(author, project.name())
                  .thenCompose(unused -> execute(Command.removeProject(author, project.name())))
                  .handle(HttpApiUtil::throwUnsafelyIfNonNull);
    }
1308901
protected void removeProvisonalProject() {
		if (!this.currProject.exists()) {
			this.currProject = null;
			return;
		}

		final IRunnableWithProgress op = new IRunnableWithProgress() {
			@SuppressWarnings("synthetic-access")
			@Override
			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
				doRemoveProject(monitor);
			}
		};

		try {
			getContainer().run(true, true, new WorkspaceModifyDelegatingOperation(op));
		} catch (InvocationTargetException e) {
			final String title = NewWizardMessages.NewJavaProjectWizardPageTwo_error_remove_title;
			final String message = NewWizardMessages.NewJavaProjectWizardPageTwo_error_remove_message;
			ExceptionHandler.handle(e, getShell(), title, message);
		} catch (InterruptedException e) {
			// cancel pressed
		}
	}
486814
public void deleteProject(CmsDbContext dbc, CmsProject deleteProject) throws CmsException {

        deleteProject(dbc, deleteProject, true);
    }
1316258
def remove_node(project_root, environment, hostname)
      # Ask for a node to remove
      nodes = Bebox::Node.list(project_root, environment, 'nodes')
      if nodes.count > 0
        hostname = choose_option(nodes, _('wizard.node.choose_node'))
      else
        error _('wizard.node.no_nodes')%{environment: environment}
        return true
      end
      # Ask for deletion confirmation
      return warn(_('wizard.no_changes')) unless confirm_action?(_('wizard.node.confirm_deletion'))
      # Node deletion
      node = Bebox::Node.new(environment, project_root, hostname, nil)
      output = node.remove
      ok _('wizard.node.deletion_success')
      return output
    end
236672
protected void cleanupProjectIfEmpty(CmsProject project) throws CmsException {

        if ((project.getType().getMode() == CmsProject.PROJECT_TYPE_WORKFLOW.getMode()) && isProjectEmpty(project)) {
            LOG.info("Removing project " + project.getName() + " because it is an empty workflow project.");
            m_adminCms.deleteProject(project.getUuid());
        }
    }
710923
def delete_repository_tag(self, project_id, tag_name):
        
        return self.delete('/projects/{project_id}/repository/tags/{tag_name}'.format(
            project_id=project_id, tag_name=tag_name))
187597
def delete_project(self):
        
        if self.current_active_project:
            self.switch_to_plugin()
            path = self.current_active_project.root_path
            buttons = QMessageBox.Yes | QMessageBox.No
            answer = QMessageBox.warning(
                self,
                _("Delete"),
                _("Do you really want to delete <b>{filename}</b>?<br><br>"
                  "<b>Note:</b> This action will only delete the project. "
                  "Its files are going to be preserved on disk."
                  ).format(filename=osp.basename(path)),
                buttons)
            if answer == QMessageBox.Yes:
                try:
                    self.close_project()
                    shutil.rmtree(osp.join(path, '.spyproject'))
                except EnvironmentError as error:
                    QMessageBox.critical(
                        self,
                        _("Project Explorer"),
                        _("<b>Unable to delete <i>{varpath}</i></b>"
                          "<br><br>The error message was:<br>{error}"
                          ).format(varpath=path, error=to_text_string(error)))
1243184
def delete_project(self, project):
        
        pid = project.pid

        # project deleted

        ds_project = self.get_project(pid)
        if ds_project is not None:
            self._call(["delete", "account", "name=%s" % pid])

        return
741550
public ItemRequest<Project> delete(String project) {
    
        String path = String.format("/projects/%s", project);
        return new ItemRequest<Project>(this, Project.class, path, "DELETE");
    }
745329
def remove_project(self, project_id):
        

        if project_id not in self._projects:
            raise aiohttp.web.HTTPNotFound(text="Project ID {} doesn't exist".format(project_id))
        del self._projects[project_id]
996907
def delete_file(self, project_name, remote_path):
        
        project = self._get_or_create_project(project_name)
        remote_file = project.get_child_for_path(remote_path)
        remote_file.delete()
883801
def delete_project(id=None, name=None):
    
    content = delete_project_raw(id, name)
    if content:
        return utils.format_json(content)
772374
function deleteProjectWithId(projectId) {
	return fetchProject(projectId)
	.then(deleteProject)
	.catch((error) => {
		console.trace(error);
		throw error;
	});
}
827818
def remove_project(self, node):
        

        if node.family == "Project":
            self.__script_editor.remove_project(node.path)
            return True

        for node in foundations.walkers.nodes_walker(node, ascendants=True):
            if node.family == "Project" and not node is self.__script_editor.model.default_project_node:
                self.__script_editor.remove_project(node.path)
                return True
386100
def deleteprojectmember(self, project_id, user_id):
        
        request = requests.delete(
            '{0}/{1}/members/{2}'.format(self.projects_url, project_id, user_id),
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return True
1092147
private void deleteLeastRecentlyUsedProjects(long sizeToFreeInBytes,
      final List<ProjectDirectoryMetadata> projectDirMetadataList) {
    // Sort projects by last reference time in ascending order
    projectDirMetadataList.sort(Comparator.comparing(ProjectDirectoryMetadata::getLastAccessTime));
    final Set<File> projectDirsToDelete = new HashSet<>();

    for (final ProjectDirectoryMetadata proj : projectDirMetadataList) {
      if (sizeToFreeInBytes > 0) {
        // Delete the project directory even if flow within is running. It's OK to
        // delete the directory since execution dir is HARD linked to project dir. Note that even
        // if project is deleted, disk space will be freed up only when all associated execution
        // dirs are deleted.
        if (proj.getInstalledDir() != null) {
          projectDirsToDelete.add(proj.getInstalledDir());
          sizeToFreeInBytes -= proj.getDirSizeInByte();
        }
      } else {
        break;
      }
    }

    final long start = System.currentTimeMillis();
    deleteProjectDirsInParallel(ImmutableSet.copyOf(projectDirsToDelete));
    final long end = System.currentTimeMillis();
    log.info("Deleting {} project dir(s) took {} sec(s)", projectDirsToDelete.size(),
        (end - start) / 1000);
  }
518205
def rm(name):
    
    path = get_existing_project_path(name)

    click.confirm(
        'Are you sure you want to delete project %s?' % name, abort=True)

    container_name = get_container_name(name)
    client = docker.Client()
    try:
        client.inspect_container(container_name)
    except docker.errors.NotFound:
        pass
    else:
        print("Removing container %s..." % container_name)
        client.remove_container(container_name, v=True, force=True)

    print("Removing %s..." % path)
    shutil.rmtree(path)