mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-13 04:54:48 +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
|
// swagger:route GET /api/server/getserverinfo server getServerInfo
|
||||||
//
|
//
|
||||||
// Get the server configuration.
|
// 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.
|
summary: Registers a client with the server and return the Certificate Authority and certificate.
|
||||||
tags:
|
tags:
|
||||||
- server
|
- 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:
|
/api/users:
|
||||||
get:
|
get:
|
||||||
operationId: getUsers
|
operationId: getUsers
|
||||||
|
|
Loading…
Reference in a new issue