mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
Extclient NET-63x (#2286)
* model changes * additional fields for extclient create * add DNS to extclient config * extclient name checks * update extclient * nmctl extclient * final tweaks * review comments * add extclientdns to node on ingress creation * fix to add ingress dns to api (#2296) --------- Co-authored-by: Aceix <aceixsmartX@gmail.com>
This commit is contained in:
@@ -28,14 +28,8 @@ func GetExtClientConfig(networkName, clientID string) string {
|
||||
}
|
||||
|
||||
// CreateExtClient - create an external client
|
||||
func CreateExtClient(networkName, nodeID, extClientID string) {
|
||||
if extClientID != "" {
|
||||
request[any](http.MethodPost, fmt.Sprintf("/api/extclients/%s/%s", networkName, nodeID), &models.CustomExtClient{
|
||||
ClientID: extClientID,
|
||||
})
|
||||
} else {
|
||||
request[any](http.MethodPost, fmt.Sprintf("/api/extclients/%s/%s", networkName, nodeID), nil)
|
||||
}
|
||||
func CreateExtClient(networkName, nodeID string, extClient models.CustomExtClient) {
|
||||
request[any](http.MethodPost, fmt.Sprintf("/api/extclients/%s/%s", networkName, nodeID), extClient)
|
||||
}
|
||||
|
||||
// DeleteExtClient - delete an external client
|
||||
@@ -44,6 +38,6 @@ func DeleteExtClient(networkName, clientID string) *models.SuccessResponse {
|
||||
}
|
||||
|
||||
// UpdateExtClient - update an external client
|
||||
func UpdateExtClient(networkName, clientID string, payload *models.ExtClient) *models.ExtClient {
|
||||
func UpdateExtClient(networkName, clientID string, payload *models.CustomExtClient) *models.ExtClient {
|
||||
return request[models.ExtClient](http.MethodPut, fmt.Sprintf("/api/extclients/%s/%s", networkName, clientID), payload)
|
||||
}
|
||||
|
Reference in New Issue
Block a user