use of com.epam.pipeline.entity.docker.RegistryListing in project cloud-pipeline by epam.
the class DockerClient method getRegistryEntries.
public Set<String> getRegistryEntries() {
try {
URI uri = new URI(String.format(LIST_REGISTRY_URL, hostName));
HttpEntity entity = getAuthHeaders();
ResponseEntity<RegistryListing> response = getRestTemplate().exchange(uri, HttpMethod.GET, entity, new ParameterizedTypeReference<RegistryListing>() {
});
if (response.getStatusCode() == HttpStatus.OK) {
return response.getBody().getRepositories();
} else {
throw new UnexpectedResponseStatusException(response.getStatusCode());
}
} catch (URISyntaxException | UnexpectedResponseStatusException e) {
LOGGER.error(e.getMessage(), e);
return Collections.emptySet();
}
}
Aggregations