awsnmgr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aws

type Aws struct {
	Profile string `json:"profile,omitempty"`
}

Aws related information

type Config

type Config struct {
	Name     string   `json:"name,omitempty"`
	Nuage    Nuage    `json:"nuage,omitempty"`
	Aws      Aws      `json:"aws,omitempty"`
	Topology Topology `json:"topology,omitempty"`
}

Config defines lab configuration as it is provided in the YAML file

type Connection

type Connection struct {
	A      *Endpoint
	B      *Endpoint
	Labels map[string]string
}

Connection is a struct that contains the information of a link between 2 containers

type ConnectionConfig

type ConnectionConfig struct {
	Endpoints []string
	Labels    map[string]string `yaml:"labels,omitempty"`
}

ConnectionConfig struct

type Device

type Device struct {
	Name           string
	DeviceID       *string
	DeviceARN      *string
	NuageNSGateway *vspk.NSGateway
	Index          int
	Kind           string
	Model          string
	Serial         string
	Vendor         string
	Region         string
	Site           *Site
	Endpoints      map[string]*Endpoint
}

Device is a struct that contains the information of a device element

type DeviceConfig

type DeviceConfig struct {
	Kind   string `yaml:"kind,omitempty"`
	Vendor string `yaml:"vendor,omitempty"`
	Model  string `yaml:"model,omitempty"`
	Serial string `yaml:"serial,omitempty"`
	Region string `yaml:"region,omitempty"`
}

DeviceConfig represents a configuration a given device can have

type Endpoint

type Endpoint struct {
	Device             *Device
	Site               *Site
	Name               string
	LinkID             *string
	LinkARN            *string
	NuagePort          *vspk.NSPort
	NuageVlan          *vspk.VLAN
	Provider           string
	BwUp               int32
	BwDown             int32
	Kind               string
	PublicIP           string
	Asn                int32
	Cidr               string
	Region             string
	CustomerGatewayID  *string
	CustomerGatewayARN *string
	CustomerGatewayIP  []string
	VPNConnState       string
}

Endpoint is a struct that contains information of a link endpoint

type NMgr

type NMgr struct {
	Config      *Config
	ConfigFile  *string
	Sites       map[string]*Site
	Devices     map[string]*Device
	Connections map[int]*Connection

	Region          *string
	GlobalNetworkID *string

	ClientNMgr *networkmanager.Client
	ClientEC2  map[string]*ec2.Client
	VsdUsr     *vspk.Me
	// contains filtered or unexported fields
}

NMgr structure that holds the structure of the network manager

func NewAWsNMgrNuage

func NewAWsNMgrNuage(opts ...Option) (*NMgr, error)

NewAWsNMgrNuage function defines a new dns-proxy

func (*NMgr) AssociateCustomerGateway

func (nm *NMgr) AssociateCustomerGateway(cgwArn, dID, lID *string) (*networkmanager.AssociateCustomerGatewayOutput, error)

AssociateCustomerGateway function

func (nm *NMgr) AssociateLink(dID, lID *string) (*networkmanager.AssociateLinkOutput, error)

AssociateLink function

func (*NMgr) CreateAWSNetworkMgrNetwork

func (nm *NMgr) CreateAWSNetworkMgrNetwork() error

CreateAWSNetworkMgrNetwork function

func (*NMgr) CreateAWSNetworkMgrSites

func (nm *NMgr) CreateAWSNetworkMgrSites() error

CreateAWSNetworkMgrSites function

func (*NMgr) CreateCustomerGateway

func (nm *NMgr) CreateCustomerGateway(region, name, ip *string, asn *int32) (*ec2.CreateCustomerGatewayOutput, error)

CreateCustomerGateway fucntion

func (*NMgr) CreateDevice

func (nm *NMgr) CreateDevice(name *string, d *Device) (*networkmanager.CreateDeviceOutput, error)

CreateDevice function

func (*NMgr) CreateGlobalNetwork

func (nm *NMgr) CreateGlobalNetwork(name *string) (*networkmanager.CreateGlobalNetworkOutput, error)

CreateGlobalNetwork function

func (nm *NMgr) CreateLink(name *string, ep *Endpoint) (*networkmanager.CreateLinkOutput, error)

CreateLink function

func (*NMgr) CreateSite

func (nm *NMgr) CreateSite(name *string, s *Site) (*networkmanager.CreateSiteOutput, error)

CreateSite function

func (*NMgr) CreateTransitGateway

func (nm *NMgr) CreateTransitGateway(region, name *string) (*ec2.CreateTransitGatewayOutput, error)

CreateTransitGateway fucntion

func (*NMgr) CreateVpc

func (nm *NMgr) CreateVpc(region, name, cidr *string) (*ec2.CreateVpcOutput, error)

CreateVpc function

func (*NMgr) CreateVpnConnection

func (nm *NMgr) CreateVpnConnection(region, name, cgwID, tgwID, cidr *string) (*ec2.CreateVpnConnectionOutput, error)

CreateVpnConnection function

func (*NMgr) DeleteAWSNetworkMgrNetwork

func (nm *NMgr) DeleteAWSNetworkMgrNetwork() error

DeleteAWSNetworkMgrNetwork function

func (*NMgr) DeleteAWSNetworkMgrSites

func (nm *NMgr) DeleteAWSNetworkMgrSites() error

DeleteAWSNetworkMgrSites function

func (*NMgr) DeleteCustomerGateway

func (nm *NMgr) DeleteCustomerGateway(region, id *string) (*ec2.DeleteCustomerGatewayOutput, error)

DeleteCustomerGateway function

func (*NMgr) DeleteDevice

func (nm *NMgr) DeleteDevice(d *string) (*networkmanager.DeleteDeviceOutput, error)

DeleteDevice function

func (*NMgr) DeleteDevices

func (nm *NMgr) DeleteDevices() error

DeleteDevices function

func (*NMgr) DeleteGlobalNetwork

func (nm *NMgr) DeleteGlobalNetwork() (*networkmanager.DeleteGlobalNetworkOutput, error)

DeleteGlobalNetwork function

func (nm *NMgr) DeleteLink(l *string) (*networkmanager.DeleteLinkOutput, error)

DeleteLink function

func (nm *NMgr) DeleteLinks() error

DeleteLinks function

func (*NMgr) DeleteSite

func (nm *NMgr) DeleteSite(s *string) (*networkmanager.DeleteSiteOutput, error)

DeleteSite function

func (*NMgr) DeleteSites

func (nm *NMgr) DeleteSites() error

DeleteSites function

func (*NMgr) DeleteTransitGateway

func (nm *NMgr) DeleteTransitGateway(region, id *string) (*ec2.DeleteTransitGatewayOutput, error)

DeleteTransitGateway function

func (*NMgr) DeleteVpnConnection

func (nm *NMgr) DeleteVpnConnection(region, id *string) (*ec2.DeleteVpnConnectionOutput, error)

DeleteVpnConnection function

func (*NMgr) DeregisterTransitGateway

func (nm *NMgr) DeregisterTransitGateway(arn *string) (*networkmanager.DeregisterTransitGatewayOutput, error)

DeregisterTransitGateway function

func (*NMgr) DescribeCustomerGateways

func (nm *NMgr) DescribeCustomerGateways(region, name *string) (*ec2.DescribeCustomerGatewaysOutput, error)

DescribeCustomerGateways function

func (*NMgr) DescribeGlobalNetworks

func (nm *NMgr) DescribeGlobalNetworks() (*networkmanager.DescribeGlobalNetworksOutput, error)

DescribeGlobalNetworks function

func (*NMgr) DescribeTransitGateways

func (nm *NMgr) DescribeTransitGateways(region, name *string) (*ec2.DescribeTransitGatewaysOutput, error)

DescribeTransitGateways function

func (*NMgr) DescribeVpcs

func (nm *NMgr) DescribeVpcs(region, name *string) (*ec2.DescribeVpcsOutput, error)

DescribeVpcs function

func (*NMgr) DescribeVpnConnections

func (nm *NMgr) DescribeVpnConnections(region, name *string) (*ec2.DescribeVpnConnectionsOutput, error)

DescribeVpnConnections function

func (*NMgr) DisassociateCustomerGateway

func (nm *NMgr) DisassociateCustomerGateway(cgwArn, dID, lID *string) (*networkmanager.DisassociateCustomerGatewayOutput, error)

DisassociateCustomerGateway function

func (nm *NMgr) DisassociateLink(dID, lID *string) (*networkmanager.DisassociateLinkOutput, error)

DisassociateLink function

func (*NMgr) GetCustomerGatewayAssociations

func (nm *NMgr) GetCustomerGatewayAssociations() (*networkmanager.GetCustomerGatewayAssociationsOutput, error)

GetCustomerGatewayAssociations function

func (*NMgr) GetDevice

func (nm *NMgr) GetDevice(siteID *string) (*networkmanager.GetDevicesOutput, error)

GetDevice function

func (*NMgr) GetDevices

func (nm *NMgr) GetDevices() (*networkmanager.GetDevicesOutput, error)

GetDevices function

func (nm *NMgr) GetLink(siteID *string) (*networkmanager.GetLinksOutput, error)

GetLink function

func (nm *NMgr) GetLinks() (*networkmanager.GetLinksOutput, error)

GetLinks function

func (*NMgr) GetSites

func (nm *NMgr) GetSites() (*networkmanager.GetSitesOutput, error)

GetSites function

func (*NMgr) GetTopology

func (nm *NMgr) GetTopology(topo string) error

GetTopology parses the topology file into c.Conf structure as well as populates the TopoFile structure with the topology file related information

func (*NMgr) GetTransitGatewayRegistrations

func (nm *NMgr) GetTransitGatewayRegistrations() (*networkmanager.GetTransitGatewayRegistrationsOutput, error)

GetTransitGatewayRegistrations fucntion

func (*NMgr) NewConnection

func (nm *NMgr) NewConnection(cCfg ConnectionConfig) *Connection

NewConnection initializes a new link object

func (*NMgr) NewDevice

func (nm *NMgr) NewDevice(name string, cfg DeviceConfig, idx int) error

NewDevice initializes a new device object

func (*NMgr) NewEndpoint

func (nm *NMgr) NewEndpoint(i int, e string, l map[string]string) *Endpoint

NewEndpoint initializes a new endpoint object

func (*NMgr) NewSite

func (nm *NMgr) NewSite(name string, cfg SiteConfig, idx int) error

NewSite initializes a new site object

func (*NMgr) ParseTopology

func (nm *NMgr) ParseTopology() error

ParseTopology parses the configuration topology

func (*NMgr) RegisterTransitGateway

func (nm *NMgr) RegisterTransitGateway(arn *string) (*networkmanager.RegisterTransitGatewayOutput, error)

RegisterTransitGateway function

type Nuage

type Nuage struct {
	Enterprise string `json:"enterprise,omitempty"`
	URL        string `json:"url,omitempty"`
}

Nuage related information

type Option

type Option func(nm *NMgr)

Option struct

func WithConfigFile

func WithConfigFile(file string) Option

WithConfigFile function

func WithDebug

func WithDebug(d bool) Option

WithDebug function

func WithTimeout

func WithTimeout(dur time.Duration) Option

WithTimeout function

type Site

type Site struct {
	Name      string
	SiteID    *string
	Index     int
	Street    string
	Number    int
	City      string
	State     string
	Country   string
	Devices   map[string]*Device
	Endpoints map[string]*Endpoint
}

Site is a struct that contains the information of a site element

type SiteConfig

type SiteConfig struct {
	Street  string `yaml:"street,omitempty"`
	Number  int    `yaml:"number,omitempty"`
	City    string `yaml:"city,omitempty"`
	State   string `yaml:"state,omitempty"`
	Country string `yaml:"country,omitempty"`
}

SiteConfig represents a configuration a given site can have

type Topology

type Topology struct {
	Sites       map[string]SiteConfig   `yaml:"sites,omitempty"`
	DeviceKinds map[string]DeviceConfig `yaml:"device-kinds,omitempty"`
	Devices     map[string]DeviceConfig `yaml:"devices,omitempty"`
	Connections []ConnectionConfig      `yaml:"connections,omitempty"`
}

Topology represents a lab topology

type VpnConnection

type VpnConnection struct {
	XMLName                 xml.Name `xml:"vpn_connection"`
	Text                    string   `xml:",chardata"`
	ID                      string   `xml:"id,attr"`
	CustomerGatewayID       string   `xml:"customer_gateway_id"`
	VpnGatewayID            string   `xml:"vpn_gateway_id"`
	VpnConnectionType       string   `xml:"vpn_connection_type"`
	VpnConnectionAttributes string   `xml:"vpn_connection_attributes"`
	IpsecTunnel             []struct {
		Text            string `xml:",chardata"`
		CustomerGateway struct {
			Text                 string `xml:",chardata"`
			TunnelOutsideAddress struct {
				Text      string `xml:",chardata"`
				IPAddress string `xml:"ip_address"`
			} `xml:"tunnel_outside_address"`
			TunnelInsideAddress struct {
				Text        string `xml:",chardata"`
				IPAddress   string `xml:"ip_address"`
				NetworkMask string `xml:"network_mask"`
				NetworkCidr string `xml:"network_cidr"`
			} `xml:"tunnel_inside_address"`
		} `xml:"customer_gateway"`
		VpnGateway struct {
			Text                 string `xml:",chardata"`
			TunnelOutsideAddress struct {
				Text      string `xml:",chardata"`
				IPAddress string `xml:"ip_address"`
			} `xml:"tunnel_outside_address"`
			TunnelInsideAddress struct {
				Text        string `xml:",chardata"`
				IPAddress   string `xml:"ip_address"`
				NetworkMask string `xml:"network_mask"`
				NetworkCidr string `xml:"network_cidr"`
			} `xml:"tunnel_inside_address"`
		} `xml:"vpn_gateway"`
		Ike struct {
			Text                   string `xml:",chardata"`
			AuthenticationProtocol string `xml:"authentication_protocol"`
			EncryptionProtocol     string `xml:"encryption_protocol"`
			Lifetime               string `xml:"lifetime"`
			PerfectForwardSecrecy  string `xml:"perfect_forward_secrecy"`
			Mode                   string `xml:"mode"`
			PreSharedKey           string `xml:"pre_shared_key"`
		} `xml:"ike"`
		Ipsec struct {
			Text                          string `xml:",chardata"`
			Protocol                      string `xml:"protocol"`
			AuthenticationProtocol        string `xml:"authentication_protocol"`
			EncryptionProtocol            string `xml:"encryption_protocol"`
			Lifetime                      string `xml:"lifetime"`
			PerfectForwardSecrecy         string `xml:"perfect_forward_secrecy"`
			Mode                          string `xml:"mode"`
			ClearDfBit                    string `xml:"clear_df_bit"`
			FragmentationBeforeEncryption string `xml:"fragmentation_before_encryption"`
			TCPMssAdjustment              string `xml:"tcp_mss_adjustment"`
			DeadPeerDetection             struct {
				Text     string `xml:",chardata"`
				Interval string `xml:"interval"`
				Retries  string `xml:"retries"`
			} `xml:"dead_peer_detection"`
		} `xml:"ipsec"`
	} `xml:"ipsec_tunnel"`
}

VpnConnection struct

Jump to

Keyboard shortcuts

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