Skip to content

Commit

Permalink
Update auto generated go snappi
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 6, 2024
1 parent 3dc521e commit 3dd577e
Show file tree
Hide file tree
Showing 24 changed files with 28,739 additions and 27,158 deletions.
4 changes: 2 additions & 2 deletions gosnappi/action_protocol_bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ type ActionProtocolBgp interface {
// HasNotification checks if Notification has been set in ActionProtocolBgp
HasNotification() bool
// InitiateGracefulRestart returns ActionProtocolBgpInitiateGracefulRestart, set in ActionProtocolBgp.
// ActionProtocolBgpInitiateGracefulRestart is initiates BGP Graceful Restart process for the selected BGP peers. If no name is specified then Graceful Restart will be sent to all configured BGP peers.
// ActionProtocolBgpInitiateGracefulRestart is initiates BGP Graceful Restart process for the selected BGP peers. If no name is specified then Graceful Restart will be sent to all configured BGP peers. To emulate scenarios where a peer sends a Notification and stops the session, an optional Notification object is included. If the remote peer and the local peer are both configured to perform Graceful Restart for Notification triggered session , this will result in Graceful Restart scenario to be triggered as per RFC8538.
InitiateGracefulRestart() ActionProtocolBgpInitiateGracefulRestart
// SetInitiateGracefulRestart assigns ActionProtocolBgpInitiateGracefulRestart provided by user to ActionProtocolBgp.
// ActionProtocolBgpInitiateGracefulRestart is initiates BGP Graceful Restart process for the selected BGP peers. If no name is specified then Graceful Restart will be sent to all configured BGP peers.
// ActionProtocolBgpInitiateGracefulRestart is initiates BGP Graceful Restart process for the selected BGP peers. If no name is specified then Graceful Restart will be sent to all configured BGP peers. To emulate scenarios where a peer sends a Notification and stops the session, an optional Notification object is included. If the remote peer and the local peer are both configured to perform Graceful Restart for Notification triggered session , this will result in Graceful Restart scenario to be triggered as per RFC8538.
SetInitiateGracefulRestart(value ActionProtocolBgpInitiateGracefulRestart) ActionProtocolBgp
// HasInitiateGracefulRestart checks if InitiateGracefulRestart has been set in ActionProtocolBgp
HasInitiateGracefulRestart() bool
Expand Down
732 changes: 732 additions & 0 deletions gosnappi/action_protocol_bgp_graceful_restart_notification.go

Large diffs are not rendered by default.

81 changes: 69 additions & 12 deletions gosnappi/action_protocol_bgp_initiate_graceful_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (
// ***** ActionProtocolBgpInitiateGracefulRestart *****
type actionProtocolBgpInitiateGracefulRestart struct {
validation
obj *otg.ActionProtocolBgpInitiateGracefulRestart
marshaller marshalActionProtocolBgpInitiateGracefulRestart
unMarshaller unMarshalActionProtocolBgpInitiateGracefulRestart
obj *otg.ActionProtocolBgpInitiateGracefulRestart
marshaller marshalActionProtocolBgpInitiateGracefulRestart
unMarshaller unMarshalActionProtocolBgpInitiateGracefulRestart
notificationHolder ActionProtocolBgpGracefulRestartNotification
}

func NewActionProtocolBgpInitiateGracefulRestart() ActionProtocolBgpInitiateGracefulRestart {
Expand All @@ -29,7 +30,7 @@ func (obj *actionProtocolBgpInitiateGracefulRestart) msg() *otg.ActionProtocolBg
}

func (obj *actionProtocolBgpInitiateGracefulRestart) setMsg(msg *otg.ActionProtocolBgpInitiateGracefulRestart) ActionProtocolBgpInitiateGracefulRestart {

obj.setNil()
proto.Merge(obj.obj, msg)
return obj
}
Expand Down Expand Up @@ -112,7 +113,7 @@ func (m *unMarshalactionProtocolBgpInitiateGracefulRestart) FromPbText(value str
if retObj != nil {
return retObj
}

m.obj.setNil()
vErr := m.obj.validateToAndFrom()
if vErr != nil {
return vErr
Expand Down Expand Up @@ -158,7 +159,7 @@ func (m *unMarshalactionProtocolBgpInitiateGracefulRestart) FromYaml(value strin
return fmt.Errorf("unmarshal error %s", strings.Replace(
uError.Error(), "\u00a0", " ", -1)[7:])
}

m.obj.setNil()
vErr := m.obj.validateToAndFrom()
if vErr != nil {
return vErr
Expand Down Expand Up @@ -197,7 +198,7 @@ func (m *unMarshalactionProtocolBgpInitiateGracefulRestart) FromJson(value strin
return fmt.Errorf("unmarshal error %s", strings.Replace(
uError.Error(), "\u00a0", " ", -1)[7:])
}

m.obj.setNil()
err := m.obj.validateToAndFrom()
if err != nil {
return err
Expand Down Expand Up @@ -242,7 +243,14 @@ func (obj *actionProtocolBgpInitiateGracefulRestart) Clone() (ActionProtocolBgpI
return newObj, nil
}

// ActionProtocolBgpInitiateGracefulRestart is initiates BGP Graceful Restart process for the selected BGP peers. If no name is specified then Graceful Restart will be sent to all configured BGP peers.
func (obj *actionProtocolBgpInitiateGracefulRestart) setNil() {
obj.notificationHolder = nil
obj.validationErrors = nil
obj.warnings = nil
obj.constraints = make(map[string]map[string]Constraints)
}

// ActionProtocolBgpInitiateGracefulRestart is initiates BGP Graceful Restart process for the selected BGP peers. If no name is specified then Graceful Restart will be sent to all configured BGP peers. To emulate scenarios where a peer sends a Notification and stops the session, an optional Notification object is included. If the remote peer and the local peer are both configured to perform Graceful Restart for Notification triggered session , this will result in Graceful Restart scenario to be triggered as per RFC8538.
type ActionProtocolBgpInitiateGracefulRestart interface {
Validation
// msg marshals ActionProtocolBgpInitiateGracefulRestart to protobuf object *otg.ActionProtocolBgpInitiateGracefulRestart
Expand Down Expand Up @@ -274,15 +282,26 @@ type ActionProtocolBgpInitiateGracefulRestart interface {
SetRestartDelay(value uint32) ActionProtocolBgpInitiateGracefulRestart
// HasRestartDelay checks if RestartDelay has been set in ActionProtocolBgpInitiateGracefulRestart
HasRestartDelay() bool
// Notification returns ActionProtocolBgpGracefulRestartNotification, set in ActionProtocolBgpInitiateGracefulRestart.
// ActionProtocolBgpGracefulRestartNotification is defines the explicit contents of the NOTIFICATION message to be sent when executing InitiateGracefulRestart trigger. This causes the BGP connection to close.If a user wants to send custom Error Code and Error Subcode the custom object should be configured. A user can send IANA defined BGP NOTIFICATIONs according to https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml.
Notification() ActionProtocolBgpGracefulRestartNotification
// SetNotification assigns ActionProtocolBgpGracefulRestartNotification provided by user to ActionProtocolBgpInitiateGracefulRestart.
// ActionProtocolBgpGracefulRestartNotification is defines the explicit contents of the NOTIFICATION message to be sent when executing InitiateGracefulRestart trigger. This causes the BGP connection to close.If a user wants to send custom Error Code and Error Subcode the custom object should be configured. A user can send IANA defined BGP NOTIFICATIONs according to https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml.
SetNotification(value ActionProtocolBgpGracefulRestartNotification) ActionProtocolBgpInitiateGracefulRestart
// HasNotification checks if Notification has been set in ActionProtocolBgpInitiateGracefulRestart
HasNotification() bool
setNil()
}

// The names of device BGP peers objects to control.
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// PeerNames returns a []string
func (obj *actionProtocolBgpInitiateGracefulRestart) PeerNames() []string {
Expand All @@ -295,10 +314,12 @@ func (obj *actionProtocolBgpInitiateGracefulRestart) PeerNames() []string {
// The names of device BGP peers objects to control.
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// SetPeerNames sets the []string value in the ActionProtocolBgpInitiateGracefulRestart object
func (obj *actionProtocolBgpInitiateGracefulRestart) SetPeerNames(value []string) ActionProtocolBgpInitiateGracefulRestart {
Expand Down Expand Up @@ -336,6 +357,37 @@ func (obj *actionProtocolBgpInitiateGracefulRestart) SetRestartDelay(value uint3
return obj
}

// Send a Notification to the peer as per configured parameters when initially bringing down a session as per
// configured parameters.
// Notification returns a ActionProtocolBgpGracefulRestartNotification
func (obj *actionProtocolBgpInitiateGracefulRestart) Notification() ActionProtocolBgpGracefulRestartNotification {
if obj.obj.Notification == nil {
obj.obj.Notification = NewActionProtocolBgpGracefulRestartNotification().msg()
}
if obj.notificationHolder == nil {
obj.notificationHolder = &actionProtocolBgpGracefulRestartNotification{obj: obj.obj.Notification}
}
return obj.notificationHolder
}

// Send a Notification to the peer as per configured parameters when initially bringing down a session as per
// configured parameters.
// Notification returns a ActionProtocolBgpGracefulRestartNotification
func (obj *actionProtocolBgpInitiateGracefulRestart) HasNotification() bool {
return obj.obj.Notification != nil
}

// Send a Notification to the peer as per configured parameters when initially bringing down a session as per
// configured parameters.
// SetNotification sets the ActionProtocolBgpGracefulRestartNotification value in the ActionProtocolBgpInitiateGracefulRestart object
func (obj *actionProtocolBgpInitiateGracefulRestart) SetNotification(value ActionProtocolBgpGracefulRestartNotification) ActionProtocolBgpInitiateGracefulRestart {

obj.notificationHolder = nil
obj.obj.Notification = value.msg()

return obj
}

func (obj *actionProtocolBgpInitiateGracefulRestart) validateObj(vObj *validation, set_default bool) {
if set_default {
obj.setDefault()
Expand All @@ -351,6 +403,11 @@ func (obj *actionProtocolBgpInitiateGracefulRestart) validateObj(vObj *validatio

}

if obj.obj.Notification != nil {

obj.Notification().validateObj(vObj, set_default)
}

}

func (obj *actionProtocolBgpInitiateGracefulRestart) setDefault() {
Expand Down
16 changes: 10 additions & 6 deletions gosnappi/action_protocol_bgp_notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ type ActionProtocolBgpNotification interface {
// HasChoice checks if Choice has been set in ActionProtocolBgpNotification
HasChoice() bool
// Cease returns DeviceBgpCeaseError, set in ActionProtocolBgpNotification.
// DeviceBgpCeaseError is in the absence of any fatal errors, a BGP peer can close its BGP connection by sending the NOTIFICATION message with the Error Code Cease.
// DeviceBgpCeaseError is in the absence of any fatal errors, a BGP peer can close its BGP connection by sending the NOTIFICATION message with the Error Code Cease. The 'hard_reset_code6_subcode9' subcode for Cease Notification can be used to signal a hard reset that will indicate that Graceful Restart cannot be performed, even when Notification extensions to Graceful Restart procedure is supported.
Cease() DeviceBgpCeaseError
// SetCease assigns DeviceBgpCeaseError provided by user to ActionProtocolBgpNotification.
// DeviceBgpCeaseError is in the absence of any fatal errors, a BGP peer can close its BGP connection by sending the NOTIFICATION message with the Error Code Cease.
// DeviceBgpCeaseError is in the absence of any fatal errors, a BGP peer can close its BGP connection by sending the NOTIFICATION message with the Error Code Cease. The 'hard_reset_code6_subcode9' subcode for Cease Notification can be used to signal a hard reset that will indicate that Graceful Restart cannot be performed, even when Notification extensions to Graceful Restart procedure is supported.
SetCease(value DeviceBgpCeaseError) ActionProtocolBgpNotification
// HasCease checks if Cease has been set in ActionProtocolBgpNotification
HasCease() bool
Expand Down Expand Up @@ -356,10 +356,12 @@ type ActionProtocolBgpNotification interface {
// The names of BGP Peers to send NOTIFICATION to. If no name is specified then NOTIFICATION will be sent to all configured BGP peers.
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// Names returns a []string
func (obj *actionProtocolBgpNotification) Names() []string {
Expand All @@ -372,10 +374,12 @@ func (obj *actionProtocolBgpNotification) Names() []string {
// The names of BGP Peers to send NOTIFICATION to. If no name is specified then NOTIFICATION will be sent to all configured BGP peers.
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// x-constraint:
// - /components/schemas/Device.Bgp/properties/name
// - /components/schemas/Bgp.V4Peer/properties/name
// - /components/schemas/Bgp.V6Peer/properties/name
//
// SetNames sets the []string value in the ActionProtocolBgpNotification object
func (obj *actionProtocolBgpNotification) SetNames(value []string) ActionProtocolBgpNotification {
Expand Down
14 changes: 7 additions & 7 deletions gosnappi/bgp_attributes_community.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ type BgpAttributesCommunity interface {
Choice() BgpAttributesCommunityChoiceEnum
// setChoice assigns BgpAttributesCommunityChoiceEnum provided by user to BgpAttributesCommunity
setChoice(value BgpAttributesCommunityChoiceEnum) BgpAttributesCommunity
// getter for NoExport to set choice.
NoExport()
// getter for NoExportSubconfed to set choice.
NoExportSubconfed()
// getter for NoLlgr to set choice.
Expand All @@ -286,8 +288,6 @@ type BgpAttributesCommunity interface {
NoAdvertised()
// getter for LlgrStale to set choice.
LlgrStale()
// getter for NoExport to set choice.
NoExport()
// CustomCommunity returns BgpAttributesCustomCommunity, set in BgpAttributesCommunity.
// BgpAttributesCustomCommunity is user defined COMMUNITY attribute containing 2 byte AS and custom 2 byte value defined by the administrator of the domain.
CustomCommunity() BgpAttributesCustomCommunity
Expand Down Expand Up @@ -322,6 +322,11 @@ func (obj *bgpAttributesCommunity) Choice() BgpAttributesCommunityChoiceEnum {
return BgpAttributesCommunityChoiceEnum(obj.obj.Choice.Enum().String())
}

// getter for NoExport to set choice
func (obj *bgpAttributesCommunity) NoExport() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT)
}

// getter for NoExportSubconfed to set choice
func (obj *bgpAttributesCommunity) NoExportSubconfed() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT_SUBCONFED)
Expand All @@ -342,11 +347,6 @@ func (obj *bgpAttributesCommunity) LlgrStale() {
obj.setChoice(BgpAttributesCommunityChoice.LLGR_STALE)
}

// getter for NoExport to set choice
func (obj *bgpAttributesCommunity) NoExport() {
obj.setChoice(BgpAttributesCommunityChoice.NO_EXPORT)
}

func (obj *bgpAttributesCommunity) setChoice(value BgpAttributesCommunityChoiceEnum) BgpAttributesCommunity {
intValue, ok := otg.BgpAttributesCommunity_Choice_Enum_value[string(value)]
if !ok {
Expand Down
28 changes: 14 additions & 14 deletions gosnappi/bgp_attributes_sr_policy_explicit_null_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,16 @@ type BgpAttributesSrPolicyExplicitNullPolicy interface {
setChoice(value BgpAttributesSrPolicyExplicitNullPolicyChoiceEnum) BgpAttributesSrPolicyExplicitNullPolicy
// HasChoice checks if Choice has been set in BgpAttributesSrPolicyExplicitNullPolicy
HasChoice() bool
// getter for PushIpv4 to set choice.
PushIpv4()
// getter for DonotPush to set choice.
DonotPush()
// getter for PushIpv6 to set choice.
PushIpv6()
// getter for Unknown to set choice.
Unknown()
// getter for PushIpv4AndIpv6 to set choice.
PushIpv4AndIpv6()
// getter for DonotPush to set choice.
DonotPush()
// getter for PushIpv4 to set choice.
PushIpv4()
}

type BgpAttributesSrPolicyExplicitNullPolicyChoiceEnum string
Expand All @@ -305,6 +305,16 @@ func (obj *bgpAttributesSrPolicyExplicitNullPolicy) Choice() BgpAttributesSrPoli
return BgpAttributesSrPolicyExplicitNullPolicyChoiceEnum(obj.obj.Choice.Enum().String())
}

// getter for PushIpv4 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv4() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV4)
}

// getter for DonotPush to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) DonotPush() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.DONOT_PUSH)
}

// getter for PushIpv6 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv6() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV6)
Expand All @@ -320,16 +330,6 @@ func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv4AndIpv6() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV4_AND_IPV6)
}

// getter for DonotPush to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) DonotPush() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.DONOT_PUSH)
}

// getter for PushIpv4 to set choice
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) PushIpv4() {
obj.setChoice(BgpAttributesSrPolicyExplicitNullPolicyChoice.PUSH_IPV4)
}

// The Explicit NULL Label policy.
// Choice returns a string
func (obj *bgpAttributesSrPolicyExplicitNullPolicy) HasChoice() bool {
Expand Down
37 changes: 37 additions & 0 deletions gosnappi/bgp_graceful_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ type BgpGracefulRestart interface {
SetStaleTime(value uint32) BgpGracefulRestart
// HasStaleTime checks if StaleTime has been set in BgpGracefulRestart
HasStaleTime() bool
// EnableNotification returns bool, set in BgpGracefulRestart.
EnableNotification() bool
// SetEnableNotification assigns bool provided by user to BgpGracefulRestart
SetEnableNotification(value bool) BgpGracefulRestart
// HasEnableNotification checks if EnableNotification has been set in BgpGracefulRestart
HasEnableNotification() bool
}

// If enabled, Graceful Restart capability is advertised in BGP OPEN messages.
Expand Down Expand Up @@ -393,6 +399,34 @@ func (obj *bgpGracefulRestart) SetStaleTime(value uint32) BgpGracefulRestart {
return obj
}

// If enabled, the N flag will be set in the Graceful Restart capability in the Open message.
// If both peers in a BGP connection has this enabled, Graceful Restart procedures are performed
// even if the peer goes down due to sending of a Notification Message as per RFC8538.
// EnableNotification returns a bool
func (obj *bgpGracefulRestart) EnableNotification() bool {

return *obj.obj.EnableNotification

}

// If enabled, the N flag will be set in the Graceful Restart capability in the Open message.
// If both peers in a BGP connection has this enabled, Graceful Restart procedures are performed
// even if the peer goes down due to sending of a Notification Message as per RFC8538.
// EnableNotification returns a bool
func (obj *bgpGracefulRestart) HasEnableNotification() bool {
return obj.obj.EnableNotification != nil
}

// If enabled, the N flag will be set in the Graceful Restart capability in the Open message.
// If both peers in a BGP connection has this enabled, Graceful Restart procedures are performed
// even if the peer goes down due to sending of a Notification Message as per RFC8538.
// SetEnableNotification sets the bool value in the BgpGracefulRestart object
func (obj *bgpGracefulRestart) SetEnableNotification(value bool) BgpGracefulRestart {

obj.obj.EnableNotification = &value
return obj
}

func (obj *bgpGracefulRestart) validateObj(vObj *validation, set_default bool) {
if set_default {
obj.setDefault()
Expand Down Expand Up @@ -433,5 +467,8 @@ func (obj *bgpGracefulRestart) setDefault() {
if obj.obj.StaleTime == nil {
obj.SetStaleTime(10)
}
if obj.obj.EnableNotification == nil {
obj.SetEnableNotification(true)
}

}
Loading

0 comments on commit 3dd577e

Please sign in to comment.