Free NetBox Cloud has arrived. Learn more →

Announcing the Diode Go SDK

Earlier this summer, Diode, the data ingestion engine for NetBox that makes it easier to get your data into NetBox’s structured data model, moved into public preview. Diode unlocks a huge amount of velocity for teams that automate data ingestion into NetBox, enabling you to push data in without worrying too much about order of operations or transforming the data. When Diode moved into public preview, the main way to interact with it was via the Diode Python SDK, which covers a number of NetBox object types. The Diode Agent, also available in public preview for discovering and ingesting network device data into NetBox, is a great example of a tool built with the Python SDK.

Today, we’re announcing the Diode Go SDK. Go is rapidly becoming a key language in network automation due to its high performance, scalability, and built-in concurrency features, which are crucial for handling complex network operations efficiently. Its strong API support and widespread use in popular DevOps tools like Docker and Kubernetes make it an ideal choice for network engineers looking to integrate and customize these tools in large-scale environments. As Go continues to gain traction in the DevOps space, its adoption in network automation is set to increase.

The Diode Go SDK has functional parity with the Python SDK, and just like the Python SDK, it’s super easy and intuitive to use.  First, install it:

go get github.com/netboxlabs/diode-sdk-go

Here’s a quick example using the Diode Go SDK to create a device. In this example, a number of other related objects are automatically resolved or created as needed in NetBox, making it easy to take data from sources like spreadsheets or discovery tools and quickly load it all into NetBox’s model:

// Create a device
device := &diode.Device{
	Name: diode.String("Device A"),
	DeviceType: &diode.DeviceType{
		Model: diode.String("Device Type A"),
		Manufacturer: &diode.Manufacturer{
			Name: diode.String("Manufacturer A"),
                },
	},
	Platform: &diode.Platform{
		Name: diode.String("Platform A"),
		Manufacturer: &diode.Manufacturer{
			Name: diode.String("Manufacturer A"),
                },
	},
	Site: &diode.Site{
		Name: diode.String("Site ABC"),
	},
	Role: &diode.Role{
		Name: diode.String("Role ABC"),
	},
	Serial:   diode.String("123456"),
	AssetTag: diode.String("123456"),
	Status:   diode.String("active"),
	Comments: diode.String("Lorem ipsum dolor sit amet"),
	Tags: []*diode.Tag{
		{
			Name: diode.String("tag 1"),
		},
		{
			Name: diode.String("tag 3"),
		},
	},
}

You can find more examples using the Diode Go SDK here, and the code and docs for the SDK in its GitHub repository.

Right now, the Diode Go SDK supports many of the core data models in NetBox:

  • Device
  • Device Type
  • IP Address
  • Interface
  • Manufacturer
  • Platform
  • Prefix
  • Role
  • Site

Stay tuned for additional data model support in the coming weeks!

Are you a network automation engineer using Go in your applications? The Diode Go SDK makes integrating Diode into your Go applications simple and idiomatic, with strong typing and a focus on performance, making it easy to ingest your data into NetBox. Give it a go!

Share the Post:

Related Posts