mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
NET-1962: add gateway subcommand. (#3339)
* feat(go): add deprecation warning. * feat(go): add support for gateway commands. * feat(go): mention the server version in which the commands were deprecated.
This commit is contained in:
18
cli/functions/gateway.go
Normal file
18
cli/functions/gateway.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package functions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gravitl/netmaker/models"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func CreateGateway(ingressRequest models.IngressRequest, relayRequest models.RelayRequest) *models.ApiNode {
|
||||
return request[models.ApiNode](http.MethodPost, fmt.Sprintf("/api/nodes/%s/%s/gateway", relayRequest.NetID, relayRequest.NodeID), &models.CreateGwReq{
|
||||
IngressRequest: ingressRequest,
|
||||
RelayRequest: relayRequest,
|
||||
})
|
||||
}
|
||||
|
||||
func DeleteGateway(networkID, nodeID string) *models.ApiNode {
|
||||
return request[models.ApiNode](http.MethodDelete, fmt.Sprintf("/api/nodes/%s/%s/gateway", networkID, nodeID), nil)
|
||||
}
|
Reference in New Issue
Block a user