models

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Hostname   string   `yaml:"hostname"`
	Metadata   Metadata `yaml:"metadata"`
	IsDeployed bool     `yaml:"is_deployed"`
	// RouterBgp                    RouterBgp              `yaml:"router_bgp"`
	// AddressFamilyIpv4            AddressFamilyIpv4      `yaml:"address_family_ipv4"`
	// AddressFamilyEvpn            AddressFamilyEvpn      `yaml:"address_family_evpn"`
	// Vrfs                         []Vrf                  `yaml:"vrfs"`
	Vlans []Vlan `yaml:"vlans"`
	// StaticRoutes                 []StaticRoute          `yaml:"static_routes"`
	ServiceRoutingProtocolsModel string `yaml:"service_routing_protocols_model"`
	IpRouting                    bool   `yaml:"ip_routing"`
	// DaemonTerminattr             DaemonTerminattr       `yaml:"daemon_terminattr"`
	// VlanInternalOrder            VlanInternalOrder      `yaml:"vlan_internal_order"`
	// IpNameServers                []IpNameServer         `yaml:"ip_name_servers"`
	// SpanningTree                 SpanningTree           `yaml:"spanning_tree"`
	// LocalUsers                   []LocalUser            `yaml:"local_users"`
	// ManagementInterfaces         []ManagementInterface  `yaml:"management_interfaces"`
	// ManagementApiHttp            ManagementApiHttp      `yaml:"management_api_http"`
	VlanInterfaces []VlanInterface `yaml:"vlan_interfaces"`
	// PortChannelInterfaces        []PortChannelInterface `yaml:"port_channel_interfaces"`
	// EthernetInterfaces           []EthernetInterface    `yaml:"ethernet_interfaces"`
	// MlagConfiguration            MlagConfiguration      `yaml:"mlag_configuration"`
	// RouteMaps                    []RouteMap             `yaml:"route_maps"`
	// LoopbackInterfaces           []LoopbackInterface    `yaml:"loopback_interfaces"`
	// PrefixLists                  []PrefixList           `yaml:"prefix_lists"`
	// RouterBfd                    RouterBfd              `yaml:"router_bfd"`
	// IpIgmpSnooping               IpIgmpSnooping         `yaml:"ip_igmp_snooping"`
	IpVirtualRouterMacAddress string `yaml:"ip_virtual_router_mac_address"`
	// VxlanInterface               VxlanInterface         `yaml:"vxlan_interface"`
	// VirtualSourceNatVrfs         []VirtualSourceNatVrf  `yaml:"virtual_source_nat_vrfs"`
	// Ntp                          Ntp                    `yaml:"ntp"`
	Manufacturer string `yaml:"manufacturer,omitempty"`
	DeviceType   string `yaml:"device_type,omitempty"`
	DeviceRole   string `yaml:"device_role,omitempty"`
	Site         string `yaml:"site,omitempty"`
	Model        string `yaml:"model,omitempty"`
}

func NewConfigFromYaml

func NewConfigFromYaml(yamlFile string) (*Config, error)

type L2Vlan added in v0.0.5

type L2Vlan struct {
	ID   int    `yaml:"id"`
	Name string `yaml:"name"`
}

type Metadata

type Metadata struct {
	Platform string `yaml:"platform"`
}

Example of a nested struct

type NetworkService added in v0.0.5

type NetworkService struct {
	Tenants []Tenant `yaml:"tenants"`
}

type RouteTarget

type RouteTarget struct {
	RouteTarget string `yaml:"route_target"`
}

type RouteTargets

type RouteTargets struct {
	Both []RouteTarget `yaml:"both"`
}

type SVI added in v0.0.5

type SVI struct {
	ID               int    `yaml:"id"`
	Name             string `yaml:"name"`
	Enabled          bool   `yaml:"enabled"`
	IpAddressVirtual string `yaml:"ip_address_virtual"`
}

func NewSVI added in v0.0.5

func NewSVI(subnet string) *SVI

type Tenant added in v0.0.5

type Tenant struct {
	Name          string   `yaml:"name"`
	MacVrfVniBase int      `yaml:"mac_vrf_vni_base"`
	VRFs          []VRF    `yaml:"vrfs"`
	L2Vlans       []L2Vlan `yaml:"l2vlans"`
}

type VRF added in v0.0.5

type VRF struct {
	Name           string         `yaml:"name"`
	VrfVni         int            `yaml:"vrf_vni"`
	VtepDiagnostic VtepDiagnostic `yaml:"vtep_diagnostic"`
	SVIs           []SVI          `yaml:"svis"`
}

type Vlan

type Vlan struct {
	ID                 int          `yaml:"id"`
	Tenant             string       `yaml:"tenant"`
	Rd                 string       `yaml:"rd"`
	RouteTargets       RouteTargets `yaml:"route_targets"`
	RedistributeRoutes []string     `yaml:"redistribute_routes"`
	Name               string       `yaml:"name"`
	TrunkGroups        []string     `yaml:"trunk_groups"`
}

type VlanInterface

type VlanInterface struct {
	Name             string `yaml:"name"`
	Description      string `yaml:"description"`
	Shutdown         bool   `yaml:"shutdown"`
	Mtu              int    `yaml:"mtu"`
	IpAddress        string `yaml:"ip_address"`
	IpAddressVirtual string `yaml:"ip_address_virtual"`
	Vrf              string `yaml:"vrf"`
	NoAutostate      bool   `yaml:"no_autostate"`
	Tenant           string `yaml:"tenant"`
	Type             string `yaml:"type"`
}

type VtepDiagnostic added in v0.0.5

type VtepDiagnostic struct {
	Loopback        int    `yaml:"loopback"`
	LoopbackIpRange string `yaml:"loopback_ip_range"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL