Documentation
¶
Index ¶
- Constants
- func IsNotFound(err error) bool
- type CNSClientError
- type Client
- func (c *Client) CreateHostNCApipaEndpoint(ctx context.Context, networkContainerID string) (string, error)
- func (c *Client) DeleteHostNCApipaEndpoint(ctx context.Context, networkContainerID string) error
- func (c *Client) GetHTTPServiceData(ctx context.Context) (*restserver.GetHTTPServiceDataResponse, error)
- func (c *Client) GetIPAddressesMatchingStates(ctx context.Context, stateFilter ...types.IPState) ([]cns.IPConfigurationStatus, error)
- func (c *Client) GetNetworkConfiguration(ctx context.Context, orchestratorContext []byte) (*cns.GetNetworkContainerResponse, error)
- func (c *Client) GetPodOrchestratorContext(ctx context.Context) (map[string]string, error)
- func (c *Client) ReleaseIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) error
- func (c *Client) RequestIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) (*cns.IPConfigResponse, error)
Constants ¶
const ( // DefaultTimeout default timeout duration for CNS Client. DefaultTimeout = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound tests if the provided error is of type CNSClientError and then further tests if the error code is of type UnknowContainerID
Types ¶
type CNSClientError ¶
type CNSClientError struct { Code types.ResponseCode Err error }
CNSClientError records an error and relevant code
func (*CNSClientError) Error ¶
func (e *CNSClientError) Error() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client specifies a client to connect to Ipam Plugin.
func (*Client) CreateHostNCApipaEndpoint ¶
func (c *Client) CreateHostNCApipaEndpoint(ctx context.Context, networkContainerID string) (string, error)
CreateHostNCApipaEndpoint creates an endpoint in APIPA network for host container connectivity.
func (*Client) DeleteHostNCApipaEndpoint ¶
DeleteHostNCApipaEndpoint deletes the endpoint in APIPA network created for host container connectivity.
func (*Client) GetHTTPServiceData ¶
func (c *Client) GetHTTPServiceData(ctx context.Context) (*restserver.GetHTTPServiceDataResponse, error)
GetHTTPServiceData gets all public in-memory struct details for debugging purpose
func (*Client) GetIPAddressesMatchingStates ¶
func (c *Client) GetIPAddressesMatchingStates(ctx context.Context, stateFilter ...types.IPState) ([]cns.IPConfigurationStatus, error)
GetIPAddressesMatchingStates takes a variadic number of string parameters, to get all IP Addresses matching a number of states usage GetIPAddressesWithStates(ctx, types.Available...)
func (*Client) GetNetworkConfiguration ¶ added in v1.4.13
func (c *Client) GetNetworkConfiguration(ctx context.Context, orchestratorContext []byte) (*cns.GetNetworkContainerResponse, error)
GetNetworkConfiguration Request to get network config.
func (*Client) GetPodOrchestratorContext ¶
GetPodOrchestratorContext calls GetPodIpOrchestratorContext API on CNS
func (*Client) ReleaseIPAddress ¶
ReleaseIPAddress calls releaseIPAddress on CNS, ipaddress ex: (10.0.0.1)
func (*Client) RequestIPAddress ¶
func (c *Client) RequestIPAddress(ctx context.Context, ipconfig cns.IPConfigRequest) (*cns.IPConfigResponse, error)
RequestIPAddress calls the requestIPAddress in CNS