Skip to content

Adding update config for ISIS link metric#463

Draft
SuryyaKrJana wants to merge 24 commits into
masterfrom
isis-otf-on-link-metric
Draft

Adding update config for ISIS link metric#463
SuryyaKrJana wants to merge 24 commits into
masterfrom
isis-otf-on-link-metric

Conversation

@SuryyaKrJana

@SuryyaKrJana SuryyaKrJana commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Feature Overview


Feature Details


Code snippets

  •     ISIS OTF: both interface metrics 10 → 50 (LSP re-advertisement, no session flap)
    
  •     BGP OTF: both peer hold times 90 → 120 (router-level attribute update)
    
  •     Flow rate OTF via UpdateConfig (Existing feature already available): both flows 100 → 200 pps using FlowsUpdate with property RATE
    
      // Changes p1d1IsisIntf metric from 10 → 50 and p2d1IsisIntf from 10 → 50.
       isisUpdate := gosnappi.NewUpdateProtocolConfigIsis()

	p1IfUpdate := gosnappi.NewUpdateProtocolConfigIsisInterfaceUpdateGroup()
	p1IfUpdate.SetNames([]string{"p1d1IsisIntf"})
	p1IfUpdate.SetMetric(uint32(50))
	isisUpdate.Interfaces().Append(p1IfUpdate)

	p2IfUpdate := gosnappi.NewUpdateProtocolConfigIsisInterfaceUpdateGroup()
	p2IfUpdate.SetNames([]string{"p2d1IsisIntf"})
	p2IfUpdate.SetMetric(uint32(50))
	isisUpdate.Interfaces().Append(p2IfUpdate)

        // BGP OTF: both peer hold times 90 → 120 (router-level attribute update)
	bgpUpdate := gosnappi.NewUpdateProtocolConfigBgp()
	p1BgpRouterUpdate := gosnappi.NewUpdateProtocolConfigBgpRouterUpdateGroup()
	p1BgpRouterUpdate.SetNames([]string{"p1d1BgpPeer"})
	p1BgpRouterUpdate.SetHoldTime(uint32(120))
	bgpUpdate.Routers().Append(p1BgpRouterUpdate)

	p2BgpRouterUpdate := gosnappi.NewUpdateProtocolConfigBgpRouterUpdateGroup()
	p2BgpRouterUpdate.SetNames([]string{"p2d1BgpPeer"})
	p2BgpRouterUpdate.SetHoldTime(uint32(120))
	bgpUpdate.Routers().Append(p2BgpRouterUpdate)

	pu := gosnappi.NewProtocolsUpdate()
	pu.SetIsis(isisUpdate)
	pu.SetBgp(bgpUpdate)

	cu := gosnappi.NewConfigUpdate()
	cu.SetProtocols(pu)

	if _, err := client.UpdateConfig(cu); err != nil {
		t.Fatal(err)
	}


	// Changes flow rate from 100 pps → 200 pps on both flows.
	
	getCfg, err := client.GetConfig()
	if err != nil {
		t.Fatal(err)
	}

	fu := gosnappi.NewConfigUpdate().Flows()
	for _, flow := range getCfg.Flows().Items() {
		flow.Rate().SetPps(200)
		fu.Flows().Append(flow)
	}
	fu.SetPropertyNames([]gosnappi.FlowsUpdatePropertyNamesEnum{
		gosnappi.FlowsUpdatePropertyNames.RATE,
	})

	flowCu := gosnappi.NewConfigUpdate()
	flowCu.SetFlows(fu)
	if _, err := client.UpdateConfig(flowCu); err != nil {
		t.Fatal(err)
	}
	
	if err := client.StartTransmit(nil); err != nil {
		t.Fatal(err)
	}

Comment thread config/updatebgpconfig.yaml
Comment thread config/updateisisconfig.yaml
Comment thread config/updateisisconfig.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants