This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from lpabon/restapp
Start of GlusterFS Application
- Loading branch information
Showing
29 changed files
with
382 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
github.com/codegangsta/negroni c7477ad8e330bef55bf1ebe300cf8aa67c492d1b | ||
github.com/gorilla/context 215affda49addc4c8ef7e2534915df2c8c35c6cd | ||
github.com/gorilla/mux 47e8f450ef38c857cdd922ec08862ca9d65a1c6d | ||
github.com/lpabon/godbc 9577782540c1398b710ddae1b86268ba03a19b0c | ||
golang.org/x/crypto 1e856cbfdf9bc25eefca75f83f25d55e35ae72e0 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Location for applications for Heketi | ||
package apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// | ||
// Copyright (c) 2015 The heketi Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
package glusterfs | ||
|
||
import ( | ||
"fmt" | ||
"github.com/heketi/heketi/rest" | ||
"net/http" | ||
) | ||
|
||
type App struct { | ||
hello string | ||
} | ||
|
||
func NewApp() *App { | ||
return &App{} | ||
} | ||
|
||
// Interface rest.App | ||
func (a *App) GetRoutes() rest.Routes { | ||
|
||
return rest.Routes{ | ||
|
||
// HelloWorld | ||
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 | ||
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}, | ||
} | ||
} | ||
|
||
func (a *App) Close() { | ||
|
||
} | ||
|
||
func (a *App) Hello(w http.ResponseWriter, r *http.Request) { | ||
w.Header().Set("Content-Type", "text/plain; charset=UTF-8") | ||
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) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Copyright (c) 2015 The heketi Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
package rest | ||
|
||
type Application interface { | ||
GetRoutes() Routes | ||
Close() | ||
} |
Oops, something went wrong.