Documentation ¶
Index ¶
- Constants
- func GetTaskURIAndObjectIdFromResponse(response map[string]interface{}) (string, string)
- type L3Forward
- type L3ForwardStore
- type NetworkConfigRequest
- type NetworkManager
- func (nm *NetworkManager) DeleteL3Forward(instanceId, l3ForwardID string) error
- func (nm *NetworkManager) GetL3ForwardsFromInstance(instanceId string, controllerID string) (StaticRouteMap, error)
- func (nm *NetworkManager) GetTaskStatus(taskRef string) (string, string, error)
- func (nm *NetworkManager) HandleL3ForwardRequest(req *NetworkConfigRequest, l3Forward *L3Forward)
- func (nm *NetworkManager) NetworkConfigHandler()
- func (nm *NetworkManager) NetworkRequestHandler(store interface{})
- func (nm *NetworkManager) PostL3Forward(apiURL, authToken string, l3ForwardReq *L3Forward) error
- func (nm *NetworkManager) SetInstanceIds(bigIpConfigs []cisapiv1.BigIpConfig, controllerID string) error
- type RouteStore
- type StaticRouteConfig
- type StaticRouteMap
Constants ¶
const ( InstancesURI = "/api/v1/spaces/default/instances/" InventoryURI = "/api/device/v1/inventory" L3Forwards = "/l3forwards" TaskBaseURI = "/api/task-manager" L3RouteGateway = "L3RouteGateway" Completed = "COMPLETED" Failed = "FAILED" Create = "CREATE" Delete = "DELETE" DefaultL3Network = "Default L3-Network" )
Variables ¶
This section is empty.
Functions ¶
func GetTaskURIAndObjectIdFromResponse ¶
GetTaskURIAndObjectIdFromResponse pafses the JSON response from the response
Types ¶
type L3Forward ¶
type L3Forward struct { ID string `json:"id,omitempty"` VRF string `json:"vrf"` Name string `json:"name"` Config StaticRouteConfig `json:"config"` }
L3Forward struct represents the structure of the L3Forward in the JSON response
type L3ForwardStore ¶
type L3ForwardStore struct { InstanceStaticRoutes map[string]StaticRouteMap CachedInstanceStaticRoutes map[string]map[StaticRouteConfig]struct{} sync.RWMutex }
L3ForwardStore static route config store for each instance key is the instance id
type NetworkConfigRequest ¶
type NetworkConfigRequest struct { NetworkConfig interface{} BigIpInstanceId string Action string // contains filtered or unexported fields }
NetworkConfigRequest represents the network config request
type NetworkManager ¶
type NetworkManager struct { CMTokenManager *tokenmanager.TokenManager L3ForwardStore *L3ForwardStore DeviceMap map[string]string ClusterName string NetworkChan chan *NetworkConfigRequest // contains filtered or unexported fields }
NetworkManager is responsible for managing the network objects on central manager.
func NewNetworkManager ¶
func NewNetworkManager(tm *tokenmanager.TokenManager, clusterName string) *NetworkManager
func (*NetworkManager) DeleteL3Forward ¶
func (nm *NetworkManager) DeleteL3Forward(instanceId, l3ForwardID string) error
DeleteL3Forward sends an HTTP DELETE request to delete an L3Forward with the given ID
func (*NetworkManager) GetL3ForwardsFromInstance ¶
func (nm *NetworkManager) GetL3ForwardsFromInstance(instanceId string, controllerID string) (StaticRouteMap, error)
GetL3ForwardsFromInstance performs an HTTP GET request to the API, extracts name and route information, and stores them
func (*NetworkManager) GetTaskStatus ¶
func (nm *NetworkManager) GetTaskStatus(taskRef string) (string, string, error)
GetTaskStatus sends an HTTP GET request to get the task status of the given task ID
func (*NetworkManager) HandleL3ForwardRequest ¶
func (nm *NetworkManager) HandleL3ForwardRequest(req *NetworkConfigRequest, l3Forward *L3Forward)
func (*NetworkManager) NetworkConfigHandler ¶
func (nm *NetworkManager) NetworkConfigHandler()
func (*NetworkManager) NetworkRequestHandler ¶
func (nm *NetworkManager) NetworkRequestHandler(store interface{})
func (*NetworkManager) PostL3Forward ¶
func (nm *NetworkManager) PostL3Forward(apiURL, authToken string, l3ForwardReq *L3Forward) error
PostL3Forward sends an HTTP POST request to create an L3Forward with the given data
func (*NetworkManager) SetInstanceIds ¶
func (nm *NetworkManager) SetInstanceIds(bigIpConfigs []cisapiv1.BigIpConfig, controllerID string) error
SetInstanceIds performs an HTTP GET request to the API, extracts address and ID mappings, and stores them
type RouteStore ¶
type RouteStore map[string]map[StaticRouteConfig]L3Forward
RouteStore static route config store for each instance key is the instance id
type StaticRouteConfig ¶
type StaticRouteConfig struct { Gateway string `json:"gateway"` Destination string `json:"destination"` L3ForwardType string `json:"l3ForwardType"` }
StaticRouteConfig struct represents the structure of the StaticRouteConfig in the L3Forward
type StaticRouteMap ¶
type StaticRouteMap map[StaticRouteConfig]L3Forward
NetworkManager is responsible for managing the network objects on central manager.