@Test public void filterRegistries() throws Exception { test(set(DockerHubRegistry.DEFAULT_NAME, "test.registry"), "", "", set(DockerHubRegistry.DEFAULT_NAME)); test(set(DockerHubRegistry.DEFAULT_NAME, "test.registry"), "*", "", set(DockerHubRegistry.DEFAULT_NAME, "test.registry")); test(set("registry", "test.registry"), "", "", set()); test(set("registry", "test.registry"), null, "registry/image", set("registry")); }
static void filterRegistries(String registryParam, String query, Collection<String> registries) { if("*".equals(registryParam)) { return; } try { if (registryParam == null && query != null) { registryParam = ContainerUtils.getRegistryPrefix(query); } if (registryParam != null) { registries.retainAll(SPLITTER.splitToList(registryParam)); } } catch (Exception e) { } }
ImagesApi { static void filterRegistries(String registryParam, String query, Collection<String> registries) { if("*".equals(registryParam)) { return; } try { if (registryParam == null && query != null) { registryParam = ContainerUtils.getRegistryPrefix(query); } if (registryParam != null) { registries.retainAll(SPLITTER.splitToList(registryParam)); } } catch (Exception e) { } } }
ImagesApi { static void filterRegistries(String registryParam, String query, Collection<String> registries) { if("*".equals(registryParam)) { return; } try { if (registryParam == null && query != null) { registryParam = ContainerUtils.getRegistryPrefix(query); } if (registryParam != null) { registries.retainAll(SPLITTER.splitToList(registryParam)); } } catch (Exception e) { } }  }
ImagesApi { static void filterRegistries(String registryParam, String query, Collection<String> registries) { if("*".equals(registryParam)) { return; } try { if (registryParam == null && query != null) { registryParam = ContainerUtils.getRegistryPrefix(query); } if (registryParam != null) { registries.retainAll(SPLITTER.splitToList(registryParam)); } } catch (Exception e) { } }  @RequestMapping(value = "/clusters/{cluster}/list", method = RequestMethod.GET) List<ImageItem> getImages(@PathVariable("cluster") String cluster); @RequestMapping(value = "/clusters/{cluster}/deployed-list", method = RequestMethod.GET) Collection<UiDeployedImage> getDeployedImages(@PathVariable("cluster") String cluster); @ApiOperation("search by image substring, if you specify repository then you can use expression like '*word*' ") @RequestMapping(value = "/search", method = RequestMethod.GET) UiSearchResult search(@RequestParam(value = "registry", required = false) String registryParam,
                                 @RequestParam(value = "cluster", required = false) String cluster,
                                 @RequestParam(value = "query", required = false) String query,
                                 @RequestParam(value = "page") int page,
                                 @RequestParam(value = "size") int size); @RequestMapping(value = "/image", method = RequestMethod.GET) ImageDescriptor getImage(@RequestParam("fullImageName") String fullImageName); @RequestMapping(value = "/clusters/{cluster}/tag", method = RequestMethod.PUT) ResponseEntity<?> createTag(@PathVariable("cluster") String cluster,
                                       @RequestParam(value = "imageName") String imageName,
                                       @RequestParam(value = "currentTag", defaultValue = "latest") String currentTag,
                                       @RequestParam(value = "newTag") String newTag,
                                       @RequestParam(value = "repository") String repository,
                                       @RequestParam(value = "force", required = false, defaultValue = "false") Boolean force); @ApiOperation("get tags, filter expression is SpEL cluster image filter") @RequestMapping(value = "/tags", method = GET) @Cacheable("TagsList") @DefineCache(expireAfterWrite = 60_000) List<String> listTags(@RequestParam("imageName") String imageName,
                                 @RequestParam(value = "filter", required = false) String filter,
                                 @RequestParam(value = "cluster", required = false) String cluster); @ApiOperation("get tags catalog (contains additional information), filter expression is SpEL cluster image filter") @RequestMapping(value = "/tags-detailed", method = GET) @Cacheable("UiImageCatalog") @DefineCache(expireAfterWrite = 60_000) List<UiTagCatalog> listTagsDetailed(@RequestParam("imageName") String imageName,
                                               @RequestParam(value = "filter", required = false) String filter,
                                               @RequestParam(value = "cluster", required = false) String cluster); @ApiOperation("get images catalogs, filter expression is SpEL cluster image filter") @RequestMapping(value = "/", method = GET) @Cacheable("UiImageCatalog") @DefineCache(expireAfterWrite = 60_000) List<UiImageCatalog> listImageCatalogs(@RequestParam(value = "filter", required = false) String filterStr,
                                                  @RequestParam(value = "cluster", required = false) String cluster); }
ImagesApi { static void filterRegistries(String registryParam, String query, Collection<String> registries) { if("*".equals(registryParam)) { return; } try { if (registryParam == null && query != null) { registryParam = ContainerUtils.getRegistryPrefix(query); } if (registryParam != null) { registries.retainAll(SPLITTER.splitToList(registryParam)); } } catch (Exception e) { } }  @RequestMapping(value = "/clusters/{cluster}/list", method = RequestMethod.GET) List<ImageItem> getImages(@PathVariable("cluster") String cluster); @RequestMapping(value = "/clusters/{cluster}/deployed-list", method = RequestMethod.GET) Collection<UiDeployedImage> getDeployedImages(@PathVariable("cluster") String cluster); @ApiOperation("search by image substring, if you specify repository then you can use expression like '*word*' ") @RequestMapping(value = "/search", method = RequestMethod.GET) UiSearchResult search(@RequestParam(value = "registry", required = false) String registryParam,
                                 @RequestParam(value = "cluster", required = false) String cluster,
                                 @RequestParam(value = "query", required = false) String query,
                                 @RequestParam(value = "page") int page,
                                 @RequestParam(value = "size") int size); @RequestMapping(value = "/image", method = RequestMethod.GET) ImageDescriptor getImage(@RequestParam("fullImageName") String fullImageName); @RequestMapping(value = "/clusters/{cluster}/tag", method = RequestMethod.PUT) ResponseEntity<?> createTag(@PathVariable("cluster") String cluster,
                                       @RequestParam(value = "imageName") String imageName,
                                       @RequestParam(value = "currentTag", defaultValue = "latest") String currentTag,
                                       @RequestParam(value = "newTag") String newTag,
                                       @RequestParam(value = "repository") String repository,
                                       @RequestParam(value = "force", required = false, defaultValue = "false") Boolean force); @ApiOperation("get tags, filter expression is SpEL cluster image filter") @RequestMapping(value = "/tags", method = GET) @Cacheable("TagsList") @DefineCache(expireAfterWrite = 60_000) List<String> listTags(@RequestParam("imageName") String imageName,
                                 @RequestParam(value = "filter", required = false) String filter,
                                 @RequestParam(value = "cluster", required = false) String cluster); @ApiOperation("get tags catalog (contains additional information), filter expression is SpEL cluster image filter") @RequestMapping(value = "/tags-detailed", method = GET) @Cacheable("UiImageCatalog") @DefineCache(expireAfterWrite = 60_000) List<UiTagCatalog> listTagsDetailed(@RequestParam("imageName") String imageName,
                                               @RequestParam(value = "filter", required = false) String filter,
                                               @RequestParam(value = "cluster", required = false) String cluster); @ApiOperation("get images catalogs, filter expression is SpEL cluster image filter") @RequestMapping(value = "/", method = GET) @Cacheable("UiImageCatalog") @DefineCache(expireAfterWrite = 60_000) List<UiImageCatalog> listImageCatalogs(@RequestParam(value = "filter", required = false) String filterStr,
                                                  @RequestParam(value = "cluster", required = false) String cluster);  }