private void validateGroupName(String groupName) {
    if (StringUtils.isEmpty(groupName)) {
      throw new BadRequestException(
          "Group name can not be empty, please specify a valid group name.");
    }

    if (!GROUP_NAME_PATTERN.matcher(groupName).matches()) {
      throw new BadRequestException(
          String.format("Group name:%s must match ^[A-Za-z0-9_-]{1,50}$.", groupName));
    }
    if (optimizerManager.getResourceGroup(groupName) != null) {
      throw new BadRequestException(
          String.format("Optimizer group:%s already existed.", groupName));
    }
  }
check if optimizerGroup can be deleted url = /optimize/containers/get
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/OptimizerGroupController.java