diff --git a/api/models/b_g_p_policy_defined_set_get_entry.go b/api/models/b_g_p_policy_defined_set_get_entry.go index d5673fa8..9bfbe2c0 100644 --- a/api/models/b_g_p_policy_defined_set_get_entry.go +++ b/api/models/b_g_p_policy_defined_set_get_entry.go @@ -88,6 +88,11 @@ func (m *BGPPolicyDefinedSetGetEntry) contextValidatePrefixList(ctx context.Cont for i := 0; i < len(m.PrefixList); i++ { if m.PrefixList[i] != nil { + + if swag.IsZero(m.PrefixList[i]) { // not required + return nil + } + if err := m.PrefixList[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("prefixList" + "." + strconv.Itoa(i)) diff --git a/api/models/b_g_p_policy_defined_sets_mod.go b/api/models/b_g_p_policy_defined_sets_mod.go index 8769b696..3a4d7bb4 100644 --- a/api/models/b_g_p_policy_defined_sets_mod.go +++ b/api/models/b_g_p_policy_defined_sets_mod.go @@ -88,6 +88,11 @@ func (m *BGPPolicyDefinedSetsMod) contextValidatePrefixList(ctx context.Context, for i := 0; i < len(m.PrefixList); i++ { if m.PrefixList[i] != nil { + + if swag.IsZero(m.PrefixList[i]) { // not required + return nil + } + if err := m.PrefixList[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("prefixList" + "." + strconv.Itoa(i)) diff --git a/api/models/b_g_p_policy_definitions_mod.go b/api/models/b_g_p_policy_definitions_mod.go index e49dd050..c2d57a85 100644 --- a/api/models/b_g_p_policy_definitions_mod.go +++ b/api/models/b_g_p_policy_definitions_mod.go @@ -85,6 +85,11 @@ func (m *BGPPolicyDefinitionsMod) contextValidateStatements(ctx context.Context, for i := 0; i < len(m.Statements); i++ { if m.Statements[i] != nil { + + if swag.IsZero(m.Statements[i]) { // not required + return nil + } + if err := m.Statements[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("statements" + "." + strconv.Itoa(i)) diff --git a/api/models/b_g_p_policy_definitions_statement.go b/api/models/b_g_p_policy_definitions_statement.go index 81d5cb40..ed885da6 100644 --- a/api/models/b_g_p_policy_definitions_statement.go +++ b/api/models/b_g_p_policy_definitions_statement.go @@ -105,6 +105,11 @@ func (m *BGPPolicyDefinitionsStatement) ContextValidate(ctx context.Context, for func (m *BGPPolicyDefinitionsStatement) contextValidateActions(ctx context.Context, formats strfmt.Registry) error { if m.Actions != nil { + + if swag.IsZero(m.Actions) { // not required + return nil + } + if err := m.Actions.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("actions") @@ -121,6 +126,11 @@ func (m *BGPPolicyDefinitionsStatement) contextValidateActions(ctx context.Conte func (m *BGPPolicyDefinitionsStatement) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error { if m.Conditions != nil { + + if swag.IsZero(m.Conditions) { // not required + return nil + } + if err := m.Conditions.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions") @@ -214,6 +224,11 @@ func (m *BGPPolicyDefinitionsStatementActions) ContextValidate(ctx context.Conte func (m *BGPPolicyDefinitionsStatementActions) contextValidateBgpActions(ctx context.Context, formats strfmt.Registry) error { if m.BgpActions != nil { + + if swag.IsZero(m.BgpActions) { // not required + return nil + } + if err := m.BgpActions.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("actions" + "." + "bgpActions") @@ -403,6 +418,11 @@ func (m *BGPPolicyDefinitionsStatementActionsBgpActions) ContextValidate(ctx con func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetAsPathPrepend(ctx context.Context, formats strfmt.Registry) error { if m.SetAsPathPrepend != nil { + + if swag.IsZero(m.SetAsPathPrepend) { // not required + return nil + } + if err := m.SetAsPathPrepend.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("actions" + "." + "bgpActions" + "." + "setAsPathPrepend") @@ -419,6 +439,11 @@ func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetAsPat func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetCommunity(ctx context.Context, formats strfmt.Registry) error { if m.SetCommunity != nil { + + if swag.IsZero(m.SetCommunity) { // not required + return nil + } + if err := m.SetCommunity.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("actions" + "." + "bgpActions" + "." + "setCommunity") @@ -435,6 +460,11 @@ func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetCommu func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetExtCommunity(ctx context.Context, formats strfmt.Registry) error { if m.SetExtCommunity != nil { + + if swag.IsZero(m.SetExtCommunity) { // not required + return nil + } + if err := m.SetExtCommunity.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("actions" + "." + "bgpActions" + "." + "setExtCommunity") @@ -451,6 +481,11 @@ func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetExtCo func (m *BGPPolicyDefinitionsStatementActionsBgpActions) contextValidateSetLargeCommunity(ctx context.Context, formats strfmt.Registry) error { if m.SetLargeCommunity != nil { + + if swag.IsZero(m.SetLargeCommunity) { // not required + return nil + } + if err := m.SetLargeCommunity.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("actions" + "." + "bgpActions" + "." + "setLargeCommunity") @@ -761,6 +796,11 @@ func (m *BGPPolicyDefinitionsStatementConditions) ContextValidate(ctx context.Co func (m *BGPPolicyDefinitionsStatementConditions) contextValidateBgpConditions(ctx context.Context, formats strfmt.Registry) error { if m.BgpConditions != nil { + + if swag.IsZero(m.BgpConditions) { // not required + return nil + } + if err := m.BgpConditions.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "bgpConditions") @@ -777,6 +817,11 @@ func (m *BGPPolicyDefinitionsStatementConditions) contextValidateBgpConditions(c func (m *BGPPolicyDefinitionsStatementConditions) contextValidateMatchNeighborSet(ctx context.Context, formats strfmt.Registry) error { if m.MatchNeighborSet != nil { + + if swag.IsZero(m.MatchNeighborSet) { // not required + return nil + } + if err := m.MatchNeighborSet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "matchNeighborSet") @@ -793,6 +838,11 @@ func (m *BGPPolicyDefinitionsStatementConditions) contextValidateMatchNeighborSe func (m *BGPPolicyDefinitionsStatementConditions) contextValidateMatchPrefixSet(ctx context.Context, formats strfmt.Registry) error { if m.MatchPrefixSet != nil { + + if swag.IsZero(m.MatchPrefixSet) { // not required + return nil + } + if err := m.MatchPrefixSet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "matchPrefixSet") @@ -1015,6 +1065,11 @@ func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) ContextValidate(c func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateAsPathLength(ctx context.Context, formats strfmt.Registry) error { if m.AsPathLength != nil { + + if swag.IsZero(m.AsPathLength) { // not required + return nil + } + if err := m.AsPathLength.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "bgpConditions" + "." + "asPathLength") @@ -1031,6 +1086,11 @@ func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateAs func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMatchAsPathSet(ctx context.Context, formats strfmt.Registry) error { if m.MatchAsPathSet != nil { + + if swag.IsZero(m.MatchAsPathSet) { // not required + return nil + } + if err := m.MatchAsPathSet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "bgpConditions" + "." + "matchAsPathSet") @@ -1047,6 +1107,11 @@ func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMa func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMatchCommunitySet(ctx context.Context, formats strfmt.Registry) error { if m.MatchCommunitySet != nil { + + if swag.IsZero(m.MatchCommunitySet) { // not required + return nil + } + if err := m.MatchCommunitySet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "bgpConditions" + "." + "matchCommunitySet") @@ -1063,6 +1128,11 @@ func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMa func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMatchExtCommunitySet(ctx context.Context, formats strfmt.Registry) error { if m.MatchExtCommunitySet != nil { + + if swag.IsZero(m.MatchExtCommunitySet) { // not required + return nil + } + if err := m.MatchExtCommunitySet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "bgpConditions" + "." + "matchExtCommunitySet") @@ -1079,6 +1149,11 @@ func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMa func (m *BGPPolicyDefinitionsStatementConditionsBgpConditions) contextValidateMatchLargeCommunitySet(ctx context.Context, formats strfmt.Registry) error { if m.MatchLargeCommunitySet != nil { + + if swag.IsZero(m.MatchLargeCommunitySet) { // not required + return nil + } + if err := m.MatchLargeCommunitySet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("conditions" + "." + "bgpConditions" + "." + "matchLargeCommunitySet") diff --git a/api/models/firewall_entry.go b/api/models/firewall_entry.go index 7de5c8fb..571d5bc1 100644 --- a/api/models/firewall_entry.go +++ b/api/models/firewall_entry.go @@ -102,6 +102,11 @@ func (m *FirewallEntry) ContextValidate(ctx context.Context, formats strfmt.Regi func (m *FirewallEntry) contextValidateOpts(ctx context.Context, formats strfmt.Registry) error { if m.Opts != nil { + + if swag.IsZero(m.Opts) { // not required + return nil + } + if err := m.Opts.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("opts") @@ -118,6 +123,11 @@ func (m *FirewallEntry) contextValidateOpts(ctx context.Context, formats strfmt. func (m *FirewallEntry) contextValidateRuleArguments(ctx context.Context, formats strfmt.Registry) error { if m.RuleArguments != nil { + + if swag.IsZero(m.RuleArguments) { // not required + return nil + } + if err := m.RuleArguments.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ruleArguments") diff --git a/api/models/loadbalance_entry.go b/api/models/loadbalance_entry.go index 9aae7577..5d76321f 100644 --- a/api/models/loadbalance_entry.go +++ b/api/models/loadbalance_entry.go @@ -149,6 +149,11 @@ func (m *LoadbalanceEntry) contextValidateEndpoints(ctx context.Context, formats for i := 0; i < len(m.Endpoints); i++ { if m.Endpoints[i] != nil { + + if swag.IsZero(m.Endpoints[i]) { // not required + return nil + } + if err := m.Endpoints[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("endpoints" + "." + strconv.Itoa(i)) @@ -169,6 +174,11 @@ func (m *LoadbalanceEntry) contextValidateSecondaryIPs(ctx context.Context, form for i := 0; i < len(m.SecondaryIPs); i++ { if m.SecondaryIPs[i] != nil { + + if swag.IsZero(m.SecondaryIPs[i]) { // not required + return nil + } + if err := m.SecondaryIPs[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("secondaryIPs" + "." + strconv.Itoa(i)) @@ -187,6 +197,11 @@ func (m *LoadbalanceEntry) contextValidateSecondaryIPs(ctx context.Context, form func (m *LoadbalanceEntry) contextValidateServiceArguments(ctx context.Context, formats strfmt.Registry) error { if m.ServiceArguments != nil { + + if swag.IsZero(m.ServiceArguments) { // not required + return nil + } + if err := m.ServiceArguments.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("serviceArguments") diff --git a/api/models/mirror_entry.go b/api/models/mirror_entry.go index 062dd2b1..1e75de1e 100644 --- a/api/models/mirror_entry.go +++ b/api/models/mirror_entry.go @@ -105,6 +105,11 @@ func (m *MirrorEntry) ContextValidate(ctx context.Context, formats strfmt.Regist func (m *MirrorEntry) contextValidateMirrorInfo(ctx context.Context, formats strfmt.Registry) error { if m.MirrorInfo != nil { + + if swag.IsZero(m.MirrorInfo) { // not required + return nil + } + if err := m.MirrorInfo.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mirrorInfo") @@ -121,6 +126,11 @@ func (m *MirrorEntry) contextValidateMirrorInfo(ctx context.Context, formats str func (m *MirrorEntry) contextValidateTargetObject(ctx context.Context, formats strfmt.Registry) error { if m.TargetObject != nil { + + if swag.IsZero(m.TargetObject) { // not required + return nil + } + if err := m.TargetObject.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("targetObject") diff --git a/api/models/mirror_get_entry.go b/api/models/mirror_get_entry.go index 62910e70..f9a7cb0b 100644 --- a/api/models/mirror_get_entry.go +++ b/api/models/mirror_get_entry.go @@ -123,6 +123,11 @@ func (m *MirrorGetEntry) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *MirrorGetEntry) contextValidateMirrorInfo(ctx context.Context, formats strfmt.Registry) error { if m.MirrorInfo != nil { + + if swag.IsZero(m.MirrorInfo) { // not required + return nil + } + if err := m.MirrorInfo.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mirrorInfo") @@ -139,6 +144,11 @@ func (m *MirrorGetEntry) contextValidateMirrorInfo(ctx context.Context, formats func (m *MirrorGetEntry) contextValidateTargetObject(ctx context.Context, formats strfmt.Registry) error { if m.TargetObject != nil { + + if swag.IsZero(m.TargetObject) { // not required + return nil + } + if err := m.TargetObject.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("targetObject") diff --git a/api/models/policy_entry.go b/api/models/policy_entry.go index b9935512..f1b62d4d 100644 --- a/api/models/policy_entry.go +++ b/api/models/policy_entry.go @@ -105,6 +105,11 @@ func (m *PolicyEntry) ContextValidate(ctx context.Context, formats strfmt.Regist func (m *PolicyEntry) contextValidatePolicyInfo(ctx context.Context, formats strfmt.Registry) error { if m.PolicyInfo != nil { + + if swag.IsZero(m.PolicyInfo) { // not required + return nil + } + if err := m.PolicyInfo.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policyInfo") @@ -121,6 +126,11 @@ func (m *PolicyEntry) contextValidatePolicyInfo(ctx context.Context, formats str func (m *PolicyEntry) contextValidateTargetObject(ctx context.Context, formats strfmt.Registry) error { if m.TargetObject != nil { + + if swag.IsZero(m.TargetObject) { // not required + return nil + } + if err := m.TargetObject.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("targetObject") diff --git a/api/models/port_entry.go b/api/models/port_entry.go index 09fde040..d6273add 100644 --- a/api/models/port_entry.go +++ b/api/models/port_entry.go @@ -204,6 +204,11 @@ func (m *PortEntry) ContextValidate(ctx context.Context, formats strfmt.Registry func (m *PortEntry) contextValidatePortHardwareInformation(ctx context.Context, formats strfmt.Registry) error { if m.PortHardwareInformation != nil { + + if swag.IsZero(m.PortHardwareInformation) { // not required + return nil + } + if err := m.PortHardwareInformation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("portHardwareInformation") @@ -220,6 +225,11 @@ func (m *PortEntry) contextValidatePortHardwareInformation(ctx context.Context, func (m *PortEntry) contextValidatePortL2Information(ctx context.Context, formats strfmt.Registry) error { if m.PortL2Information != nil { + + if swag.IsZero(m.PortL2Information) { // not required + return nil + } + if err := m.PortL2Information.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("portL2Information") @@ -236,6 +246,11 @@ func (m *PortEntry) contextValidatePortL2Information(ctx context.Context, format func (m *PortEntry) contextValidatePortL3Information(ctx context.Context, formats strfmt.Registry) error { if m.PortL3Information != nil { + + if swag.IsZero(m.PortL3Information) { // not required + return nil + } + if err := m.PortL3Information.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("portL3Information") @@ -252,6 +267,11 @@ func (m *PortEntry) contextValidatePortL3Information(ctx context.Context, format func (m *PortEntry) contextValidatePortSoftwareInformation(ctx context.Context, formats strfmt.Registry) error { if m.PortSoftwareInformation != nil { + + if swag.IsZero(m.PortSoftwareInformation) { // not required + return nil + } + if err := m.PortSoftwareInformation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("portSoftwareInformation") @@ -268,6 +288,11 @@ func (m *PortEntry) contextValidatePortSoftwareInformation(ctx context.Context, func (m *PortEntry) contextValidatePortStatisticInformation(ctx context.Context, formats strfmt.Registry) error { if m.PortStatisticInformation != nil { + + if swag.IsZero(m.PortStatisticInformation) { // not required + return nil + } + if err := m.PortStatisticInformation.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("portStatisticInformation") diff --git a/api/models/route_get_entry.go b/api/models/route_get_entry.go index f83534b4..fbb3da5e 100644 --- a/api/models/route_get_entry.go +++ b/api/models/route_get_entry.go @@ -91,6 +91,11 @@ func (m *RouteGetEntry) ContextValidate(ctx context.Context, formats strfmt.Regi func (m *RouteGetEntry) contextValidateStatistic(ctx context.Context, formats strfmt.Registry) error { if m.Statistic != nil { + + if swag.IsZero(m.Statistic) { // not required + return nil + } + if err := m.Statistic.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("statistic") diff --git a/api/models/session_entry.go b/api/models/session_entry.go index 1bfb83af..6926eb34 100644 --- a/api/models/session_entry.go +++ b/api/models/session_entry.go @@ -108,6 +108,11 @@ func (m *SessionEntry) ContextValidate(ctx context.Context, formats strfmt.Regis func (m *SessionEntry) contextValidateAccessNetworkTunnel(ctx context.Context, formats strfmt.Registry) error { if m.AccessNetworkTunnel != nil { + + if swag.IsZero(m.AccessNetworkTunnel) { // not required + return nil + } + if err := m.AccessNetworkTunnel.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("accessNetworkTunnel") @@ -124,6 +129,11 @@ func (m *SessionEntry) contextValidateAccessNetworkTunnel(ctx context.Context, f func (m *SessionEntry) contextValidateCoreNetworkTunnel(ctx context.Context, formats strfmt.Registry) error { if m.CoreNetworkTunnel != nil { + + if swag.IsZero(m.CoreNetworkTunnel) { // not required + return nil + } + if err := m.CoreNetworkTunnel.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("coreNetworkTunnel") diff --git a/api/models/session_ul_cl_entry.go b/api/models/session_ul_cl_entry.go index 1d0a8500..b60c9069 100644 --- a/api/models/session_ul_cl_entry.go +++ b/api/models/session_ul_cl_entry.go @@ -75,6 +75,11 @@ func (m *SessionUlClEntry) ContextValidate(ctx context.Context, formats strfmt.R func (m *SessionUlClEntry) contextValidateUlclArgument(ctx context.Context, formats strfmt.Registry) error { if m.UlclArgument != nil { + + if swag.IsZero(m.UlclArgument) { // not required + return nil + } + if err := m.UlclArgument.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ulclArgument") diff --git a/api/models/vlan_get_entry.go b/api/models/vlan_get_entry.go index b7d28b37..e20cdb09 100644 --- a/api/models/vlan_get_entry.go +++ b/api/models/vlan_get_entry.go @@ -118,6 +118,11 @@ func (m *VlanGetEntry) contextValidateMember(ctx context.Context, formats strfmt for i := 0; i < len(m.Member); i++ { if m.Member[i] != nil { + + if swag.IsZero(m.Member[i]) { // not required + return nil + } + if err := m.Member[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("member" + "." + strconv.Itoa(i)) @@ -136,6 +141,11 @@ func (m *VlanGetEntry) contextValidateMember(ctx context.Context, formats strfmt func (m *VlanGetEntry) contextValidateVlanStatistic(ctx context.Context, formats strfmt.Registry) error { if m.VlanStatistic != nil { + + if swag.IsZero(m.VlanStatistic) { // not required + return nil + } + if err := m.VlanStatistic.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vlanStatistic") diff --git a/api/restapi/configure_loxilb_rest_api.go b/api/restapi/configure_loxilb_rest_api.go index 7f5f1511..3b4c9d20 100644 --- a/api/restapi/configure_loxilb_rest_api.go +++ b/api/restapi/configure_loxilb_rest_api.go @@ -63,6 +63,7 @@ func configureAPI(api *operations.LoxilbRestAPIAPI) http.Handler { api.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancer) api.GetConfigLoadbalancerAllHandler = operations.GetConfigLoadbalancerAllHandlerFunc(handler.ConfigGetLoadbalancer) api.DeleteConfigLoadbalancerAllHandler = operations.DeleteConfigLoadbalancerAllHandlerFunc(handler.ConfigDeleteAllLoadbalancer) + api.DeleteConfigLoadbalancerNameLbNameHandler = operations.DeleteConfigLoadbalancerNameLbNameHandlerFunc(handler.ConfigDeleteLoadbalancerByName) // Conntrack get api.GetConfigConntrackAllHandler = operations.GetConfigConntrackAllHandlerFunc(handler.ConfigGetConntrack) diff --git a/api/restapi/embedded_spec.go b/api/restapi/embedded_spec.go index 045bf62b..b6d1c267 100644 --- a/api/restapi/embedded_spec.go +++ b/api/restapi/embedded_spec.go @@ -2062,6 +2062,68 @@ func init() { } } }, + "/config/loadbalancer/name/{lb_name}": { + "delete": { + "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", + "name": "lb_name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "OK" + }, + "400": { + "description": "Malformed arguments for API call", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "Invalid authentication credentials", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Capacity insufficient", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Resource Conflict. VLAN already exists OR dependency VRF/VNET not found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Internal service error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Maintanence mode", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, "/config/mirror": { "post": { "description": "Create a new Mirror config.", @@ -7516,6 +7578,68 @@ func init() { } } }, + "/config/loadbalancer/name/{lb_name}": { + "delete": { + "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", + "name": "lb_name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "OK" + }, + "400": { + "description": "Malformed arguments for API call", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "Invalid authentication credentials", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "Capacity insufficient", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "Resource not found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Resource Conflict. VLAN already exists OR dependency VRF/VNET not found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "Internal service error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "503": { + "description": "Maintanence mode", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, "/config/mirror": { "post": { "description": "Create a new Mirror config.", diff --git a/api/restapi/handler/loadbalancer.go b/api/restapi/handler/loadbalancer.go index 6ce1ede4..7a6fb547 100644 --- a/api/restapi/handler/loadbalancer.go +++ b/api/restapi/handler/loadbalancer.go @@ -173,3 +173,27 @@ func ConfigDeleteAllLoadbalancer(params operations.DeleteConfigLoadbalancerAllPa return &ResultResponse{Result: "Success"} } + +func ConfigDeleteLoadbalancerByName(params operations.DeleteConfigLoadbalancerNameLbNameParams) middleware.Responder { + tk.LogIt(tk.LogDebug, "[API] Load balancer %s API called. url : %s\n", params.HTTPRequest.Method, params.HTTPRequest.URL) + + res, err := ApiHooks.NetLbRuleGet() + if err != nil { + tk.LogIt(tk.LogDebug, "[API] Error occur : %v\n", err) + return &ResultResponse{Result: err.Error()} + } + for _, lbRules := range res { + + if lbRules.Serv.Name != params.LbName { + continue + } + + tk.LogIt(tk.LogDebug, "[API] lbRules : %v\n", lbRules) + _, err := ApiHooks.NetLbRuleDel(&lbRules) + if err != nil { + tk.LogIt(tk.LogDebug, "[API] Error : %v\n", err) + } + } + + return &ResultResponse{Result: "Success"} +} diff --git a/api/restapi/operations/delete_config_loadbalancer_name_lb_name.go b/api/restapi/operations/delete_config_loadbalancer_name_lb_name.go new file mode 100644 index 00000000..86b37d03 --- /dev/null +++ b/api/restapi/operations/delete_config_loadbalancer_name_lb_name.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteConfigLoadbalancerNameLbNameHandlerFunc turns a function with the right signature into a delete config loadbalancer name lb name handler +type DeleteConfigLoadbalancerNameLbNameHandlerFunc func(DeleteConfigLoadbalancerNameLbNameParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteConfigLoadbalancerNameLbNameHandlerFunc) Handle(params DeleteConfigLoadbalancerNameLbNameParams) middleware.Responder { + return fn(params) +} + +// DeleteConfigLoadbalancerNameLbNameHandler interface for that can handle valid delete config loadbalancer name lb name params +type DeleteConfigLoadbalancerNameLbNameHandler interface { + Handle(DeleteConfigLoadbalancerNameLbNameParams) middleware.Responder +} + +// NewDeleteConfigLoadbalancerNameLbName creates a new http.Handler for the delete config loadbalancer name lb name operation +func NewDeleteConfigLoadbalancerNameLbName(ctx *middleware.Context, handler DeleteConfigLoadbalancerNameLbNameHandler) *DeleteConfigLoadbalancerNameLbName { + return &DeleteConfigLoadbalancerNameLbName{Context: ctx, Handler: handler} +} + +/* + DeleteConfigLoadbalancerNameLbName swagger:route DELETE /config/loadbalancer/name/{lb_name} deleteConfigLoadbalancerNameLbName + +# Delete an existing Load balancer service + +Delete an existing load balancer service with name. +*/ +type DeleteConfigLoadbalancerNameLbName struct { + Context *middleware.Context + Handler DeleteConfigLoadbalancerNameLbNameHandler +} + +func (o *DeleteConfigLoadbalancerNameLbName) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteConfigLoadbalancerNameLbNameParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/delete_config_loadbalancer_name_lb_name_parameters.go b/api/restapi/operations/delete_config_loadbalancer_name_lb_name_parameters.go new file mode 100644 index 00000000..967becd0 --- /dev/null +++ b/api/restapi/operations/delete_config_loadbalancer_name_lb_name_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteConfigLoadbalancerNameLbNameParams creates a new DeleteConfigLoadbalancerNameLbNameParams object +// +// There are no default values defined in the spec. +func NewDeleteConfigLoadbalancerNameLbNameParams() DeleteConfigLoadbalancerNameLbNameParams { + + return DeleteConfigLoadbalancerNameLbNameParams{} +} + +// DeleteConfigLoadbalancerNameLbNameParams contains all the bound params for the delete config loadbalancer name lb name operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteConfigLoadbalancerNameLbName +type DeleteConfigLoadbalancerNameLbNameParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Attributes for load balance service name + Required: true + In: path + */ + LbName 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 NewDeleteConfigLoadbalancerNameLbNameParams() beforehand. +func (o *DeleteConfigLoadbalancerNameLbNameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rLbName, rhkLbName, _ := route.Params.GetOK("lb_name") + if err := o.bindLbName(rLbName, rhkLbName, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLbName binds and validates parameter LbName from path. +func (o *DeleteConfigLoadbalancerNameLbNameParams) bindLbName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.LbName = raw + + return nil +} diff --git a/api/restapi/operations/delete_config_loadbalancer_name_lb_name_responses.go b/api/restapi/operations/delete_config_loadbalancer_name_lb_name_responses.go new file mode 100644 index 00000000..8a2f07cf --- /dev/null +++ b/api/restapi/operations/delete_config_loadbalancer_name_lb_name_responses.go @@ -0,0 +1,354 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/loxilb-io/loxilb/api/models" +) + +// DeleteConfigLoadbalancerNameLbNameNoContentCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameNoContent +const DeleteConfigLoadbalancerNameLbNameNoContentCode int = 204 + +/* +DeleteConfigLoadbalancerNameLbNameNoContent OK + +swagger:response deleteConfigLoadbalancerNameLbNameNoContent +*/ +type DeleteConfigLoadbalancerNameLbNameNoContent struct { +} + +// NewDeleteConfigLoadbalancerNameLbNameNoContent creates DeleteConfigLoadbalancerNameLbNameNoContent with default headers values +func NewDeleteConfigLoadbalancerNameLbNameNoContent() *DeleteConfigLoadbalancerNameLbNameNoContent { + + return &DeleteConfigLoadbalancerNameLbNameNoContent{} +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteConfigLoadbalancerNameLbNameBadRequestCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameBadRequest +const DeleteConfigLoadbalancerNameLbNameBadRequestCode int = 400 + +/* +DeleteConfigLoadbalancerNameLbNameBadRequest Malformed arguments for API call + +swagger:response deleteConfigLoadbalancerNameLbNameBadRequest +*/ +type DeleteConfigLoadbalancerNameLbNameBadRequest struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameBadRequest creates DeleteConfigLoadbalancerNameLbNameBadRequest with default headers values +func NewDeleteConfigLoadbalancerNameLbNameBadRequest() *DeleteConfigLoadbalancerNameLbNameBadRequest { + + return &DeleteConfigLoadbalancerNameLbNameBadRequest{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name bad request response +func (o *DeleteConfigLoadbalancerNameLbNameBadRequest) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name bad request response +func (o *DeleteConfigLoadbalancerNameLbNameBadRequest) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteConfigLoadbalancerNameLbNameUnauthorizedCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameUnauthorized +const DeleteConfigLoadbalancerNameLbNameUnauthorizedCode int = 401 + +/* +DeleteConfigLoadbalancerNameLbNameUnauthorized Invalid authentication credentials + +swagger:response deleteConfigLoadbalancerNameLbNameUnauthorized +*/ +type DeleteConfigLoadbalancerNameLbNameUnauthorized struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameUnauthorized creates DeleteConfigLoadbalancerNameLbNameUnauthorized with default headers values +func NewDeleteConfigLoadbalancerNameLbNameUnauthorized() *DeleteConfigLoadbalancerNameLbNameUnauthorized { + + return &DeleteConfigLoadbalancerNameLbNameUnauthorized{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name unauthorized response +func (o *DeleteConfigLoadbalancerNameLbNameUnauthorized) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name unauthorized response +func (o *DeleteConfigLoadbalancerNameLbNameUnauthorized) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteConfigLoadbalancerNameLbNameForbiddenCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameForbidden +const DeleteConfigLoadbalancerNameLbNameForbiddenCode int = 403 + +/* +DeleteConfigLoadbalancerNameLbNameForbidden Capacity insufficient + +swagger:response deleteConfigLoadbalancerNameLbNameForbidden +*/ +type DeleteConfigLoadbalancerNameLbNameForbidden struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameForbidden creates DeleteConfigLoadbalancerNameLbNameForbidden with default headers values +func NewDeleteConfigLoadbalancerNameLbNameForbidden() *DeleteConfigLoadbalancerNameLbNameForbidden { + + return &DeleteConfigLoadbalancerNameLbNameForbidden{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name forbidden response +func (o *DeleteConfigLoadbalancerNameLbNameForbidden) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name forbidden response +func (o *DeleteConfigLoadbalancerNameLbNameForbidden) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteConfigLoadbalancerNameLbNameNotFoundCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameNotFound +const DeleteConfigLoadbalancerNameLbNameNotFoundCode int = 404 + +/* +DeleteConfigLoadbalancerNameLbNameNotFound Resource not found + +swagger:response deleteConfigLoadbalancerNameLbNameNotFound +*/ +type DeleteConfigLoadbalancerNameLbNameNotFound struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameNotFound creates DeleteConfigLoadbalancerNameLbNameNotFound with default headers values +func NewDeleteConfigLoadbalancerNameLbNameNotFound() *DeleteConfigLoadbalancerNameLbNameNotFound { + + return &DeleteConfigLoadbalancerNameLbNameNotFound{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name not found response +func (o *DeleteConfigLoadbalancerNameLbNameNotFound) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name not found response +func (o *DeleteConfigLoadbalancerNameLbNameNotFound) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteConfigLoadbalancerNameLbNameConflictCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameConflict +const DeleteConfigLoadbalancerNameLbNameConflictCode int = 409 + +/* +DeleteConfigLoadbalancerNameLbNameConflict Resource Conflict. VLAN already exists OR dependency VRF/VNET not found + +swagger:response deleteConfigLoadbalancerNameLbNameConflict +*/ +type DeleteConfigLoadbalancerNameLbNameConflict struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameConflict creates DeleteConfigLoadbalancerNameLbNameConflict with default headers values +func NewDeleteConfigLoadbalancerNameLbNameConflict() *DeleteConfigLoadbalancerNameLbNameConflict { + + return &DeleteConfigLoadbalancerNameLbNameConflict{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name conflict response +func (o *DeleteConfigLoadbalancerNameLbNameConflict) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name conflict response +func (o *DeleteConfigLoadbalancerNameLbNameConflict) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteConfigLoadbalancerNameLbNameInternalServerErrorCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameInternalServerError +const DeleteConfigLoadbalancerNameLbNameInternalServerErrorCode int = 500 + +/* +DeleteConfigLoadbalancerNameLbNameInternalServerError Internal service error + +swagger:response deleteConfigLoadbalancerNameLbNameInternalServerError +*/ +type DeleteConfigLoadbalancerNameLbNameInternalServerError struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameInternalServerError creates DeleteConfigLoadbalancerNameLbNameInternalServerError with default headers values +func NewDeleteConfigLoadbalancerNameLbNameInternalServerError() *DeleteConfigLoadbalancerNameLbNameInternalServerError { + + return &DeleteConfigLoadbalancerNameLbNameInternalServerError{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name internal server error response +func (o *DeleteConfigLoadbalancerNameLbNameInternalServerError) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name internal server error response +func (o *DeleteConfigLoadbalancerNameLbNameInternalServerError) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteConfigLoadbalancerNameLbNameServiceUnavailableCode is the HTTP code returned for type DeleteConfigLoadbalancerNameLbNameServiceUnavailable +const DeleteConfigLoadbalancerNameLbNameServiceUnavailableCode int = 503 + +/* +DeleteConfigLoadbalancerNameLbNameServiceUnavailable Maintanence mode + +swagger:response deleteConfigLoadbalancerNameLbNameServiceUnavailable +*/ +type DeleteConfigLoadbalancerNameLbNameServiceUnavailable struct { + + /* + In: Body + */ + Payload *models.Error `json:"body,omitempty"` +} + +// NewDeleteConfigLoadbalancerNameLbNameServiceUnavailable creates DeleteConfigLoadbalancerNameLbNameServiceUnavailable with default headers values +func NewDeleteConfigLoadbalancerNameLbNameServiceUnavailable() *DeleteConfigLoadbalancerNameLbNameServiceUnavailable { + + return &DeleteConfigLoadbalancerNameLbNameServiceUnavailable{} +} + +// WithPayload adds the payload to the delete config loadbalancer name lb name service unavailable response +func (o *DeleteConfigLoadbalancerNameLbNameServiceUnavailable) WithPayload(payload *models.Error) *DeleteConfigLoadbalancerNameLbNameServiceUnavailable { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete config loadbalancer name lb name service unavailable response +func (o *DeleteConfigLoadbalancerNameLbNameServiceUnavailable) SetPayload(payload *models.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteConfigLoadbalancerNameLbNameServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(503) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/api/restapi/operations/delete_config_loadbalancer_name_lb_name_urlbuilder.go b/api/restapi/operations/delete_config_loadbalancer_name_lb_name_urlbuilder.go new file mode 100644 index 00000000..4467d552 --- /dev/null +++ b/api/restapi/operations/delete_config_loadbalancer_name_lb_name_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteConfigLoadbalancerNameLbNameURL generates an URL for the delete config loadbalancer name lb name operation +type DeleteConfigLoadbalancerNameLbNameURL struct { + LbName string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// 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 *DeleteConfigLoadbalancerNameLbNameURL) WithBasePath(bp string) *DeleteConfigLoadbalancerNameLbNameURL { + o.SetBasePath(bp) + return o +} + +// 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 *DeleteConfigLoadbalancerNameLbNameURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteConfigLoadbalancerNameLbNameURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/config/loadbalancer/name/{lb_name}" + + lbName := o.LbName + if lbName != "" { + _path = strings.Replace(_path, "{lb_name}", lbName, -1) + } else { + return nil, errors.New("lbName is required on DeleteConfigLoadbalancerNameLbNameURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/netlox/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteConfigLoadbalancerNameLbNameURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteConfigLoadbalancerNameLbNameURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteConfigLoadbalancerNameLbNameURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteConfigLoadbalancerNameLbNameURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteConfigLoadbalancerNameLbNameURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteConfigLoadbalancerNameLbNameURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/get_config_bfd_all.go b/api/restapi/operations/get_config_bfd_all.go index 1450cf53..e689166f 100644 --- a/api/restapi/operations/get_config_bfd_all.go +++ b/api/restapi/operations/get_config_bfd_all.go @@ -132,6 +132,11 @@ func (o *GetConfigBfdAllOKBody) contextValidateAttr(ctx context.Context, formats for i := 0; i < len(o.Attr); i++ { if o.Attr[i] != nil { + + if swag.IsZero(o.Attr[i]) { // not required + return nil + } + if err := o.Attr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigBfdAllOK" + "." + "Attr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_bgp_neigh_all.go b/api/restapi/operations/get_config_bgp_neigh_all.go index f6def74b..43d6434a 100644 --- a/api/restapi/operations/get_config_bgp_neigh_all.go +++ b/api/restapi/operations/get_config_bgp_neigh_all.go @@ -132,6 +132,11 @@ func (o *GetConfigBgpNeighAllOKBody) contextValidateBgpNeiAttr(ctx context.Conte for i := 0; i < len(o.BgpNeiAttr); i++ { if o.BgpNeiAttr[i] != nil { + + if swag.IsZero(o.BgpNeiAttr[i]) { // not required + return nil + } + if err := o.BgpNeiAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigBgpNeighAllOK" + "." + "bgpNeiAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_bgp_policy_definedsets_defineset_type_type_name.go b/api/restapi/operations/get_config_bgp_policy_definedsets_defineset_type_type_name.go index 0bb01bb6..f0da6968 100644 --- a/api/restapi/operations/get_config_bgp_policy_definedsets_defineset_type_type_name.go +++ b/api/restapi/operations/get_config_bgp_policy_definedsets_defineset_type_type_name.go @@ -132,6 +132,11 @@ func (o *GetConfigBgpPolicyDefinedsetsDefinesetTypeTypeNameOKBody) contextValida for i := 0; i < len(o.DefinedsetsAttr); i++ { if o.DefinedsetsAttr[i] != nil { + + if swag.IsZero(o.DefinedsetsAttr[i]) { // not required + return nil + } + if err := o.DefinedsetsAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigBgpPolicyDefinedsetsDefinesetTypeTypeNameOK" + "." + "definedsetsAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_bgp_policy_definitions_all.go b/api/restapi/operations/get_config_bgp_policy_definitions_all.go index 523340e5..f28af032 100644 --- a/api/restapi/operations/get_config_bgp_policy_definitions_all.go +++ b/api/restapi/operations/get_config_bgp_policy_definitions_all.go @@ -132,6 +132,11 @@ func (o *GetConfigBgpPolicyDefinitionsAllOKBody) contextValidateBgpPolicyAttr(ct for i := 0; i < len(o.BgpPolicyAttr); i++ { if o.BgpPolicyAttr[i] != nil { + + if swag.IsZero(o.BgpPolicyAttr[i]) { // not required + return nil + } + if err := o.BgpPolicyAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigBgpPolicyDefinitionsAllOK" + "." + "bgpPolicyAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_cistate_all.go b/api/restapi/operations/get_config_cistate_all.go index 7c792381..005aef2a 100644 --- a/api/restapi/operations/get_config_cistate_all.go +++ b/api/restapi/operations/get_config_cistate_all.go @@ -132,6 +132,11 @@ func (o *GetConfigCistateAllOKBody) contextValidateAttr(ctx context.Context, for for i := 0; i < len(o.Attr); i++ { if o.Attr[i] != nil { + + if swag.IsZero(o.Attr[i]) { // not required + return nil + } + if err := o.Attr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigCistateAllOK" + "." + "Attr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_conntrack_all.go b/api/restapi/operations/get_config_conntrack_all.go index b6e73fca..fdd98f30 100644 --- a/api/restapi/operations/get_config_conntrack_all.go +++ b/api/restapi/operations/get_config_conntrack_all.go @@ -132,6 +132,11 @@ func (o *GetConfigConntrackAllOKBody) contextValidateCtAttr(ctx context.Context, for i := 0; i < len(o.CtAttr); i++ { if o.CtAttr[i] != nil { + + if swag.IsZero(o.CtAttr[i]) { // not required + return nil + } + if err := o.CtAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigConntrackAllOK" + "." + "ctAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_endpoint_all.go b/api/restapi/operations/get_config_endpoint_all.go index 014afbde..dc7cb647 100644 --- a/api/restapi/operations/get_config_endpoint_all.go +++ b/api/restapi/operations/get_config_endpoint_all.go @@ -132,6 +132,11 @@ func (o *GetConfigEndpointAllOKBody) contextValidateAttr(ctx context.Context, fo for i := 0; i < len(o.Attr); i++ { if o.Attr[i] != nil { + + if swag.IsZero(o.Attr[i]) { // not required + return nil + } + if err := o.Attr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigEndpointAllOK" + "." + "Attr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_fdb_all.go b/api/restapi/operations/get_config_fdb_all.go index 64ea648b..c5181c17 100644 --- a/api/restapi/operations/get_config_fdb_all.go +++ b/api/restapi/operations/get_config_fdb_all.go @@ -132,6 +132,11 @@ func (o *GetConfigFdbAllOKBody) contextValidateFdbAttr(ctx context.Context, form for i := 0; i < len(o.FdbAttr); i++ { if o.FdbAttr[i] != nil { + + if swag.IsZero(o.FdbAttr[i]) { // not required + return nil + } + if err := o.FdbAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigFdbAllOK" + "." + "fdbAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_firewall_all.go b/api/restapi/operations/get_config_firewall_all.go index de42ddaf..79031bfb 100644 --- a/api/restapi/operations/get_config_firewall_all.go +++ b/api/restapi/operations/get_config_firewall_all.go @@ -132,6 +132,11 @@ func (o *GetConfigFirewallAllOKBody) contextValidateFwAttr(ctx context.Context, for i := 0; i < len(o.FwAttr); i++ { if o.FwAttr[i] != nil { + + if swag.IsZero(o.FwAttr[i]) { // not required + return nil + } + if err := o.FwAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigFirewallAllOK" + "." + "fwAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_ipv4address_all.go b/api/restapi/operations/get_config_ipv4address_all.go index 4b5c94e8..29e3b484 100644 --- a/api/restapi/operations/get_config_ipv4address_all.go +++ b/api/restapi/operations/get_config_ipv4address_all.go @@ -132,6 +132,11 @@ func (o *GetConfigIpv4addressAllOKBody) contextValidateIPAttr(ctx context.Contex for i := 0; i < len(o.IPAttr); i++ { if o.IPAttr[i] != nil { + + if swag.IsZero(o.IPAttr[i]) { // not required + return nil + } + if err := o.IPAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigIpv4addressAllOK" + "." + "ipAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_loadbalancer_all.go b/api/restapi/operations/get_config_loadbalancer_all.go index 2f460083..c7c5146a 100644 --- a/api/restapi/operations/get_config_loadbalancer_all.go +++ b/api/restapi/operations/get_config_loadbalancer_all.go @@ -132,6 +132,11 @@ func (o *GetConfigLoadbalancerAllOKBody) contextValidateLbAttr(ctx context.Conte for i := 0; i < len(o.LbAttr); i++ { if o.LbAttr[i] != nil { + + if swag.IsZero(o.LbAttr[i]) { // not required + return nil + } + if err := o.LbAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigLoadbalancerAllOK" + "." + "lbAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_mirror_all.go b/api/restapi/operations/get_config_mirror_all.go index 469edc0f..abc19dc9 100644 --- a/api/restapi/operations/get_config_mirror_all.go +++ b/api/restapi/operations/get_config_mirror_all.go @@ -132,6 +132,11 @@ func (o *GetConfigMirrorAllOKBody) contextValidateMirrAttr(ctx context.Context, for i := 0; i < len(o.MirrAttr); i++ { if o.MirrAttr[i] != nil { + + if swag.IsZero(o.MirrAttr[i]) { // not required + return nil + } + if err := o.MirrAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigMirrorAllOK" + "." + "mirrAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_neighbor_all.go b/api/restapi/operations/get_config_neighbor_all.go index 6898458a..71424804 100644 --- a/api/restapi/operations/get_config_neighbor_all.go +++ b/api/restapi/operations/get_config_neighbor_all.go @@ -132,6 +132,11 @@ func (o *GetConfigNeighborAllOKBody) contextValidateNeighborAttr(ctx context.Con for i := 0; i < len(o.NeighborAttr); i++ { if o.NeighborAttr[i] != nil { + + if swag.IsZero(o.NeighborAttr[i]) { // not required + return nil + } + if err := o.NeighborAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigNeighborAllOK" + "." + "neighborAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_policy_all.go b/api/restapi/operations/get_config_policy_all.go index 189bcdc5..73835733 100644 --- a/api/restapi/operations/get_config_policy_all.go +++ b/api/restapi/operations/get_config_policy_all.go @@ -132,6 +132,11 @@ func (o *GetConfigPolicyAllOKBody) contextValidatePolAttr(ctx context.Context, f for i := 0; i < len(o.PolAttr); i++ { if o.PolAttr[i] != nil { + + if swag.IsZero(o.PolAttr[i]) { // not required + return nil + } + if err := o.PolAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigPolicyAllOK" + "." + "polAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_port_all.go b/api/restapi/operations/get_config_port_all.go index b7e64592..b2c35dfc 100644 --- a/api/restapi/operations/get_config_port_all.go +++ b/api/restapi/operations/get_config_port_all.go @@ -132,6 +132,11 @@ func (o *GetConfigPortAllOKBody) contextValidatePortAttr(ctx context.Context, fo for i := 0; i < len(o.PortAttr); i++ { if o.PortAttr[i] != nil { + + if swag.IsZero(o.PortAttr[i]) { // not required + return nil + } + if err := o.PortAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigPortAllOK" + "." + "portAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_route_all.go b/api/restapi/operations/get_config_route_all.go index f4430d26..715bd448 100644 --- a/api/restapi/operations/get_config_route_all.go +++ b/api/restapi/operations/get_config_route_all.go @@ -132,6 +132,11 @@ func (o *GetConfigRouteAllOKBody) contextValidateRouteAttr(ctx context.Context, for i := 0; i < len(o.RouteAttr); i++ { if o.RouteAttr[i] != nil { + + if swag.IsZero(o.RouteAttr[i]) { // not required + return nil + } + if err := o.RouteAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigRouteAllOK" + "." + "routeAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_session_all.go b/api/restapi/operations/get_config_session_all.go index 3e30ac8e..e51e2c2f 100644 --- a/api/restapi/operations/get_config_session_all.go +++ b/api/restapi/operations/get_config_session_all.go @@ -132,6 +132,11 @@ func (o *GetConfigSessionAllOKBody) contextValidateSessionAttr(ctx context.Conte for i := 0; i < len(o.SessionAttr); i++ { if o.SessionAttr[i] != nil { + + if swag.IsZero(o.SessionAttr[i]) { // not required + return nil + } + if err := o.SessionAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigSessionAllOK" + "." + "sessionAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_sessionulcl_all.go b/api/restapi/operations/get_config_sessionulcl_all.go index 76db8c58..75651885 100644 --- a/api/restapi/operations/get_config_sessionulcl_all.go +++ b/api/restapi/operations/get_config_sessionulcl_all.go @@ -132,6 +132,11 @@ func (o *GetConfigSessionulclAllOKBody) contextValidateUlclAttr(ctx context.Cont for i := 0; i < len(o.UlclAttr); i++ { if o.UlclAttr[i] != nil { + + if swag.IsZero(o.UlclAttr[i]) { // not required + return nil + } + if err := o.UlclAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigSessionulclAllOK" + "." + "ulclAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_tunnel_vxlan_all.go b/api/restapi/operations/get_config_tunnel_vxlan_all.go index d79cfe1a..06be7488 100644 --- a/api/restapi/operations/get_config_tunnel_vxlan_all.go +++ b/api/restapi/operations/get_config_tunnel_vxlan_all.go @@ -132,6 +132,11 @@ func (o *GetConfigTunnelVxlanAllOKBody) contextValidateVxlanAttr(ctx context.Con for i := 0; i < len(o.VxlanAttr); i++ { if o.VxlanAttr[i] != nil { + + if swag.IsZero(o.VxlanAttr[i]) { // not required + return nil + } + if err := o.VxlanAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigTunnelVxlanAllOK" + "." + "vxlanAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_config_vlan_all.go b/api/restapi/operations/get_config_vlan_all.go index e38e217b..f52141cd 100644 --- a/api/restapi/operations/get_config_vlan_all.go +++ b/api/restapi/operations/get_config_vlan_all.go @@ -132,6 +132,11 @@ func (o *GetConfigVlanAllOKBody) contextValidateVlanAttr(ctx context.Context, fo for i := 0; i < len(o.VlanAttr); i++ { if o.VlanAttr[i] != nil { + + if swag.IsZero(o.VlanAttr[i]) { // not required + return nil + } + if err := o.VlanAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConfigVlanAllOK" + "." + "vlanAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_status_filesystem.go b/api/restapi/operations/get_status_filesystem.go index 817708ad..54e46369 100644 --- a/api/restapi/operations/get_status_filesystem.go +++ b/api/restapi/operations/get_status_filesystem.go @@ -132,6 +132,11 @@ func (o *GetStatusFilesystemOKBody) contextValidateFilesystemAttr(ctx context.Co for i := 0; i < len(o.FilesystemAttr); i++ { if o.FilesystemAttr[i] != nil { + + if swag.IsZero(o.FilesystemAttr[i]) { // not required + return nil + } + if err := o.FilesystemAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getStatusFilesystemOK" + "." + "filesystemAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/get_status_process.go b/api/restapi/operations/get_status_process.go index b4fc54b1..4d25fd72 100644 --- a/api/restapi/operations/get_status_process.go +++ b/api/restapi/operations/get_status_process.go @@ -132,6 +132,11 @@ func (o *GetStatusProcessOKBody) contextValidateProcessAttr(ctx context.Context, for i := 0; i < len(o.ProcessAttr); i++ { if o.ProcessAttr[i] != nil { + + if swag.IsZero(o.ProcessAttr[i]) { // not required + return nil + } + if err := o.ProcessAttr[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getStatusProcessOK" + "." + "processAttr" + "." + strconv.Itoa(i)) diff --git a/api/restapi/operations/loxilb_rest_api_api.go b/api/restapi/operations/loxilb_rest_api_api.go index 4c217c7a..76862f33 100644 --- a/api/restapi/operations/loxilb_rest_api_api.go +++ b/api/restapi/operations/loxilb_rest_api_api.go @@ -72,6 +72,9 @@ func NewLoxilbRestAPIAPI(spec *loads.Document) *LoxilbRestAPIAPI { DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler: DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(func(params DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder { return middleware.NotImplemented("operation DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProto has not yet been implemented") }), + DeleteConfigLoadbalancerNameLbNameHandler: DeleteConfigLoadbalancerNameLbNameHandlerFunc(func(params DeleteConfigLoadbalancerNameLbNameParams) middleware.Responder { + return middleware.NotImplemented("operation DeleteConfigLoadbalancerNameLbName has not yet been implemented") + }), DeleteConfigMirrorIdentIdentHandler: DeleteConfigMirrorIdentIdentHandlerFunc(func(params DeleteConfigMirrorIdentIdentParams) middleware.Responder { return middleware.NotImplemented("operation DeleteConfigMirrorIdentIdent has not yet been implemented") }), @@ -302,6 +305,8 @@ 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 + // DeleteConfigLoadbalancerNameLbNameHandler sets the operation handler for the delete config loadbalancer name lb name operation + DeleteConfigLoadbalancerNameLbNameHandler DeleteConfigLoadbalancerNameLbNameHandler // 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 @@ -525,6 +530,9 @@ func (o *LoxilbRestAPIAPI) Validate() error { if o.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler == nil { unregistered = append(unregistered, "DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler") } + if o.DeleteConfigLoadbalancerNameLbNameHandler == nil { + unregistered = append(unregistered, "DeleteConfigLoadbalancerNameLbNameHandler") + } if o.DeleteConfigMirrorIdentIdentHandler == nil { unregistered = append(unregistered, "DeleteConfigMirrorIdentIdentHandler") } @@ -830,6 +838,10 @@ 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) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } o.handlers["DELETE"]["/config/mirror/ident/{ident}"] = NewDeleteConfigMirrorIdentIdent(o.context, o.DeleteConfigMirrorIdentIdentHandler) if o.handlers["DELETE"] == nil { o.handlers["DELETE"] = make(map[string]http.Handler) @@ -1100,6 +1112,6 @@ func (o *LoxilbRestAPIAPI) AddMiddlewareFor(method, path string, builder middlew } o.Init() if h, ok := o.handlers[um][path]; ok { - o.handlers[method][path] = builder(h) + o.handlers[um][path] = builder(h) } } diff --git a/api/swagger.yml b/api/swagger.yml index 3c0f1656..17027448 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -133,6 +133,47 @@ paths: description: Maintanence mode schema: $ref: '#/definitions/Error' + '/config/loadbalancer/name/{lb_name}': + delete: + summary: Delete an existing Load balancer service + description: Delete an existing load balancer service with name. + parameters: + - name: lb_name + in: path + type: string + required: true + description: Attributes for load balance service name + responses: + '204': + description: OK + '400': + description: Malformed arguments for API call + schema: + $ref: '#/definitions/Error' + '401': + description: Invalid authentication credentials + schema: + $ref: '#/definitions/Error' + '403': + description: Capacity insufficient + schema: + $ref: '#/definitions/Error' + '404': + description: Resource not found + schema: + $ref: '#/definitions/Error' + '409': + description: Resource Conflict. VLAN already exists OR dependency VRF/VNET not found + schema: + $ref: '#/definitions/Error' + '500': + description: Internal service error + schema: + $ref: '#/definitions/Error' + '503': + description: Maintanence mode + schema: + $ref: '#/definitions/Error' '/config/loadbalancer/externalipaddress/{ip_address}/port/{port}/protocol/{proto}': delete: summary: Delete an existing Load balancer service