@DeleteMapping("/delete") public void delete() { }
@DeleteMapping("/delete") public void delete() { }
@DeleteMapping("/favorites/{favoriteId}") public void deleteFavorite(@PathVariable long favoriteId) { favoriteService.deleteFavorite(favoriteId); }
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @DeleteMapping("/{appId:.+}") public void deleteApp(@PathVariable String appId) { App app = appService.deleteAppInLocal(appId); publisher.publishEvent(new AppDeletionEvent(app)); }
@PreAuthorize(value = "@permissionValidator.hasDeleteNamespacePermission(#appId)") @DeleteMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName:.+}") public ResponseEntity<Void> deleteNamespace(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName) { namespaceService.deleteNamespace(appId, Env.valueOf(env), clusterName, namespaceName); return ResponseEntity.ok().build(); }
@DeleteMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName:.+}") public void delete(@PathVariable("appId") String appId, @PathVariable("clusterName") String clusterName, @PathVariable("namespaceName") String namespaceName, @RequestParam String operator) { Namespace entity = namespaceService.findOne(appId, clusterName, namespaceName); if (entity == null) throw new NotFoundException( String.format("namespace not found for %s %s %s", appId, clusterName, namespaceName)); namespaceService.deleteNamespace(entity, operator); }
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @DeleteMapping(value = "apps/{appId}/envs/{env}/clusters/{clusterName:.+}") public ResponseEntity<Void> deleteCluster(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName){ clusterService.deleteCluster(Env.fromString(env), appId, clusterName); return ResponseEntity.ok().build(); }
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @DeleteMapping("/apps/{appId}/appnamespaces/{namespaceName:.+}") public ResponseEntity<Void> deleteAppNamespace(@PathVariable String appId, @PathVariable String namespaceName) { AppNamespace appNamespace = appNamespaceService.deleteAppNamespace(appId, namespaceName); publisher.publishEvent(new AppNamespaceDeletionEvent(appNamespace)); return ResponseEntity.ok().build(); }
@DeleteMapping(path = "/", produces = "text/plain") String deleteCookie(HttpServletResponse response) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie(COOKIE_NAME, ""); cookie.setMaxAge(0); response.addCookie(cookie); return "Delete"; } }
@Transactional @DeleteMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}") public void deleteBranch(@PathVariable String appId, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String branchName, @RequestParam("operator") String operator) { checkBranch(appId, clusterName, namespaceName, branchName); namespaceBranchService .deleteBranch(appId, clusterName, namespaceName, branchName, NamespaceBranchStatus.DELETED, operator); messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName), Topics.APOLLO_RELEASE_TOPIC); }
@DeleteMapping("/apps/{appId}/appnamespaces/{namespaceName:.+}") public void delete(@PathVariable("appId") String appId, @PathVariable("namespaceName") String namespaceName, @RequestParam String operator) { AppNamespace entity = appNamespaceService.findOne(appId, namespaceName); if (entity == null) { throw new BadRequestException("app namespace not found for appId: " + appId + " namespace: " + namespaceName); } appNamespaceService.deleteAppNamespace(entity, operator); }
@DeleteMapping("/apps/{appId:.+}") public void delete(@PathVariable("appId") String appId, @RequestParam String operator) { App entity = appService.findOne(appId); if (entity == null) { throw new NotFoundException("app not found for appId " + appId); } adminService.deleteApp(entity, operator); }
@PreAuthorize(value = "@permissionValidator.hasModifyNamespacePermission(#appId, #namespaceName, #env) ") @DeleteMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/items/{itemId}") public void deleteItem(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable long itemId) { if (itemId <= 0) { throw new BadRequestException("item id invalid"); } configService.deleteItem(Env.valueOf(env), itemId, userInfoHolder.getUser().getUserId()); }
@PreAuthorize(value = "@permissionValidator.hasAssignRolePermission(#appId)") @DeleteMapping("/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}") public ResponseEntity<Void> removeNamespaceRoleFromUser(@PathVariable String appId, @PathVariable String namespaceName, @PathVariable String roleType, @RequestParam String user) { RequestPrecondition.checkArgumentsNotEmpty(user); if (!RoleType.isValidRoleType(roleType)) { throw new BadRequestException("role type is illegal"); } rolePermissionService.removeRoleFromUsers(RoleUtils.buildNamespaceRoleName(appId, namespaceName, roleType), Sets.newHashSet(user), userInfoHolder.getUser().getUserId()); return ResponseEntity.ok().build(); }
@DeleteMapping("/apps/{appId}/clusters/{clusterName:.+}") public void delete(@PathVariable("appId") String appId, @PathVariable("clusterName") String clusterName, @RequestParam String operator) { Cluster entity = clusterService.findOne(appId, clusterName); if (entity == null) { throw new NotFoundException("cluster not found for clusterName " + clusterName); } if(ConfigConsts.CLUSTER_NAME_DEFAULT.equals(entity.getName())){ throw new BadRequestException("can not delete default cluster!"); } clusterService.delete(entity.getId(), operator); }
@PreAuthorize(value = "@permissionValidator.hasAssignRolePermission(#appId)") @DeleteMapping("/apps/{appId}/roles/{roleType}") public ResponseEntity<Void> removeAppRoleFromUser(@PathVariable String appId, @PathVariable String roleType, @RequestParam String user) { RequestPrecondition.checkArgumentsNotEmpty(user); if (!RoleType.isValidRoleType(roleType)) { throw new BadRequestException("role type is illegal"); } rolePermissionService.removeRoleFromUsers(RoleUtils.buildAppRoleName(appId, roleType), Sets.newHashSet(user), userInfoHolder.getUser().getUserId()); return ResponseEntity.ok().build(); }
@DeleteMapping(path = "/notifications/filters/{id}") public ResponseEntity<Void> deleteFilter(@PathVariable("id") String id) { NotificationFilter deleted = filteringNotifier.removeFilter(id); if (deleted != null) { return ResponseEntity.ok().build(); } else { return ResponseEntity.notFound().build(); } }
@PreAuthorize(value = "@consumerPermissionValidator.hasModifyNamespacePermission(#request, #appId, #namespaceName, #env)") @DeleteMapping(value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key:.+}") public void deleteItem(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @PathVariable String key, @RequestParam String operator, HttpServletRequest request) { if (userService.findByUserId(operator) == null) { throw new BadRequestException("user(operator) not exists"); } ItemDTO toDeleteItem = itemService.loadItem(Env.fromString(env), appId, clusterName, namespaceName, key); if (toDeleteItem == null){ throw new BadRequestException("item not exists"); } itemService.deleteItem(Env.fromString(env), toDeleteItem.getId(), operator); }
@PreAuthorize(value = "@permissionValidator.hasAssignRolePermission(#appId)") @DeleteMapping("/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}") public ResponseEntity<Void> removeNamespaceEnvRoleFromUser(@PathVariable String appId, @PathVariable String env, @PathVariable String namespaceName, @PathVariable String roleType, @RequestParam String user) { RequestPrecondition.checkArgumentsNotEmpty(user); if (!RoleType.isValidRoleType(roleType)) { throw new BadRequestException("role type is illegal"); } // validate env parameter if (Env.UNKNOWN == EnvUtils.transformEnv(env)) { throw new BadRequestException("env is illegal"); } rolePermissionService.removeRoleFromUsers(RoleUtils.buildNamespaceRoleName(appId, namespaceName, roleType, env), Sets.newHashSet(user), userInfoHolder.getUser().getUserId()); return ResponseEntity.ok().build(); }
@DeleteMapping(path = "/applications/{name}") public Mono<ResponseEntity<Void>> unregister(@PathVariable("name") String name) { log.debug("Unregister application with name '{}'", name); return registry.getInstances(name) .flatMap(instance -> registry.deregister(instance.getId())) .collectList() .map(deregistered -> !deregistered.isEmpty() ? ResponseEntity.noContent() .build() : ResponseEntity.notFound() .build()); }