Skip to content

Commit 5dca65e

Browse files
Merge pull request #973 from TrekkieCoder/main
PR - External API control for manipulating end-point health
2 parents 45ddbab + 8d68708 commit 5dca65e

16 files changed

+1006
-6
lines changed

api/models/end_point_host_state.go

+59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/restapi/configure_loxilb_rest_api.go

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func configureAPI(api *operations.LoxilbRestAPIAPI) http.Handler {
159159
api.GetConfigEndpointAllHandler = operations.GetConfigEndpointAllHandlerFunc(handler.ConfigGetEndPoint)
160160
api.PostConfigEndpointHandler = operations.PostConfigEndpointHandlerFunc(handler.ConfigPostEndPoint)
161161
api.DeleteConfigEndpointEpipaddressIPAddressHandler = operations.DeleteConfigEndpointEpipaddressIPAddressHandlerFunc(handler.ConfigDeleteEndPoint)
162+
api.PostConfigEndpointhoststateHandler = operations.PostConfigEndpointhoststateHandlerFunc(handler.ConfigPostEndPointHostState)
162163

163164
// Params
164165
api.PostConfigParamsHandler = operations.PostConfigParamsHandlerFunc(handler.ConfigPostParams)

api/restapi/embedded_spec.go

+170
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/restapi/handler/endpoint.go

+16
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,19 @@ func ConfigDeleteEndPoint(params operations.DeleteConfigEndpointEpipaddressIPAdd
100100
}
101101
return &ResultResponse{Result: "Success"}
102102
}
103+
104+
func ConfigPostEndPointHostState(params operations.PostConfigEndpointhoststateParams, principal interface{}) middleware.Responder {
105+
tk.LogIt(tk.LogTrace, "api: EndPoint %s API called. url : %s\n", params.HTTPRequest.Method, params.HTTPRequest.URL)
106+
107+
EPHost := cmn.EndPointHostMod{}
108+
EPHost.HostName = params.Attr.HostName
109+
EPHost.EPPort = uint16(params.Attr.EpPort)
110+
EPHost.EPProto = params.Attr.EpProto
111+
EPHost.State = params.Attr.State
112+
113+
_, err := ApiHooks.NetEpHostStateSet(&EPHost)
114+
if err != nil {
115+
return &ResultResponse{Result: err.Error()}
116+
}
117+
return &ResultResponse{Result: "Success"}
118+
}

api/restapi/operations/loxilb_rest_api_api.go

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/restapi/operations/post_config_endpointhoststate.go

+71
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)