mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-11 23:54:22 +08:00
* feat(go): add deprecation warning. * feat(go): add support for gateway commands. * feat(go): mention the server version in which the commands were deprecated.
18 lines
603 B
Go
18 lines
603 B
Go
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)
|
|
}
|