mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-10 09:32:32 +08:00
removed remove network
This commit is contained in:
parent
7ac9d1d307
commit
d19cac35fa
2 changed files with 0 additions and 41 deletions
|
@ -50,36 +50,6 @@ func allowUsers(next http.Handler) http.HandlerFunc {
|
|||
}
|
||||
}
|
||||
|
||||
// swagger:route DELETE /api/server/removenetwork/{network} server removeNetwork
|
||||
//
|
||||
// Remove a network from the server.
|
||||
//
|
||||
// Schemes: https
|
||||
//
|
||||
// Security:
|
||||
// oauth
|
||||
//
|
||||
// Responses:
|
||||
// 200: stringJSONResponse
|
||||
func removeNetwork(w http.ResponseWriter, r *http.Request) {
|
||||
// Set header
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
// get params
|
||||
var params = mux.Vars(r)
|
||||
network := params["network"]
|
||||
err := logic.DeleteNetwork(network)
|
||||
if err != nil {
|
||||
logger.Log(0, r.Header.Get("user"),
|
||||
fmt.Sprintf("failed to delete network [%s]: %v", network, err))
|
||||
json.NewEncoder(w).Encode(fmt.Sprintf("could not remove network %s from server", network))
|
||||
return
|
||||
}
|
||||
logger.Log(1, r.Header.Get("user"),
|
||||
fmt.Sprintf("deleted network [%s]: %v", network, err))
|
||||
json.NewEncoder(w).Encode(fmt.Sprintf("network %s removed from server", network))
|
||||
}
|
||||
|
||||
// swagger:route GET /api/server/getserverinfo server getServerInfo
|
||||
//
|
||||
// Get the server configuration.
|
||||
|
|
11
swagger.yaml
11
swagger.yaml
|
@ -1661,17 +1661,6 @@ paths:
|
|||
summary: Registers a client with the server and return the Certificate Authority and certificate.
|
||||
tags:
|
||||
- server
|
||||
/api/server/removenetwork/{network}:
|
||||
delete:
|
||||
operationId: removeNetwork
|
||||
responses:
|
||||
"200":
|
||||
$ref: '#/responses/stringJSONResponse'
|
||||
schemes:
|
||||
- https
|
||||
summary: Remove a network from the server.
|
||||
tags:
|
||||
- server
|
||||
/api/users:
|
||||
get:
|
||||
operationId: getUsers
|
||||
|
|
Loading…
Reference in a new issue