@GET public Collection<HostTypeBean> getAll( @QueryParam("pageIndex") Optional<Integer> pageIndex, @QueryParam("pageSize") Optional<Integer> pageSize) throws Exception { return hostTypeDAO.getAll(pageIndex.or(DEFAULT_INDEX), pageSize.or(DEFAULT_SIZE)); }
@GET @Path("/basic") public Collection<HostTypeBean> getByProviderAndBasic( @QueryParam("provider") String provider, @QueryParam("basic") Optional<Boolean> basic) throws Exception { return hostTypeDAO.getByProviderAndBasic(provider, basic.or(true)); }
@POST public void create(@Context SecurityContext sc, @Valid HostTypeBean bean) throws Exception { bean.setId(CommonUtils.getBase64UUID()); LOG.info(String.format("Create new host type %s", bean.toString())); hostTypeDAO.insert(bean); // TODO udpate clusters, deprecated old host type }