Documentation ¶
Index ¶
- type Client
- type ClientConfig
- type ClientType
- type ExternalClient
- func (c *ExternalClient) AttachPodToNetwork(networkType l2smv1.NetworkType, config interface{}) error
- func (c *ExternalClient) CheckNetworkExists(networkType l2smv1.NetworkType, networkID string) (bool, error)
- func (c *ExternalClient) CreateNetwork(networkType l2smv1.NetworkType, config interface{}) error
- func (c *ExternalClient) DeleteNetwork(networkType l2smv1.NetworkType, networkID string) error
- type InternalClient
- func (c *InternalClient) AttachPodToNetwork(networkType l2smv1.NetworkType, config interface{}) error
- func (c *InternalClient) CheckNetworkExists(networkType l2smv1.NetworkType, networkID string) (bool, error)
- func (c *InternalClient) CreateNetwork(networkType l2smv1.NetworkType, config interface{}) error
- func (c *InternalClient) DeleteNetwork(networkType l2smv1.NetworkType, networkID string) error
- func (c *InternalClient) DetachPodFromNetwork(networkType l2smv1.NetworkType, portID string) error
- type SessionClient
- type VnetPayload
- type VnetPortPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { CreateNetwork(networkType l2smv1.NetworkType, config interface{}) error DeleteNetwork(networkType l2smv1.NetworkType, networkID string) error CheckNetworkExists(networkType l2smv1.NetworkType, networkID string) (bool, error) AttachPodToNetwork(networkType l2smv1.NetworkType, config interface{}) error }
NetworkStrategy defines the interface for network strategies
func NewClient ¶
func NewClient(clientType ClientType, config ClientConfig) (Client, error)
type ClientConfig ¶
type ClientType ¶
type ClientType string
const ( InternalType ClientType = "internal" ExternalType ClientType = "external" )
type ExternalClient ¶
type ExternalClient struct {
Session *SessionClient
}
ExternalClient is part of the Client interface, and implements the SessionClient, which is a wrapper of the http function this type of client is for the specific idco onos app, which manages inter cluster networks.
func (*ExternalClient) AttachPodToNetwork ¶
func (c *ExternalClient) AttachPodToNetwork(networkType l2smv1.NetworkType, config interface{}) error
AttachPodToNetwork attaches a pod to a network, using the configuration file
func (*ExternalClient) CheckNetworkExists ¶
func (c *ExternalClient) CheckNetworkExists(networkType l2smv1.NetworkType, networkID string) (bool, error)
CheckNetworkExists checks if the specified network exists in the SDN controller
func (*ExternalClient) CreateNetwork ¶
func (c *ExternalClient) CreateNetwork(networkType l2smv1.NetworkType, config interface{}) error
CreateNetwork creates a new network in the SDN controller
func (*ExternalClient) DeleteNetwork ¶
func (c *ExternalClient) DeleteNetwork(networkType l2smv1.NetworkType, networkID string) error
DeleteNetwork deletes an existing network from the SDN controller
type InternalClient ¶
type InternalClient struct {
Session *SessionClient
}
InternalClient is part of the Client interface, and implements the SessionClient, which is a wrapper of the http function. this type of client is for the specific l2sm-controller onos app, which manages intra cluster networks.
func (*InternalClient) AttachPodToNetwork ¶
func (c *InternalClient) AttachPodToNetwork(networkType l2smv1.NetworkType, config interface{}) error
AttachPodToNetwork checks if the specified network exists in the SDN controller
func (*InternalClient) CheckNetworkExists ¶
func (c *InternalClient) CheckNetworkExists(networkType l2smv1.NetworkType, networkID string) (bool, error)
CheckNetworkExists checks if the specified network exists in the SDN controller
func (*InternalClient) CreateNetwork ¶
func (c *InternalClient) CreateNetwork(networkType l2smv1.NetworkType, config interface{}) error
CreateNetwork creates a new network in the SDN controller
func (*InternalClient) DeleteNetwork ¶
func (c *InternalClient) DeleteNetwork(networkType l2smv1.NetworkType, networkID string) error
DeleteNetwork deletes an existing network from the SDN controller
func (*InternalClient) DetachPodFromNetwork ¶
func (c *InternalClient) DetachPodFromNetwork(networkType l2smv1.NetworkType, portID string) error
DetachPodFromNetwork detaches the pod from the network, so it can be used in the future TODO: Implement in onos
type SessionClient ¶
type SessionClient struct { BaseURL string AuthToken string // contains filtered or unexported fields }
SessionClient wraps around http.Client and automatically adds authorization headers.
func NewSessionClient ¶
func NewSessionClient(baseURL, username, password string) *SessionClient
NewSessionClient creates a new SessionClient with basic auth credentials.
func (*SessionClient) Delete ¶
func (c *SessionClient) Delete(url string) (*http.Response, error)
Delete wraps the DELETE method with authorization.
func (*SessionClient) Do ¶
Do sends an HTTP request and returns an HTTP response, similar to http.Client's Do.
type VnetPayload ¶
type VnetPayload struct {
NetworkId string `json:"networkId"`
}