Documentation
¶
Index ¶
- Constants
- Variables
- func CreateEndpoint(stateDriver core.StateDriver, network *intent.ConfigNetwork, ...) error
- func CreateEndpoints(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
- func CreateEpBindings(epBindings *[]intent.ConfigEP) error
- func CreateHost(stateDriver core.StateDriver, host *intent.ConfigHost) error
- func CreateNetwork(network intent.ConfigNetwork, stateDriver core.StateDriver, tenantName string) error
- func CreateNetworks(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
- func CreateTenant(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
- func DeleteDelta(allCfg *intent.Config) error
- func DeleteEndpointID(stateDriver core.StateDriver, epID string) error
- func DeleteEndpoints(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
- func DeleteHost(stateDriver core.StateDriver, host *intent.ConfigHost) error
- func DeleteHostID(stateDriver core.StateDriver, hostName string) error
- func DeleteNetworkID(stateDriver core.StateDriver, netID string) error
- func DeleteNetworks(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
- func DeleteTenant(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
- func DeleteTenantID(stateDriver core.StateDriver, tenantID string) error
- func InitPolicyMgr() error
- func PolicyAddRule(policy *contivModel.Policy, rule *contivModel.Rule) error
- func PolicyAttach(epg *contivModel.EndpointGroup, policy *contivModel.Policy) error
- func PolicyDelRule(policy *contivModel.Policy, rule *contivModel.Rule) error
- func PolicyDetach(epg *contivModel.EndpointGroup, policy *contivModel.Policy) error
- func ProcessAdditions(allCfg *intent.Config) (err error)
- func ProcessDeletions(allCfg *intent.Config) (err error)
- type EpgPolicy
- type HostConfig
- type NwConfig
- type RuleMap
Constants ¶
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 ¶
var EpgPolicyExists = core.Errorf("Epg policy exists")
EpgPolicyExists is a well known exported error
Functions ¶
func CreateEndpoint ¶
func CreateEndpoint(stateDriver core.StateDriver, network *intent.ConfigNetwork, nwCfg *drivers.OvsCfgNetworkState, ep *intent.ConfigEP) error
CreateEndpoint creates an endpoint
func CreateEndpoints ¶
func CreateEndpoints(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
CreateEndpoints creates the endpoints for a given tenant.
func CreateEpBindings ¶
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 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 CreateTenant ¶
func CreateTenant(stateDriver core.StateDriver, tenant *intent.ConfigTenant) error
CreateTenant sets the tenant's state according to the passed ConfigTenant.
func DeleteDelta ¶
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 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 ProcessAdditions ¶
ProcessAdditions adds the configuration passed to netmaster's statestore. This may result in generating Add/Create triggers for the netplugin.
func ProcessDeletions ¶
ProcessDeletions deletes the configuration passed from netmaster's statestore. This may result in generating Delete triggers for the netplugin.
Types ¶
type EpgPolicy ¶
type EpgPolicy struct {
EpgPolicyKey string // Key for this epg policy
EndpointGroupID int // Endpoint group where this policy is attached to
RuleMaps map[string]*RuleMap // rules associated with this policy
}
EpgPolicy has an instance of policy attached to an endpoint group
func FindEpgPolicy ¶
FindEpgPolicy finds an epg policy
func NewEpgPolicy ¶
NewEpgPolicy creates a new policy instance attached to an endpoint group
func (*EpgPolicy) AddRule ¶
func (gp *EpgPolicy) AddRule(rule *contivModel.Rule) error
AddRule adds a rule to epg policy
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) 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
type RuleMap ¶
type RuleMap struct {
Rule *contivModel.Rule // policy rule
// contains filtered or unexported fields
}
RuleMap maps a policy rule to list of ofnet rules