use of com.spotify.docker.client.exceptions.ServiceNotFoundException in project docker-client by spotify.
the class DefaultDockerClient method updateService.
@Override
public void updateService(final String serviceId, final Long version, final ServiceSpec spec, final RegistryAuth config) throws DockerException, InterruptedException {
assertApiVersionIsAbove("1.24");
try {
WebTarget resource = resource().path("services").path(serviceId).path("update");
resource = resource.queryParam("version", version);
request(POST, String.class, resource, resource.request(APPLICATION_JSON_TYPE).header("X-Registry-Auth", authHeader(config)), Entity.json(spec));
} catch (DockerRequestException e) {
switch(e.status()) {
case 404:
throw new ServiceNotFoundException(serviceId);
default:
throw e;
}
}
}
use of com.spotify.docker.client.exceptions.ServiceNotFoundException in project docker-client by spotify.
the class DefaultDockerClient method removeService.
@Override
public void removeService(final String serviceId) throws DockerException, InterruptedException {
assertApiVersionIsAbove("1.24");
try {
final WebTarget resource = resource().path("services").path(serviceId);
request(DELETE, resource, resource.request(APPLICATION_JSON_TYPE));
} catch (DockerRequestException e) {
switch(e.status()) {
case 404:
throw new ServiceNotFoundException(serviceId);
default:
throw e;
}
}
}
Aggregations