diff --git a/api/models/loadbalance_entry.go b/api/models/loadbalance_entry.go index 2921da163..73bce189d 100644 --- a/api/models/loadbalance_entry.go +++ b/api/models/loadbalance_entry.go @@ -318,6 +318,9 @@ type LoadbalanceEntryServiceArguments struct { // IP address for externel access ExternalIP string `json:"externalIP,omitempty"` + // Ingress specific host URL path + Host string `json:"host,omitempty"` + // value for inactivity timeout (in seconds) InactiveTimeOut int32 `json:"inactiveTimeOut,omitempty"` @@ -336,9 +339,6 @@ type LoadbalanceEntryServiceArguments struct { // end-point specific op (0-create, 1-attachEP, 2-detachEP) Oper int32 `json:"oper,omitempty"` - // Ingress specific URL path - Path string `json:"path,omitempty"` - // port number for the access Port int64 `json:"port,omitempty"` diff --git a/api/restapi/configure_loxilb_rest_api.go b/api/restapi/configure_loxilb_rest_api.go index 1f1450cf0..8d2735c45 100644 --- a/api/restapi/configure_loxilb_rest_api.go +++ b/api/restapi/configure_loxilb_rest_api.go @@ -60,7 +60,7 @@ func configureAPI(api *operations.LoxilbRestAPIAPI) http.Handler { // Load balancer add and delete and get api.PostConfigLoadbalancerHandler = operations.PostConfigLoadbalancerHandlerFunc(handler.ConfigPostLoadbalancer) - api.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancer) + api.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancer) api.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancerWithoutPath) api.GetConfigLoadbalancerAllHandler = operations.GetConfigLoadbalancerAllHandlerFunc(handler.ConfigGetLoadbalancer) api.DeleteConfigLoadbalancerAllHandler = operations.DeleteConfigLoadbalancerAllHandlerFunc(handler.ConfigDeleteAllLoadbalancer) diff --git a/api/restapi/embedded_spec.go b/api/restapi/embedded_spec.go index 248fe3775..12c96930c 100644 --- a/api/restapi/embedded_spec.go +++ b/api/restapi/embedded_spec.go @@ -2124,17 +2124,50 @@ func init() { } } }, - "/config/loadbalancer/name/{lb_name}": { + "/config/loadbalancer/hosturl/{hosturl}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}": { "delete": { - "description": "Delete an existing load balancer service with name.", + "description": "Delete an existing load balancer service with .", "summary": "Delete an existing Load balancer service", "parameters": [ { "type": "string", - "description": "Attributes for load balance service name", - "name": "lb_name", + "description": "Attributes for load balance service", + "name": "hosturl", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Attributes for load balance service", + "name": "ip_address", + "in": "path", + "required": true + }, + { + "type": "number", + "description": "Attributes for load balance service", + "name": "port", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Attributes for load balance service", + "name": "proto", "in": "path", "required": true + }, + { + "type": "boolean", + "description": "option for BGP enable", + "name": "bgp", + "in": "query" + }, + { + "type": "number", + "description": "block value if any", + "name": "block", + "in": "query" } ], "responses": { @@ -2186,50 +2219,17 @@ func init() { } } }, - "/config/loadbalancer/urlpath/{urlpath}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}": { + "/config/loadbalancer/name/{lb_name}": { "delete": { - "description": "Delete an existing load balancer service with .", + "description": "Delete an existing load balancer service with name.", "summary": "Delete an existing Load balancer service", "parameters": [ { "type": "string", - "description": "Attributes for load balance service", - "name": "urlpath", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Attributes for load balance service", - "name": "ip_address", - "in": "path", - "required": true - }, - { - "type": "number", - "description": "Attributes for load balance service", - "name": "port", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Attributes for load balance service", - "name": "proto", + "description": "Attributes for load balance service name", + "name": "lb_name", "in": "path", "required": true - }, - { - "type": "boolean", - "description": "option for BGP enable", - "name": "bgp", - "in": "query" - }, - { - "type": "number", - "description": "block value if any", - "name": "block", - "in": "query" } ], "responses": { @@ -5018,6 +5018,10 @@ func init() { "description": "IP address for externel access", "type": "string" }, + "host": { + "description": "Ingress specific host URL path", + "type": "string" + }, "inactiveTimeOut": { "description": "value for inactivity timeout (in seconds)", "type": "integer", @@ -5045,10 +5049,6 @@ func init() { "type": "integer", "format": "int32" }, - "path": { - "description": "Ingress specific URL path", - "type": "string" - }, "port": { "description": "port number for the access", "type": "integer" @@ -7831,17 +7831,50 @@ func init() { } } }, - "/config/loadbalancer/name/{lb_name}": { + "/config/loadbalancer/hosturl/{hosturl}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}": { "delete": { - "description": "Delete an existing load balancer service with name.", + "description": "Delete an existing load balancer service with .", "summary": "Delete an existing Load balancer service", "parameters": [ { "type": "string", - "description": "Attributes for load balance service name", - "name": "lb_name", + "description": "Attributes for load balance service", + "name": "hosturl", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Attributes for load balance service", + "name": "ip_address", + "in": "path", + "required": true + }, + { + "type": "number", + "description": "Attributes for load balance service", + "name": "port", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Attributes for load balance service", + "name": "proto", "in": "path", "required": true + }, + { + "type": "boolean", + "description": "option for BGP enable", + "name": "bgp", + "in": "query" + }, + { + "type": "number", + "description": "block value if any", + "name": "block", + "in": "query" } ], "responses": { @@ -7893,50 +7926,17 @@ func init() { } } }, - "/config/loadbalancer/urlpath/{urlpath}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}": { + "/config/loadbalancer/name/{lb_name}": { "delete": { - "description": "Delete an existing load balancer service with .", + "description": "Delete an existing load balancer service with name.", "summary": "Delete an existing Load balancer service", "parameters": [ { "type": "string", - "description": "Attributes for load balance service", - "name": "urlpath", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Attributes for load balance service", - "name": "ip_address", - "in": "path", - "required": true - }, - { - "type": "number", - "description": "Attributes for load balance service", - "name": "port", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Attributes for load balance service", - "name": "proto", + "description": "Attributes for load balance service name", + "name": "lb_name", "in": "path", "required": true - }, - { - "type": "boolean", - "description": "option for BGP enable", - "name": "bgp", - "in": "query" - }, - { - "type": "number", - "description": "block value if any", - "name": "block", - "in": "query" } ], "responses": { @@ -11154,6 +11154,10 @@ func init() { "description": "IP address for externel access", "type": "string" }, + "host": { + "description": "Ingress specific host URL path", + "type": "string" + }, "inactiveTimeOut": { "description": "value for inactivity timeout (in seconds)", "type": "integer", @@ -11181,10 +11185,6 @@ func init() { "type": "integer", "format": "int32" }, - "path": { - "description": "Ingress specific URL path", - "type": "string" - }, "port": { "description": "port number for the access", "type": "integer" @@ -11285,6 +11285,10 @@ func init() { "description": "IP address for externel access", "type": "string" }, + "host": { + "description": "Ingress specific host URL path", + "type": "string" + }, "inactiveTimeOut": { "description": "value for inactivity timeout (in seconds)", "type": "integer", @@ -11312,10 +11316,6 @@ func init() { "type": "integer", "format": "int32" }, - "path": { - "description": "Ingress specific URL path", - "type": "string" - }, "port": { "description": "port number for the access", "type": "integer" diff --git a/api/restapi/handler/loadbalancer.go b/api/restapi/handler/loadbalancer.go index f40daca8d..22a21a267 100644 --- a/api/restapi/handler/loadbalancer.go +++ b/api/restapi/handler/loadbalancer.go @@ -47,7 +47,7 @@ func ConfigPostLoadbalancer(params operations.PostConfigLoadbalancerParams) midd lbRules.Serv.ProbeRetries = int(params.Attr.ServiceArguments.ProbeRetries) lbRules.Serv.Name = params.Attr.ServiceArguments.Name lbRules.Serv.Oper = cmn.LBOp(params.Attr.ServiceArguments.Oper) - lbRules.Serv.Path = params.Attr.ServiceArguments.Path + lbRules.Serv.HostUrl = params.Attr.ServiceArguments.Host if lbRules.Serv.Proto == "sctp" { for _, data := range params.Attr.SecondaryIPs { @@ -78,7 +78,7 @@ func ConfigPostLoadbalancer(params operations.PostConfigLoadbalancerParams) midd return &ResultResponse{Result: "Success"} } -func ConfigDeleteLoadbalancer(params operations.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { +func ConfigDeleteLoadbalancer(params operations.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { tk.LogIt(tk.LogDebug, "[API] Load balancer %s API called. url : %s\n", params.HTTPRequest.Method, params.HTTPRequest.URL) var lbServ cmn.LbServiceArg @@ -86,10 +86,10 @@ func ConfigDeleteLoadbalancer(params operations.DeleteConfigLoadbalancerUrlpathU lbServ.ServIP = params.IPAddress lbServ.ServPort = uint16(params.Port) lbServ.Proto = params.Proto - if params.Urlpath == "any" { - lbServ.Path = "" + if params.Hosturl == "any" { + lbServ.HostUrl = "" } else { - lbServ.Path = params.Urlpath + lbServ.HostUrl = params.Hosturl } if params.Block != nil { lbServ.BlockNum = uint16(*params.Block) @@ -116,7 +116,7 @@ func ConfigDeleteLoadbalancerWithoutPath(params operations.DeleteConfigLoadbalan lbServ.ServIP = params.IPAddress lbServ.ServPort = uint16(params.Port) lbServ.Proto = params.Proto - lbServ.Path = "" + lbServ.HostUrl = "" if params.Block != nil { lbServ.BlockNum = uint16(*params.Block) } @@ -165,7 +165,7 @@ func ConfigGetLoadbalancer(params operations.GetConfigLoadbalancerAllParams) mid tmpSvc.Probeport = lb.Serv.ProbePort tmpSvc.Name = lb.Serv.Name tmpSvc.Snat = lb.Serv.Snat - tmpSvc.Path = lb.Serv.Path + tmpSvc.Host = lb.Serv.HostUrl tmpLB.ServiceArguments = &tmpSvc diff --git a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto.go b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto.go similarity index 55% rename from api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto.go rename to api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto.go index 7a3bdddf3..d8f7773b1 100644 --- a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto.go +++ b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto.go @@ -11,42 +11,42 @@ import ( "github.com/go-openapi/runtime/middleware" ) -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc turns a function with the right signature into a delete config loadbalancer urlpath urlpath externalipaddress IP address port port protocol proto handler -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc func(DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc turns a function with the right signature into a delete config loadbalancer hosturl hosturl externalipaddress IP address port port protocol proto handler +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc func(DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder // Handle executing the request and returning a response -func (fn DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc) Handle(params DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { +func (fn DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc) Handle(params DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { return fn(params) } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler interface for that can handle valid delete config loadbalancer urlpath urlpath externalipaddress IP address port port protocol proto params -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler interface { - Handle(DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler interface for that can handle valid delete config loadbalancer hosturl hosturl externalipaddress IP address port port protocol proto params +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler interface { + Handle(DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto creates a new http.Handler for the delete config loadbalancer urlpath urlpath externalipaddress IP address port port protocol proto operation -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto(ctx *middleware.Context, handler DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto{Context: ctx, Handler: handler} +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto creates a new http.Handler for the delete config loadbalancer hosturl hosturl externalipaddress IP address port port protocol proto operation +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto(ctx *middleware.Context, handler DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto { + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto{Context: ctx, Handler: handler} } /* - DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto swagger:route DELETE /config/loadbalancer/urlpath/{urlpath}/externalipaddress/{ip_address}/port/{port}/protocol/{proto} deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProto + DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto swagger:route DELETE /config/loadbalancer/hosturl/{hosturl}/externalipaddress/{ip_address}/port/{port}/protocol/{proto} deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProto # Delete an existing Load balancer service Delete an existing load balancer service with . */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto struct { Context *middleware.Context - Handler DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler + Handler DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler } -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto) ServeHTTP(rw http.ResponseWriter, r *http.Request) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { *r = *rCtx } - var Params = NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams() + var Params = NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams() if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params o.Context.Respond(rw, r, route.Produces, route, err) return diff --git a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_parameters.go b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_parameters.go similarity index 78% rename from api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_parameters.go rename to api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_parameters.go index dcc2939f9..4caef334e 100644 --- a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_parameters.go +++ b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_parameters.go @@ -15,19 +15,19 @@ import ( "github.com/go-openapi/swag" ) -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams creates a new DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams object +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams creates a new DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams object // // There are no default values defined in the spec. -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams() DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams { +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams() DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams { - return DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams{} + return DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams{} } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams contains all the bound params for the delete config loadbalancer urlpath urlpath externalipaddress IP address port port protocol proto operation +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams contains all the bound params for the delete config loadbalancer hosturl hosturl externalipaddress IP address port port protocol proto operation // typically these are obtained from a http.Request // -// swagger:parameters DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams struct { +// swagger:parameters DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` @@ -44,29 +44,29 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Required: true In: path */ - IPAddress string + Hosturl string /*Attributes for load balance service Required: true In: path */ - Port float64 + IPAddress string /*Attributes for load balance service Required: true In: path */ - Proto string + Port float64 /*Attributes for load balance service Required: true In: path */ - Urlpath string + Proto string } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface // for simple values it will use straight method calls. // -// To ensure default values, the struct must have been initialized with NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams() beforehand. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { +// To ensure default values, the struct must have been initialized with NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams() beforehand. +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { var res []error o.HTTPRequest = r @@ -83,6 +83,11 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor res = append(res, err) } + rHosturl, rhkHosturl, _ := route.Params.GetOK("hosturl") + if err := o.bindHosturl(rHosturl, rhkHosturl, route.Formats); err != nil { + res = append(res, err) + } + rIPAddress, rhkIPAddress, _ := route.Params.GetOK("ip_address") if err := o.bindIPAddress(rIPAddress, rhkIPAddress, route.Formats); err != nil { res = append(res, err) @@ -97,11 +102,6 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor if err := o.bindProto(rProto, rhkProto, route.Formats); err != nil { res = append(res, err) } - - rUrlpath, rhkUrlpath, _ := route.Params.GetOK("urlpath") - if err := o.bindUrlpath(rUrlpath, rhkUrlpath, route.Formats); err != nil { - res = append(res, err) - } if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -109,7 +109,7 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } // bindBgp binds and validates parameter Bgp from query. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) bindBgp(rawData []string, hasKey bool, formats strfmt.Registry) error { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) bindBgp(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -132,7 +132,7 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } // bindBlock binds and validates parameter Block from query. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) bindBlock(rawData []string, hasKey bool, formats strfmt.Registry) error { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) bindBlock(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -154,8 +154,8 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor return nil } -// bindIPAddress binds and validates parameter IPAddress from path. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) bindIPAddress(rawData []string, hasKey bool, formats strfmt.Registry) error { +// bindHosturl binds and validates parameter Hosturl from path. +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) bindHosturl(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -163,13 +163,13 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor // Required: true // Parameter is provided by construction from the route - o.IPAddress = raw + o.Hosturl = raw return nil } -// bindPort binds and validates parameter Port from path. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) bindPort(rawData []string, hasKey bool, formats strfmt.Registry) error { +// bindIPAddress binds and validates parameter IPAddress from path. +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) bindIPAddress(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -177,18 +177,13 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor // Required: true // Parameter is provided by construction from the route - - value, err := swag.ConvertFloat64(raw) - if err != nil { - return errors.InvalidType("port", "path", "float64", raw) - } - o.Port = value + o.IPAddress = raw return nil } -// bindProto binds and validates parameter Proto from path. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) bindProto(rawData []string, hasKey bool, formats strfmt.Registry) error { +// bindPort binds and validates parameter Port from path. +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) bindPort(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -196,13 +191,18 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor // Required: true // Parameter is provided by construction from the route - o.Proto = raw + + value, err := swag.ConvertFloat64(raw) + if err != nil { + return errors.InvalidType("port", "path", "float64", raw) + } + o.Port = value return nil } -// bindUrlpath binds and validates parameter Urlpath from path. -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) bindUrlpath(rawData []string, hasKey bool, formats strfmt.Registry) error { +// bindProto binds and validates parameter Proto from path. +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) bindProto(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] @@ -210,7 +210,7 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor // Required: true // Parameter is provided by construction from the route - o.Urlpath = raw + o.Proto = raw return nil } diff --git a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_responses.go b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_responses.go similarity index 56% rename from api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_responses.go rename to api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_responses.go index 7a9fd307f..682cbbf72 100644 --- a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_responses.go +++ b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_responses.go @@ -13,40 +13,40 @@ import ( "github.com/loxilb-io/loxilb/api/models" ) -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContentCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContentCode int = 204 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContentCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContentCode int = 204 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent OK +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent OK -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoNoContent +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoNoContent */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent struct { } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent{} } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses rw.WriteHeader(204) } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequestCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequestCode int = 400 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequestCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequestCode int = 400 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest Malformed arguments for API call +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest Malformed arguments for API call -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoBadRequest +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoBadRequest */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest struct { /* In: Body @@ -54,25 +54,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto bad request response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto bad request response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto bad request response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto bad request response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(400) if o.Payload != nil { @@ -83,15 +83,15 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorizedCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorizedCode int = 401 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorizedCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorizedCode int = 401 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized Invalid authentication credentials +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized Invalid authentication credentials -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoUnauthorized +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoUnauthorized */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized struct { /* In: Body @@ -99,25 +99,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto unauthorized response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto unauthorized response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto unauthorized response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto unauthorized response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(401) if o.Payload != nil { @@ -128,15 +128,15 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbiddenCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbiddenCode int = 403 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbiddenCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbiddenCode int = 403 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden Capacity insufficient +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden Capacity insufficient -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoForbidden +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoForbidden */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden struct { /* In: Body @@ -144,25 +144,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto forbidden response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto forbidden response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto forbidden response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto forbidden response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(403) if o.Payload != nil { @@ -173,15 +173,15 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFoundCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFoundCode int = 404 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFoundCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFoundCode int = 404 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound Resource not found +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound Resource not found -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoNotFound +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoNotFound */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound struct { /* In: Body @@ -189,25 +189,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto not found response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto not found response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto not found response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto not found response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(404) if o.Payload != nil { @@ -218,15 +218,15 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflictCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflictCode int = 409 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflictCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflictCode int = 409 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict Resource Conflict. VLAN already exists OR dependency VRF/VNET not found +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict Resource Conflict. VLAN already exists OR dependency VRF/VNET not found -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoConflict +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoConflict */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict struct { /* In: Body @@ -234,25 +234,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto conflict response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto conflict response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto conflict response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto conflict response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(409) if o.Payload != nil { @@ -263,15 +263,15 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerErrorCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerErrorCode int = 500 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerErrorCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerErrorCode int = 500 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError Internal service error +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError Internal service error -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoInternalServerError +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoInternalServerError */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError struct { /* In: Body @@ -279,25 +279,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto internal server error response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto internal server error response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto internal server error response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto internal server error response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(500) if o.Payload != nil { @@ -308,15 +308,15 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } } -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailableCode is the HTTP code returned for type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable -const DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailableCode int = 503 +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailableCode is the HTTP code returned for type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable +const DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailableCode int = 503 /* -DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable Maintanence mode +DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable Maintanence mode -swagger:response deleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIpAddressPortPortProtocolProtoServiceUnavailable +swagger:response deleteConfigLoadbalancerHosturlHosturlExternalipaddressIpAddressPortPortProtocolProtoServiceUnavailable */ -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable struct { +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable struct { /* In: Body @@ -324,25 +324,25 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro Payload *models.Error `json:"body,omitempty"` } -// NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable creates DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable with default headers values -func NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable() *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable { +// NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable creates DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable with default headers values +func NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable() *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable { - return &DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable{} + return &DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable{} } -// WithPayload adds the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto service unavailable response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable { +// WithPayload adds the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto service unavailable response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable { o.Payload = payload return o } -// SetPayload sets the payload to the delete config loadbalancer urlpath urlpath externalipaddress Ip address port port protocol proto service unavailable response -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable) SetPayload(payload *models.Error) { +// SetPayload sets the payload to the delete config loadbalancer hosturl hosturl externalipaddress Ip address port port protocol proto service unavailable response +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable) SetPayload(payload *models.Error) { o.Payload = payload } // WriteResponse to the client -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(503) if o.Payload != nil { diff --git a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_urlbuilder.go b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_urlbuilder.go similarity index 72% rename from api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_urlbuilder.go rename to api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_urlbuilder.go index aa3a8c5ee..f6e9f09e3 100644 --- a/api/restapi/operations/delete_config_loadbalancer_urlpath_urlpath_externalipaddress_ip_address_port_port_protocol_proto_urlbuilder.go +++ b/api/restapi/operations/delete_config_loadbalancer_hosturl_hosturl_externalipaddress_ip_address_port_port_protocol_proto_urlbuilder.go @@ -14,12 +14,12 @@ import ( "github.com/go-openapi/swag" ) -// DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL generates an URL for the delete config loadbalancer urlpath urlpath externalipaddress IP address port port protocol proto operation -type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL struct { +// DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL generates an URL for the delete config loadbalancer hosturl hosturl externalipaddress IP address port port protocol proto operation +type DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL struct { + Hosturl string IPAddress string Port float64 Proto string - Urlpath string Bgp *bool Block *float64 @@ -32,7 +32,7 @@ type DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortPro // WithBasePath sets the base path for this url builder, only required when it's different from the // base path specified in the swagger spec. // When the value of the base path is an empty string -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) WithBasePath(bp string) *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) WithBasePath(bp string) *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL { o.SetBasePath(bp) return o } @@ -40,42 +40,42 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor // SetBasePath sets the base path for this url builder, only required when it's different from the // base path specified in the swagger spec. // When the value of the base path is an empty string -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) SetBasePath(bp string) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) SetBasePath(bp string) { o._basePath = bp } // Build a url path and query string -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) Build() (*url.URL, error) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) Build() (*url.URL, error) { var _result url.URL - var _path = "/config/loadbalancer/urlpath/{urlpath}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}" + var _path = "/config/loadbalancer/hosturl/{hosturl}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}" + + hosturl := o.Hosturl + if hosturl != "" { + _path = strings.Replace(_path, "{hosturl}", hosturl, -1) + } else { + return nil, errors.New("hosturl is required on DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL") + } iPAddress := o.IPAddress if iPAddress != "" { _path = strings.Replace(_path, "{ip_address}", iPAddress, -1) } else { - return nil, errors.New("ipAddress is required on DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL") + return nil, errors.New("ipAddress is required on DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL") } port := swag.FormatFloat64(o.Port) if port != "" { _path = strings.Replace(_path, "{port}", port, -1) } else { - return nil, errors.New("port is required on DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL") + return nil, errors.New("port is required on DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL") } proto := o.Proto if proto != "" { _path = strings.Replace(_path, "{proto}", proto, -1) } else { - return nil, errors.New("proto is required on DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL") - } - - urlpath := o.Urlpath - if urlpath != "" { - _path = strings.Replace(_path, "{urlpath}", urlpath, -1) - } else { - return nil, errors.New("urlpath is required on DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL") + return nil, errors.New("proto is required on DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL") } _basePath := o._basePath @@ -108,7 +108,7 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } // Must is a helper function to panic when the url builder returns an error -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) Must(u *url.URL, err error) *url.URL { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) Must(u *url.URL, err error) *url.URL { if err != nil { panic(err) } @@ -119,17 +119,17 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } // String returns the string representation of the path with query string -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) String() string { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) String() string { return o.Must(o.Build()).String() } // BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) BuildFull(scheme, host string) (*url.URL, error) { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) BuildFull(scheme, host string) (*url.URL, error) { if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL") + return nil, errors.New("scheme is required for a full url on DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL") } if host == "" { - return nil, errors.New("host is required for a full url on DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL") + return nil, errors.New("host is required for a full url on DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL") } base, err := o.Build() @@ -143,6 +143,6 @@ func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPor } // StringFull returns the string representation of a complete url -func (o *DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoURL) StringFull(scheme, host string) string { +func (o *DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoURL) StringFull(scheme, host string) string { return o.Must(o.BuildFull(scheme, host)).String() } diff --git a/api/restapi/operations/loxilb_rest_api_api.go b/api/restapi/operations/loxilb_rest_api_api.go index 9d571cd3b..4d0909b75 100644 --- a/api/restapi/operations/loxilb_rest_api_api.go +++ b/api/restapi/operations/loxilb_rest_api_api.go @@ -75,12 +75,12 @@ func NewLoxilbRestAPIAPI(spec *loads.Document) *LoxilbRestAPIAPI { DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler: DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(func(params DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { return middleware.NotImplemented("operation DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProto has not yet been implemented") }), + DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler: DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(func(params DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { + return middleware.NotImplemented("operation DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto has not yet been implemented") + }), DeleteConfigLoadbalancerNameLbNameHandler: DeleteConfigLoadbalancerNameLbNameHandlerFunc(func(params DeleteConfigLoadbalancerNameLbNameParams) middleware.Responder { return middleware.NotImplemented("operation DeleteConfigLoadbalancerNameLbName has not yet been implemented") }), - DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler: DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(func(params DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { - return middleware.NotImplemented("operation DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto has not yet been implemented") - }), DeleteConfigMirrorIdentIdentHandler: DeleteConfigMirrorIdentIdentHandlerFunc(func(params DeleteConfigMirrorIdentIdentParams) middleware.Responder { return middleware.NotImplemented("operation DeleteConfigMirrorIdentIdent has not yet been implemented") }), @@ -313,10 +313,10 @@ type LoxilbRestAPIAPI struct { DeleteConfigLoadbalancerAllHandler DeleteConfigLoadbalancerAllHandler // DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler sets the operation handler for the delete config loadbalancer externalipaddress IP address port port protocol proto operation DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler + // DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler sets the operation handler for the delete config loadbalancer hosturl hosturl externalipaddress IP address port port protocol proto operation + DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler // DeleteConfigLoadbalancerNameLbNameHandler sets the operation handler for the delete config loadbalancer name lb name operation DeleteConfigLoadbalancerNameLbNameHandler DeleteConfigLoadbalancerNameLbNameHandler - // DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler sets the operation handler for the delete config loadbalancer urlpath urlpath externalipaddress IP address port port protocol proto operation - DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler // DeleteConfigMirrorIdentIdentHandler sets the operation handler for the delete config mirror ident ident operation DeleteConfigMirrorIdentIdentHandler DeleteConfigMirrorIdentIdentHandler // DeleteConfigNeighborIPAddressDevIfNameHandler sets the operation handler for the delete config neighbor IP address dev if name operation @@ -543,12 +543,12 @@ func (o *LoxilbRestAPIAPI) Validate() error { if o.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler == nil { unregistered = append(unregistered, "DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler") } + if o.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler == nil { + unregistered = append(unregistered, "DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler") + } if o.DeleteConfigLoadbalancerNameLbNameHandler == nil { unregistered = append(unregistered, "DeleteConfigLoadbalancerNameLbNameHandler") } - if o.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler == nil { - unregistered = append(unregistered, "DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler") - } if o.DeleteConfigMirrorIdentIdentHandler == nil { unregistered = append(unregistered, "DeleteConfigMirrorIdentIdentHandler") } @@ -858,11 +858,11 @@ func (o *LoxilbRestAPIAPI) initHandlerCache() { if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } - o.handlers["DELETE"]["/config/loadbalancer/name/{lb_name}"] = NewDeleteConfigLoadbalancerNameLbName(o.context, o.DeleteConfigLoadbalancerNameLbNameHandler) + o.handlers["DELETE"]["/config/loadbalancer/hosturl/{hosturl}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}"] = NewDeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProto(o.context, o.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } - o.handlers["DELETE"]["/config/loadbalancer/urlpath/{urlpath}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}"] = NewDeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProto(o.context, o.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler) + o.handlers["DELETE"]["/config/loadbalancer/name/{lb_name}"] = NewDeleteConfigLoadbalancerNameLbName(o.context, o.DeleteConfigLoadbalancerNameLbNameHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) } diff --git a/api/swagger.yml b/api/swagger.yml index 6d98815dd..f154fb4f8 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -234,12 +234,12 @@ paths: description: Maintanence mode schema: $ref: '#/definitions/Error' - '/config/loadbalancer/urlpath/{urlpath}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}': + '/config/loadbalancer/hosturl/{hosturl}/externalipaddress/{ip_address}/port/{port}/protocol/{proto}': delete: summary: Delete an existing Load balancer service description: Delete an existing load balancer service with . parameters: - - name: urlpath + - name: hosturl in: path type: string required: true @@ -2966,9 +2966,9 @@ definitions: type: integer format: int32 description: end-point specific op (0-create, 1-attachEP, 2-detachEP) - path: + host: type: string - description: Ingress specific URL path + description: Ingress specific host URL path endpoints: type: array diff --git a/common/common.go b/common/common.go index 314875591..b3568bea9 100644 --- a/common/common.go +++ b/common/common.go @@ -573,8 +573,8 @@ type LbServiceArg struct { PersistTimeout uint32 `json:"persistTimeout"` // Snat - Do SNAT Snat bool `json:"snat"` - // Path - Ingress Specific URL path - Path string `json:"path"` + // HostUrl - Ingress Specific URL path + HostUrl string `json:"path"` } // LbEndPointArg - Information related to load-balancer end-point diff --git a/loxilb-ebpf b/loxilb-ebpf index d34f73f20..a89b92b2e 160000 --- a/loxilb-ebpf +++ b/loxilb-ebpf @@ -1 +1 @@ -Subproject commit d34f73f20de8e062ab5a4af720da8b1f9637d11e +Subproject commit a89b92b2e05ac623161b1e18cb7e6153d95c2dd2 diff --git a/pkg/loxinet/dpbroker.go b/pkg/loxinet/dpbroker.go index c30f3294a..e2f7c31be 100644 --- a/pkg/loxinet/dpbroker.go +++ b/pkg/loxinet/dpbroker.go @@ -286,7 +286,8 @@ type NatDpWorkQ struct { BlockNum uint16 DsrMode bool CsumDis bool - TermHTTPs bool + TermHTTPS bool + HostURL string Proto uint8 Mark int NatType NatT diff --git a/pkg/loxinet/dpebpf_linux.go b/pkg/loxinet/dpebpf_linux.go index 4fe84e699..1cbd9a20a 100644 --- a/pkg/loxinet/dpebpf_linux.go +++ b/pkg/loxinet/dpebpf_linux.go @@ -129,7 +129,7 @@ type ( rtDat C.struct_dp_rt_tact rtL3NhAct C.struct_dp_rt_nh_act natKey C.struct_dp_nat_key - natActs C.struct_dp_nat_tacts + proxyActs C.struct_dp_proxy_tacts nxfrmAct C.struct_mf_xfrm_inf sess4Key C.struct_dp_sess4_key sessAct C.struct_dp_sess_tact @@ -953,98 +953,101 @@ func DpNatLbRuleMod(w *NatDpWorkQ) int { key.zone = C.ushort(w.ZoneNum) } - if w.Work == DpCreate { - dat := new(natActs) - C.memset(unsafe.Pointer(dat), 0, C.sizeof_struct_dp_nat_tacts) - if w.NatType == DpSnat { - dat.ca.act_type = C.DP_SET_SNAT - } else if w.NatType == DpDnat || w.NatType == DpFullNat { - dat.ca.act_type = C.DP_SET_DNAT - } else if w.NatType == DpFullProxy { - dat.ca.act_type = C.DP_SET_FULLPROXY - } else { - tk.LogIt(tk.LogDebug, "[DP] LB rule %s add[NOK] - EbpfErrNat4Add\n", w.ServiceIP.String()) - return EbpfErrNat4Add - } - - // seconds to nanoseconds - dat.ito = C.uint64_t(w.InActTo * 1000000000) - dat.pto = C.uint64_t(w.PersistTo * 1000000000) - dat.base_to = 0 + dat := new(proxyActs) + C.memset(unsafe.Pointer(dat), 0, C.sizeof_struct_dp_proxy_tacts) + if w.NatType == DpSnat { + dat.ca.act_type = C.DP_SET_SNAT + } else if w.NatType == DpDnat || w.NatType == DpFullNat { + dat.ca.act_type = C.DP_SET_DNAT + } else if w.NatType == DpFullProxy { + dat.ca.act_type = C.DP_SET_FULLPROXY + } else { + tk.LogIt(tk.LogDebug, "[DP] LB rule %s add[NOK] - EbpfErrNat4Add\n", w.ServiceIP.String()) + return EbpfErrNat4Add + } - /*dat.npmhh = 2 - dat.pmhh[0] = 0x64646464 - dat.pmhh[1] = 0x65656565*/ - for i, k := range w.secIP { - dat.pmhh[i] = C.uint(tk.IPtonl(k)) - } - dat.npmhh = C.uchar(len(w.secIP)) + // seconds to nanoseconds + dat.ito = C.uint64_t(w.InActTo * 1000000000) + dat.pto = C.uint64_t(w.PersistTo * 1000000000) + dat.base_to = 0 - switch { - case w.EpSel == EpRR: - dat.sel_type = C.NAT_LB_SEL_RR - case w.EpSel == EpHash: - dat.sel_type = C.NAT_LB_SEL_HASH - case w.EpSel == EpRRPersist: - dat.sel_type = C.NAT_LB_SEL_RR_PERSIST - case w.EpSel == EpLeastConn: - dat.sel_type = C.NAT_LB_SEL_LC - case w.EpSel == EpN2: - dat.sel_type = C.NAT_LB_SEL_N2 - /* Currently not implemented in DP */ - /*case w.EpSel == EP_PRIO: - dat.sel_type = C.NAT_LB_SEL_PRIO*/ - default: - dat.sel_type = C.NAT_LB_SEL_RR - } - dat.ca.cidx = C.uint(w.Mark) - if w.DsrMode { - dat.ca.oaux = 1 - } + /*dat.npmhh = 2 + dat.pmhh[0] = 0x64646464 + dat.pmhh[1] = 0x65656565*/ + for i, k := range w.secIP { + dat.pmhh[i] = C.uint(tk.IPtonl(k)) + } + dat.npmhh = C.uchar(len(w.secIP)) - nxfa := (*nxfrmAct)(unsafe.Pointer(&dat.nxfrms[0])) + switch { + case w.EpSel == EpRR: + dat.sel_type = C.NAT_LB_SEL_RR + case w.EpSel == EpHash: + dat.sel_type = C.NAT_LB_SEL_HASH + case w.EpSel == EpRRPersist: + dat.sel_type = C.NAT_LB_SEL_RR_PERSIST + case w.EpSel == EpLeastConn: + dat.sel_type = C.NAT_LB_SEL_LC + case w.EpSel == EpN2: + dat.sel_type = C.NAT_LB_SEL_N2 + /* Currently not implemented in DP */ + /*case w.EpSel == EP_PRIO: + dat.sel_type = C.NAT_LB_SEL_PRIO*/ + default: + dat.sel_type = C.NAT_LB_SEL_RR + } + dat.ca.cidx = C.uint(w.Mark) + if w.DsrMode { + dat.ca.oaux = 1 + } - for _, k := range w.endPoints { - nxfa.wprio = C.uchar(k.Weight) - nxfa.nat_xport = C.ushort(tk.Htons(k.XPort)) - if tk.IsNetIPv6(k.XIP.String()) { - convNetIP2DPv6Addr(unsafe.Pointer(&nxfa.nat_xip[0]), k.XIP) + nxfa := (*nxfrmAct)(unsafe.Pointer(&dat.nxfrms[0])) - if tk.IsNetIPv6(k.RIP.String()) { - convNetIP2DPv6Addr(unsafe.Pointer(&nxfa.nat_rip[0]), k.RIP) - } - nxfa.nv6 = 1 - } else { - nxfa.nat_xip[0] = C.uint(tk.IPtonl(k.XIP)) - nxfa.nat_rip[0] = C.uint(tk.IPtonl(k.RIP)) - nxfa.nv6 = 0 - } + for _, k := range w.endPoints { + nxfa.wprio = C.uchar(k.Weight) + nxfa.nat_xport = C.ushort(tk.Htons(k.XPort)) + if tk.IsNetIPv6(k.XIP.String()) { + convNetIP2DPv6Addr(unsafe.Pointer(&nxfa.nat_xip[0]), k.XIP) - if k.InActive { - nxfa.inactive = 1 + if tk.IsNetIPv6(k.RIP.String()) { + convNetIP2DPv6Addr(unsafe.Pointer(&nxfa.nat_rip[0]), k.RIP) } - - nxfa = (*nxfrmAct)(getPtrOffset(unsafe.Pointer(nxfa), - C.sizeof_struct_mf_xfrm_inf)) + nxfa.nv6 = 1 + } else { + nxfa.nat_xip[0] = C.uint(tk.IPtonl(k.XIP)) + nxfa.nat_rip[0] = C.uint(tk.IPtonl(k.RIP)) + nxfa.nv6 = 0 } - // Any unused end-points should be marked inactive - for i := len(w.endPoints); i < C.LLB_MAX_NXFRMS; i++ { - nxfa := (*nxfrmAct)(unsafe.Pointer(&dat.nxfrms[i])) + if k.InActive { nxfa.inactive = 1 } - dat.nxfrm = C.ushort(len(w.endPoints)) - if w.CsumDis { - dat.cdis = 1 - } else { - dat.cdis = 0 - } + nxfa = (*nxfrmAct)(getPtrOffset(unsafe.Pointer(nxfa), + C.sizeof_struct_mf_xfrm_inf)) + } - if w.TermHTTPs { - dat.sec_mode = C.SEC_MODE_HTTPS - } + // Any unused end-points should be marked inactive + for i := len(w.endPoints); i < C.LLB_MAX_NXFRMS; i++ { + nxfa := (*nxfrmAct)(unsafe.Pointer(&dat.nxfrms[i])) + nxfa.inactive = 1 + } + dat.nxfrm = C.ushort(len(w.endPoints)) + if w.CsumDis { + dat.cdis = 1 + } else { + dat.cdis = 0 + } + + if w.TermHTTPS { + dat.sec_mode = C.SEC_MODE_HTTPS + } + + hostURLStr := C.CString(w.HostURL) + C.memcpy(unsafe.Pointer(&dat.host_url[0]), unsafe.Pointer(hostURLStr), C.ulong(len(w.HostURL))+1) + + if w.Work == DpCreate { ret := C.llb_add_map_elem(C.LL_DP_NAT_MAP, unsafe.Pointer(key), unsafe.Pointer(dat)) @@ -1056,7 +1059,9 @@ func DpNatLbRuleMod(w *NatDpWorkQ) int { tk.LogIt(tk.LogDebug, "[DP] LB rule %s add[OK]\n", w.ServiceIP.String()) return 0 } else if w.Work == DpRemove { - C.llb_del_map_elem(C.LL_DP_NAT_MAP, unsafe.Pointer(key)) + C.llb_del_map_elem_wval(C.LL_DP_NAT_MAP, + unsafe.Pointer(key), + unsafe.Pointer(dat)) return 0 } diff --git a/pkg/loxinet/rules.go b/pkg/loxinet/rules.go index a20a45f07..072cc0fc1 100644 --- a/pkg/loxinet/rules.go +++ b/pkg/loxinet/rules.go @@ -792,7 +792,7 @@ func (R *RuleH) GetNatLbRule() ([]cmn.LbRuleMod, error) { ret.Serv.ProbeReq = data.hChk.prbReq ret.Serv.ProbeResp = data.hChk.prbResp ret.Serv.Name = data.name - ret.Serv.Path = data.tuples.path + ret.Serv.HostUrl = data.tuples.path if data.act.actType == RtActSnat { ret.Serv.Snat = true } @@ -950,7 +950,7 @@ func (R *RuleH) GetNatLbRuleByServArgs(serv cmn.LbServiceArg) *ruleEnt { l4prot := rule8Tuple{ipProto, 0xff} l3dst := ruleIPTuple{*sNetAddr} l4dst := rule16Tuple{serv.ServPort, 0xffff} - rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.Path} + rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.HostUrl} return R.tables[RtLB].eMap[rt.ruleKey()] } @@ -978,7 +978,7 @@ func (R *RuleH) GetNatLbRuleSecIPs(serv cmn.LbServiceArg) []string { l4prot := rule8Tuple{ipProto, 0xff} l3dst := ruleIPTuple{*sNetAddr} l4dst := rule16Tuple{serv.ServPort, 0xffff} - rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.Path} + rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.HostUrl} if R.tables[RtLB].eMap[rt.ruleKey()] != nil { for _, ip := range R.tables[RtLB].eMap[rt.ruleKey()].secIP { ips = append(ips, ip.sIP.String()) @@ -1499,7 +1499,7 @@ func (R *RuleH) AddNatLbRule(serv cmn.LbServiceArg, servSecIPs []cmn.LbSecIPArg, l4prot := rule8Tuple{ipProto, 0xff} l3dst := ruleIPTuple{*sNetAddr} l4dst := rule16Tuple{serv.ServPort, 0xffff} - rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.Path} + rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.HostUrl} eRule := R.tables[RtLB].eMap[rt.ruleKey()] @@ -1710,7 +1710,7 @@ func (R *RuleH) DeleteNatLbRule(serv cmn.LbServiceArg) (int, error) { l4prot := rule8Tuple{ipProto, 0xff} l3dst := ruleIPTuple{*sNetAddr} l4dst := rule16Tuple{serv.ServPort, 0xffff} - rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.Path} + rt := ruleTuples{l3Dst: l3dst, l4Prot: l4prot, l4Dst: l4dst, pref: serv.BlockNum, path: serv.HostUrl} rule := R.tables[RtLB].eMap[rt.ruleKey()] if rule == nil { @@ -2583,7 +2583,7 @@ func (r *ruleEnt) Nat2DP(work DpWorkT) int { nWork.Status = &r.sync nWork.ZoneNum = r.zone.ZoneNum if r.secMode == cmn.LBServHttps { - nWork.TermHTTPs = true + nWork.TermHTTPS = true } nWork.ServiceIP = r.tuples.l3Dst.addr.IP.Mask(r.tuples.l3Dst.addr.Mask) nWork.L4Port = r.tuples.l4Dst.val @@ -2592,6 +2592,7 @@ func (r *ruleEnt) Nat2DP(work DpWorkT) int { nWork.BlockNum = r.tuples.pref nWork.InActTo = uint64(r.iTO) nWork.PersistTo = uint64(r.pTO) + nWork.HostURL = r.tuples.path if r.act.actType == RtActDnat { nWork.NatType = DpDnat