master

package
v0.0.0-...-8dd92da Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//GetVersionRESTEndpoint is the REST endpoint to get version info
	GetVersionRESTEndpoint = "version"
	// GetInfoRESTEndpoint is the REST endpoint to get netmaster info
	GetInfoRESTEndpoint = "info"
	//GetServiceRESTEndpoint is the REST endpoint to get service info of a service
	GetServiceRESTEndpoint = "service"
	//GetServicesRESTEndpoint is the REST endpoint to request info of all services
	GetServicesRESTEndpoint = "services"
)

Variables

View Source
var EpgPolicyExists = core.Errorf("Epg policy exists")

EpgPolicyExists is a well known exported error

Functions

func AddBgp

func AddBgp(stateDriver core.StateDriver, bgpCfg *intent.ConfigBgp) error

AddBgp adds to the etcd state

func AllocAddressHandler

func AllocAddressHandler(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

AllocAddressHandler allocates addresses

func CreateEndpoint

func CreateEndpoint(stateDriver core.StateDriver, nwCfg *mastercfg.CfgNetworkState,
	epReq *CreateEndpointRequest) (*mastercfg.CfgEndpointState, error)

CreateEndpoint creates an endpoint

func CreateEndpointGroup

func CreateEndpointGroup(tenantName, networkName, groupName, ipPool, cfgdTag string) error

CreateEndpointGroup handles creation of endpoint group

func CreateEndpointHandler

func CreateEndpointHandler(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

CreateEndpointHandler handles create endpoint requests

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 CreateGlobal

func CreateGlobal(stateDriver core.StateDriver, gc *intent.ConfigGlobal) error

CreateGlobal sets the global state

func CreateNetwork

func CreateNetwork(network intent.ConfigNetwork, stateDriver core.StateDriver, tenantName string) error

CreateNetwork creates a network from intent

func CreateNetworks

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

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

func CreateServiceLB

func CreateServiceLB(stateDriver core.StateDriver, serviceLbCfg *intent.ConfigServiceLB) error

CreateServiceLB adds to the etcd state

func CreateTenant

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

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

func DeleteBgp

func DeleteBgp(stateDriver core.StateDriver, hostname string) error

DeleteBgp deletes from etcd state

func DeleteEndpointGroup

func DeleteEndpointGroup(tenantName, groupName string) error

DeleteEndpointGroup handles endpoint group deletes

func DeleteEndpointHandler

func DeleteEndpointHandler(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

DeleteEndpointHandler handles delete endpoint requests

func DeleteEndpointID

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

DeleteEndpointID deletes an endpoint by ID.

func DeleteEndpoints

func DeleteEndpoints(hostAddr string) error

DeleteEndpoints deletes the endpoints on a give host

func DeleteGlobal

func DeleteGlobal(stateDriver core.StateDriver) error

DeleteGlobal delete global state

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 DeleteServiceLB

func DeleteServiceLB(stateDriver core.StateDriver, serviceName string, tenantName string) error

DeleteServiceLB deletes from etcd state

func DeleteTenant

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

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

func GetClusterMode

func GetClusterMode() string

GetClusterMode gets the cluster mode of the contiv plugin

func GetServiceID

func GetServiceID(servicename string, tenantname string) string

GetServiceID returns service id for etcd lookup

func IsAciConfigured

func IsAciConfigured() (res bool, err error)

IsAciConfigured returns true if aci is configured on netmaster.

func ListAllocatedIPs

func ListAllocatedIPs(nwCfg *mastercfg.CfgNetworkState) string

ListAllocatedIPs returns a string of allocated IPs in a network

func ListAvailableIPs

func ListAvailableIPs(nwCfg *mastercfg.CfgNetworkState) string

ListAvailableIPs returns a string of available IPs in a network

func PolicyAddRule

func PolicyAddRule(policy *contivModel.Policy, rule *contivModel.Rule) error

PolicyAddRule adds a rule to existing policy

func PolicyAttach

func PolicyAttach(epg *contivModel.EndpointGroup, policy *contivModel.Policy) error

PolicyAttach attaches a policy to an endpoint and adds associated rules to policyDB

func PolicyDelRule

func PolicyDelRule(policy *contivModel.Policy, rule *contivModel.Rule) error

PolicyDelRule removes a rule from existing policy

func PolicyDetach

func PolicyDetach(epg *contivModel.EndpointGroup, policy *contivModel.Policy) error

PolicyDetach detaches policy from an endpoint and removes associated rules from policyDB

func ReleaseAddressHandler

func ReleaseAddressHandler(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

ReleaseAddressHandler releases addresses

func RestoreServiceProviderLBDb

func RestoreServiceProviderLBDb()

RestoreServiceProviderLBDb restores provider and servicelb db

func SetClusterMode

func SetClusterMode(cm string) error

SetClusterMode sets the cluster mode for the contiv plugin

func SvcProviderUpdate

func SvcProviderUpdate(serviceID string, isDelete bool) error

SvcProviderUpdate propagates service provider updates to netplugins

func UpdateEndpointGroup

func UpdateEndpointGroup(bandwidth, groupName, tenantName string, Dscp, burst int) error

UpdateEndpointGroup updates the endpointgroups

func UpdateEndpointHandler

func UpdateEndpointHandler(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

UpdateEndpointHandler handles update event from netplugin

func UpdateGlobal

func UpdateGlobal(stateDriver core.StateDriver, gc *intent.ConfigGlobal) error

UpdateGlobal updates the global state

Types

type AddressAllocRequest

type AddressAllocRequest struct {
	NetworkID            string // Unique identifier for the network
	AddressPool          string // Address pool from which to allocate the address
	PreferredIPv4Address string // Preferred address
}

AddressAllocRequest is the address request from netplugin

type AddressAllocResponse

type AddressAllocResponse struct {
	NetworkID   string // Unique identifier for the network
	IPv4Address string // Allocated address
}

AddressAllocResponse is the response from netmaster

type AddressReleaseRequest

type AddressReleaseRequest struct {
	NetworkID   string // Unique identifier for the network
	IPv4Address string // Allocated address
}

AddressReleaseRequest is the release request from netplugin

type CreateEndpointRequest

type CreateEndpointRequest struct {
	TenantName   string          // tenant name
	NetworkName  string          // network name
	ServiceName  string          // service name
	EndpointID   string          // Unique identifier for the endpoint
	EPCommonName string          // Common name for the endpoint
	ConfigEP     intent.ConfigEP // Endpoint configuration
}

CreateEndpointRequest has the endpoint create request from netplugin

type CreateEndpointResponse

type CreateEndpointResponse struct {
	EndpointConfig mastercfg.CfgEndpointState // Endpoint config
}

CreateEndpointResponse has the endpoint create response from netmaster

type DeleteEndpointRequest

type DeleteEndpointRequest struct {
	TenantName  string // tenant name
	NetworkName string // network name
	ServiceName string // service name
	EndpointID  string // Unique identifier for the endpoint
	IPv4Address string // Allocated IPv4 address for the endpoint
}

DeleteEndpointRequest is the delete endpoint request from netplugin

type DeleteEndpointResponse

type DeleteEndpointResponse struct {
	EndpointConfig mastercfg.CfgEndpointState // Endpoint config
}

DeleteEndpointResponse is the delete endpoint response from netmaster

type UpdateEndpointRequest

type UpdateEndpointRequest struct {
	IPAddress    string            // provider IP
	ContainerID  string            // container id
	Labels       map[string]string // lables
	Tenant       string
	Network      string
	Event        string
	EndpointID   string
	EPCommonName string // Common name for the endpoint
}

UpdateEndpointRequest has the update endpoint request from netplugin

type UpdateEndpointResponse

type UpdateEndpointResponse struct {
	IPAddress string // provider IP
}

UpdateEndpointResponse is service provider update request from netplugin

Jump to

Keyboard shortcuts

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