Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Scaffolding for Heketi API
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Pabón committed Jul 2, 2015
1 parent e37fb51 commit 47611fe
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions apps/glusterfs/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,27 @@ func (a *App) GetRoutes() rest.Routes {
rest.Route{"Hello", "GET", "/hello", a.Hello},

// Cluster
rest.Route{"ClusterCreate", "POST", "/clusters", a.NotImplemented},
rest.Route{"ClusterInfo", "GET", "/clusters/{id:[A-Fa-f0-9]+}", a.NotImplemented},
rest.Route{"ClusterList", "GET", "/clusters", a.NotImplemented},
rest.Route{"ClusterDelete", "DELETE", "/clusters/{id:[A-Fa-f0-9]+}", a.NotImplemented},

// Node
/*
Route{"NodeList", "GET", "/nodes", n.NodeListHandler},
Route{"NodeAdd", "POST", "/nodes", n.NodeAddHandler},
Route{"NodeInfo", "GET", "/nodes/{id:[A-Fa-f0-9]+}", n.NodeInfoHandler},
Route{"NodeDelete", "DELETE", "/nodes/{id:[A-Fa-f0-9]+}", n.NodeDeleteHandler},
Route{"NodeAddDevice", "POST", "/nodes/{id:[A-Fa-f0-9]+}/devices", n.NodeAddDeviceHandler},
//Route{"NodeDeleteDevice", "DELETE", "/nodes/{id:[A-Fa-f0-9]+}/devices/{devid:[A-Fa-f0-9]+}", n.NodeDeleteDeviceHandler},
*/
rest.Route{"NodeAdd", "POST", "/nodes", a.NotImplemented},
rest.Route{"NodeInfo", "GET", "/nodes/{id:[A-Fa-f0-9]+}", a.NotImplemented},
rest.Route{"NodeDelete", "DELETE", "/nodes/{id:[A-Fa-f0-9]+}", a.NotImplemented},

// Devices
rest.Route{"DeviceAdd", "POST", "/devices", a.NotImplemented},
rest.Route{"DeviceInfo", "GET", "/devices/{id:[A-Fa-f0-9]+}", a.NotImplemented},
rest.Route{"DeviceDelete", "DELETE", "/devices/{id:[A-Fa-f0-9]+}", a.NotImplemented},

// Volume
rest.Route{"VolumeCreate", "POST", "/volumes", a.NotImplemented},
rest.Route{"VolumeInfo", "GET", "/volumes/{id:[A-Fa-f0-9]+}", a.NotImplemented},
rest.Route{"VolumeExpand", "POST", "/volumes/{id:[A-Fa-f0-9]+}/expand", a.NotImplemented},
rest.Route{"VolumeDelete", "DELETE", "/volumes/{id:[A-Fa-f0-9]+}", a.NotImplemented},
rest.Route{"VolumeList", "GET", "/volumes", a.NotImplemented},
}
}

Expand All @@ -63,3 +72,7 @@ func (a *App) Hello(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprint(w, "HelloWorld from GlusterFS Application")
}

func (a *App) NotImplemented(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Function not yet supported", http.StatusNotImplemented)
}

0 comments on commit 47611fe

Please sign in to comment.