f-21: add first api file
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
565428b8de
commit
bcedeece18
5 changed files with 104 additions and 0 deletions
19
internal/api/agent/subnets.go
Normal file
19
internal/api/agent/subnets.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package agentapi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func SubnetsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
w.WriteHeader(http.StatusOK)
|
||||
json.NewEncoder(w).Encode([]interface{}{})
|
||||
case http.MethodPost:
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
default:
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue