master

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2015 License: Apache-2.0 Imports: 13 Imported by: 30

Documentation

Index

Constants

View Source
const (
	// DaemonURL is default url used by netmaster to listen for http requests
	DaemonURL = "localhost:9999"

	//DesiredConfigRESTEndpoint is the REST endpoint to post desired configuration
	DesiredConfigRESTEndpoint = "desired-config"
	//AddConfigRESTEndpoint is the REST endpoint to post configuration additions
	AddConfigRESTEndpoint = "add-config"
	// DelConfigRESTEndpoint is the REST endpoint to post configuration deletions
	DelConfigRESTEndpoint = "del-config"
	//HostBindingConfigRESTEndpoint is the REST endpoint to post host binding configuration
	HostBindingConfigRESTEndpoint = "host-bindings-config"
	//GetEndpointRESTEndpoint is the REST endpoint to request info of an endpoint
	GetEndpointRESTEndpoint = "endpoint"
	//GetEndpointsRESTEndpoint is the REST endpoint to request info of all endpoints
	GetEndpointsRESTEndpoint = "endpoints"
	//GetNetworkRESTEndpoint is the REST endpoint to request info of a network
	GetNetworkRESTEndpoint = "network"
	//GetNetworksRESTEndpoint is the REST endpoint to request info of all networks
	GetNetworksRESTEndpoint = "networks"
)

Variables

This section is empty.

Functions

func CreateEndpoints

func CreateEndpoints(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error

CreateEndpoints creates the endpoints for a given tenant.

func CreateEpBindings

func CreateEpBindings(epBindings *[]intent.ConfigEP) error

CreateEpBindings binds an endpoint to a host by updating host-label info in driver's endpoint configuration.

func CreateHost

func CreateHost(stateDriver core.StateDriver, host *intent.ConfigHost) error

CreateHost creates a host in the state configuration.

func CreateNetworks

func CreateNetworks(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error

CreateNetworks creates the necessary virtual networks for the tenant provided by ConfigTenant.

func CreateTenant

func CreateTenant(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error

CreateTenant sets the tenant's state according to the passed ConfigTenant.

func DeleteDelta

func DeleteDelta(allCfg *intent.Config) error

DeleteDelta deletes any existing configuration from netmaster's statestore that is not present in the configuration passed. This may result in generating Delete triggers for the netplugin

func DeleteEndpointID

func DeleteEndpointID(stateDriver core.StateDriver, epID string) error

DeleteEndpointID deletes an endpoint by ID.

func DeleteEndpoints

func DeleteEndpoints(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error

DeleteEndpoints deletes the endpoints for the tenant.

func DeleteHost

func DeleteHost(stateDriver core.StateDriver, host *intent.ConfigHost) error

DeleteHost deletes a host by its ConfigHost state

func DeleteHostID

func DeleteHostID(stateDriver core.StateDriver, hostName string) error

DeleteHostID deletes a host by ID.

func DeleteNetworkID

func DeleteNetworkID(stateDriver core.StateDriver, netID string) error

DeleteNetworkID removes a network by ID.

func DeleteNetworks

func DeleteNetworks(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error

DeleteNetworks removes all the virtual networks for a given tenant.

func DeleteTenant

func DeleteTenant(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error

DeleteTenant deletes a tenant from the state store based on its ConfigTenant.

func DeleteTenantID

func DeleteTenantID(stateDriver core.StateDriver, tenantID string) error

DeleteTenantID deletes a tenant from the state store, by ID.

func ProcessAdditions

func ProcessAdditions(allCfg *intent.Config) (err error)

ProcessAdditions adds the configuration passed to netmaster's statestore. This may result in generating Add/Create triggers for the netplugin.

func ProcessDeletions

func ProcessDeletions(allCfg *intent.Config) (err error)

ProcessDeletions deletes the configuration passed from netmaster's statestore. This may result in generating Delete triggers for the netplugin.

Types

type HostConfig

type HostConfig struct {
	core.CommonState
	Name   string `json:"name"`
	Intf   string `json:"intf"`
	VtepIP string `json:"vtepIp"`
	NetID  string `json:"netId"`
}

HostConfig is the state carried for network + host maps.

func (*HostConfig) Clear

func (s *HostConfig) Clear() error

Clear purges the state for this host.

func (*HostConfig) Read

func (s *HostConfig) Read(hostname string) error

Read the host state from the state system, provided a hostname.

func (*HostConfig) ReadAll

func (s *HostConfig) ReadAll() ([]core.State, error)

ReadAll implements reading the state for all hosts.

func (*HostConfig) Write

func (s *HostConfig) Write() error

Write the master host configuration to the state system.

type NwConfig

type NwConfig struct {
	core.CommonState
	Tenant     string `json:"tenant"`
	PktTagType string `json:"pktTagType"`
	PktTag     string `json:"pktTag"`
	SubnetIP   string `json:"subnetIP"`
	SubnetLen  uint   `json:"subnetLen"`
	DefaultGw  string `json:"defaultGw"`
}

NwConfig is the network configuration for a given tenant+network

func (*NwConfig) Clear

func (s *NwConfig) Clear() error

Clear removes the configuration from the state store.

func (*NwConfig) Read

func (s *NwConfig) Read(id string) error

Read the state in for a given ID.

func (*NwConfig) ReadAll

func (s *NwConfig) ReadAll() ([]core.State, error)

ReadAll reads all the state for master network configurations and returns it.

func (*NwConfig) Write

func (s *NwConfig) Write() error

Write the state

Jump to

Keyboard shortcuts

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