f-21: api coherence
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
649ca66bf9
commit
e939467abf
5 changed files with 43 additions and 17 deletions
|
|
@ -42,7 +42,11 @@ func (s *Server) getVpc(w http.ResponseWriter, _ *http.Request, name string) {
|
|||
func (s *Server) deleteVpc(w http.ResponseWriter, _ *http.Request, name string) {
|
||||
cmd := dispatcher.DeleteVPCCommand{Name: name}
|
||||
if err := s.dispatcher.Prepare(cmd); err != nil {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
if _, dbErr := kv.GetFromDB(s.db, "vpc/"+name+"/state"); dbErr != nil {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusConflict)
|
||||
}
|
||||
json.NewEncoder(w).Encode(ErrorResponse{Error: err.Error()})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue