use of com.bluenimble.platform.api.ApiServicesManagerException in project serverless by bluenimble.
the class DefaultApiServicesManager method delete.
@Override
public void delete(ApiVerb verb, String endpoint) throws ApiServicesManagerException {
ApiServiceSet set = services.get(verb);
if (set == null) {
throw new ApiServicesManagerException("service [" + verb + " " + endpoint + "] not found");
}
ApiService service = set.get(endpoint);
if (service == null) {
throw new ApiServicesManagerException("service [" + verb + " " + endpoint + "] not found");
}
if (!ApiStatus.Failed.equals(service.status()) && !ApiStatus.Stopped.equals(service.status())) {
throw new ApiServicesManagerException("can't delete service [" + verb + " " + endpoint + "]. Status=" + service.status());
}
set.remove(endpoint);
}
Aggregations