All checks were successful
Pre Release Workflow / set-release-target (push) Successful in 1s
Pre Release Workflow / build (agent, amd64, linux) (push) Successful in 2m2s
Pre Release Workflow / build (db, amd64, linux) (push) Successful in 1m32s
Pre Release Workflow / build (dhcp, amd64, linux) (push) Successful in 1m32s
Pre Release Workflow / build (metadata, amd64, linux) (push) Successful in 1m33s
Pre Release Workflow / build (metacli, amd64, linux) (push) Successful in 1m40s
Pre Release Workflow / build (subnet, amd64, linux) (push) Successful in 1m37s
Pre Release Workflow / prerelease (push) Successful in 16s
Pre Release Workflow / build (vpc, amd64, linux) (push) Successful in 1m34s
Pre Release Workflow / upload-scripts (run-dnsmasq-in-netns.sh) (push) Successful in 7s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
24 lines
517 B
Go
24 lines
517 B
Go
package agentapi
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func (s *Server) 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:
|
|
s.queue.Submit(func() {
|
|
createSubnet()
|
|
})
|
|
w.WriteHeader(http.StatusAccepted)
|
|
default:
|
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
|
}
|
|
}
|
|
|
|
func createSubnet() {}
|