Documentation
¶
Index ¶
- Constants
- func InitPolicyMgr(stateDriver core.StateDriver) error
- type CfgEndpointState
- type CfgNetworkState
- type EndpointGroupState
- type EpgPolicy
- func (gp *EpgPolicy) AddRule(rule *contivModel.Rule) error
- func (gp *EpgPolicy) Clear() error
- func (gp *EpgPolicy) DelRule(rule *contivModel.Rule) error
- func (gp *EpgPolicy) Delete() error
- func (gp *EpgPolicy) Read(id string) error
- func (gp *EpgPolicy) ReadAll() ([]core.State, error)
- func (gp *EpgPolicy) WatchAll(rsps chan core.WatchState) error
- func (gp *EpgPolicy) Write() error
- type GlobConfig
- type RuleMap
Constants ¶
const ( // StateBasePath is the base path for all state operations. StateBasePath = "/contiv.io/" // StateConfigPath is the path to the root of the configuration state StateConfigPath = StateBasePath + "state/" )
Variables ¶
This section is empty.
Functions ¶
func InitPolicyMgr ¶
func InitPolicyMgr(stateDriver core.StateDriver) error
InitPolicyMgr initializes the policy manager
Types ¶
type CfgEndpointState ¶
type CfgEndpointState struct { core.CommonState NetID string `json:"netID"` ContName string `json:"contName"` ServiceName string `json:"serviceName"` EndpointGroupID int `json:"endpointGroupId"` AttachUUID string `json:"attachUUID"` IPAddress string `json:"ipAddress"` MacAddress string `json:"macAddress"` HomingHost string `json:"homingHost"` IntfName string `json:"intfName"` VtepIP string `json:"vtepIP"` }
CfgEndpointState implements the State interface for an endpoint implemented using vlans with ovs. The state is stored as Json objects.
func (*CfgEndpointState) Read ¶
func (s *CfgEndpointState) Read(id string) error
Read the state for a given identifier.
func (*CfgEndpointState) ReadAll ¶
func (s *CfgEndpointState) ReadAll() ([]core.State, error)
ReadAll reads all state objects for the endpoints.
func (*CfgEndpointState) WatchAll ¶
func (s *CfgEndpointState) WatchAll(rsps chan core.WatchState) error
WatchAll fills a channel on each state event related to endpoints.
type CfgNetworkState ¶
type CfgNetworkState struct { core.CommonState Tenant string `json:"tenant"` NetworkName string `json:"networkName"` PktTagType string `json:"pktTagType"` PktTag int `json:"pktTag"` ExtPktTag int `json:"extPktTag"` SubnetIP string `json:"subnetIP"` SubnetLen uint `json:"subnetLen"` Gateway string `json:"gateway"` EpCount int `json:"epCount"` IPAllocMap bitset.BitSet `json:"ipAllocMap"` SubnetIsAllocated bool `json:"subnetIsAllocated"` DNSServer string `json:"dnsServer"` }
CfgNetworkState implements the State interface for a network implemented using vlans with ovs. The state is stored as Json objects.
func (*CfgNetworkState) Read ¶
func (s *CfgNetworkState) Read(id string) error
Read the state for a given identifier
func (*CfgNetworkState) ReadAll ¶
func (s *CfgNetworkState) ReadAll() ([]core.State, error)
ReadAll state and return the collection.
func (*CfgNetworkState) WatchAll ¶
func (s *CfgNetworkState) WatchAll(rsps chan core.WatchState) error
WatchAll state transitions and send them through the channel.
type EndpointGroupState ¶
type EndpointGroupState struct { core.CommonState Name string `json:"name"` Tenant string `json:"tenant"` NetworkName string `json:"networkName"` PktTagType string `json:"pktTagType"` PktTag int `json:"pktTag"` ExtPktTag int `json:"extPktTag"` }
EndpointGroupState implements the State interface for endpoint group implemented using vlans with ovs. The state is stored as Json objects.
func (*EndpointGroupState) Clear ¶
func (s *EndpointGroupState) Clear() error
Clear removes the state.
func (*EndpointGroupState) Read ¶
func (s *EndpointGroupState) Read(id string) error
Read the state for a given identifier
func (*EndpointGroupState) ReadAll ¶
func (s *EndpointGroupState) ReadAll() ([]core.State, error)
ReadAll state and return the collection.
func (*EndpointGroupState) WatchAll ¶
func (s *EndpointGroupState) WatchAll(rsps chan core.WatchState) error
WatchAll state transitions and send them through the channel.
type EpgPolicy ¶
type EpgPolicy struct { core.CommonState 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
type GlobConfig ¶
type GlobConfig struct { core.CommonState NwInfraType string `json:"nw-infra-type"` }
GlobConfig is the global configuration applicable to everything
func (*GlobConfig) Clear ¶
func (s *GlobConfig) Clear() error
Clear removes the configuration from the state store.
func (*GlobConfig) Read ¶
func (s *GlobConfig) Read(id string) error
Read the state in for a given ID.
type RuleMap ¶
type RuleMap struct { Rule *contivModel.Rule // policy rule OfnetRules map[string]*ofnet.OfnetPolicyRule // Ofnet rules associated with this policy rule }
RuleMap maps a policy rule to list of ofnet rules