PATCH /projects/{projectName}

<p>Patches a project with the JSON_PATCH. Currently, only unremove project operation is supported.
518269
@Consumes("application/json-patch+json")
    @Patch("/projects/{projectName}")
    @RequiresAdministrator
    public CompletableFuture<ProjectDto> patchProject(@Param("projectName") String projectName,
                                                      JsonNode node,
                                                      Author author) {
        checkUnremoveArgument(node);
        // Restore the project first then update its metadata as 'active'.
        return execute(Command.unremoveProject(author, projectName))
                .thenCompose(unused -> mds.restoreProject(author, projectName))
                .handle(returnOrThrow(() -> DtoConverter.convert(projectManager().get(projectName))));
    }
435920
@Patch("/metadata/{projectName}/tokens/{appId}")
    @Consumes("application/json-patch+json")
    public CompletableFuture<Revision> updateTokenRole(@Param("projectName") String projectName,
                                                       @Param("appId") String appId,
                                                       JsonPatch jsonPatch,
                                                       Author author) {
        final ReplaceOperation operation = ensureSingleReplaceOperation(jsonPatch, "/role");
        final ProjectRole role = ProjectRole.of(operation.value());
        return mds.findTokenByAppId(appId)
                  .thenCompose(token -> mds.updateTokenRole(author, projectName, token, role));
    }
1030100
public static void deleteAzkabanJob(String sessionId, AzkabanProjectConfig azkabanProjectConfig)
      throws IOException {
    log.info("Deleting Azkaban project for: " + azkabanProjectConfig.getAzkabanProjectName());

    // Delete project
    AzkabanAjaxAPIClient.deleteAzkabanProject(sessionId, azkabanProjectConfig);
  }
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);
    }
112190
def patch(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('patch', endpoint, data=json, params=params)
141114
def drop_project(project_name):
    
    conn, c = open_data_base_connection()
    # Need to delete all the run_tables before removing the project_table and the entry from the main_table
    run_table_name = project_name + '_run_table'

    c.execute("SELECT run_name FROM {}".format(run_table_name))
    run_names = np.array(c.fetchall()).squeeze(axis=1)

    # remove one run at a time
    for run in run_names:
        drop_run(project_name, run)

    c.execute("DROP TABLE IF EXISTS {}".format(run_table_name))

    # Remove the project row from main table
    c.execute("""DELETE FROM main_table WHERE project_name='{}'""".format(project_name))
    conn.commit()
    print("{} project deleted".format(project_name))
262056
def _update_project(self, project_name):
        ''''''
        project = self.projectdb.get(project_name)
        if not project:
            return None
        return self._load_project(project)
167069
def delete_version(self, project, version):
        
        url = self._build_url(constants.DELETE_VERSION_ENDPOINT)
        data = {
            'project': project,
            'version': version
        }
        self.client.post(url, data=data, timeout=self.timeout)
        return True
346473
function deleteProject(_ref9, _ref10) {
    var state = _ref9.state,
        commit = _ref9.commit,
        rootState = _ref9.rootState;

    var _ref11 = _slicedToArray(_ref10, 2),
        pid = _ref11[0],
        localRemove = _ref11[1];

    if (localRemove) commit('c3s/project/SET_PROJECT', null);
    return makeRequest(commit, rootState.c3s.client.apis.Projects.delete_project, {
      id: pid
    }, undefined);
  }
298376
public ItemRequest<ProjectStatus> delete(String projectStatus) {

        String path = String.format("/project_statuses/%s", projectStatus);
        return new ItemRequest<ProjectStatus>(this, ProjectStatus.class, path, "DELETE");
    }
1063905
def delete_project(self, project):
        
        url = self._build_url(constants.DELETE_PROJECT_ENDPOINT)
        data = {
            'project': project,
        }
        self.client.post(url, data=data, timeout=self.timeout)
        return True
526348
@Patch("/metadata/{projectName}/members/{memberId}")
    @Consumes("application/json-patch+json")
    public CompletableFuture<Revision> updateMember(@Param("projectName") String projectName,
                                                    @Param("memberId") String memberId,
                                                    JsonPatch jsonPatch,
                                                    Author author) {
        final ReplaceOperation operation = ensureSingleReplaceOperation(jsonPatch, "/role");
        final ProjectRole role = ProjectRole.of(operation.value());
        final User member = new User(loginNameNormalizer.apply(urlDecode(memberId)));
        return mds.getMember(projectName, member)
                  .thenCompose(unused -> mds.updateMemberRole(author, projectName, member, role));
    }
378999
public PubsubFuture<Void> deleteTopic(final String project,
                                        final String topic) {
    return deleteTopic(canonicalTopic(project, topic));
  }
598199
function removeProject(project) {
		return sharedProject.findOne({'location': project}).exec()
		.then(function(doc) {
			if (doc.users.length > 0) {
				return userProjectsCollection.removeProjectReferences(doc.users, project).exec();
			}
		})
		.then(function() {
			return sharedProject.remove({location: project}).exec();
		});
	}
560703
public static void patch(String path, String acceptType, Route route) {
        getInstance().patch(path, acceptType, route);
    }
559817
private boolean removeUpdate() throws IOException, ServletException {
	final File patchDir = getPatchDirectory();
	final File[] patches = patchDir.listFiles(new ExtensionFilter(new String[] { "rc", "rcs" }));

	for (int i = 0; i < patches.length; i++)
	    if (!patches[i].delete()) patches[i].deleteOnExit();
	_restart();
	return true;
    }
704910
def remove_accounts_from_project(accounts_query, project):
    

    query = accounts_query.filter(date_deleted__isnull=True)

    for account in query:
        remove_account_from_project(account, project)