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:
Matthew R Kasun
2023-05-17 10:58:03 -04:00
committed by GitHub
parent 058533db3f
commit 78640f1342
17 changed files with 202 additions and 117 deletions

View File

@@ -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)
}