api

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package api represents all requests and responses suitable for conversation with a remote driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEndpointRequest

type CreateEndpointRequest struct {
	// Provided at create time, this will be the network id referenced.
	NetworkID string
	// The ID of the endpoint for later reference.
	EndpointID string
	Interfaces []*EndpointInterface
	Options    map[string]interface{}
}

CreateEndpointRequest is the request to create an endpoint within a network.

type CreateEndpointResponse

type CreateEndpointResponse struct {
	Response
	Interfaces []*EndpointInterface
}

CreateEndpointResponse is the response to the CreateEndpoint action.

type CreateNetworkRequest

type CreateNetworkRequest struct {
	// A network ID that remote plugins are expected to store for future
	// reference.
	NetworkID string

	// A free form map->object interface for communication of options.
	Options map[string]interface{}
}

CreateNetworkRequest requests a new network.

type CreateNetworkResponse

type CreateNetworkResponse struct {
	Response
}

CreateNetworkResponse is the response to the CreateNetworkRequest.

type DeleteEndpointRequest

type DeleteEndpointRequest struct {
	NetworkID  string
	EndpointID string
}

DeleteEndpointRequest describes the API for deleting an endpoint.

type DeleteEndpointResponse

type DeleteEndpointResponse struct {
	Response
}

DeleteEndpointResponse is the response to the DeleteEndpoint action.

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	// The ID of the network to delete.
	NetworkID string
}

DeleteNetworkRequest is the request to delete an existing network.

type DeleteNetworkResponse

type DeleteNetworkResponse struct {
	Response
}

DeleteNetworkResponse is the response to a request for deleting a network.

type EndpointInfoRequest

type EndpointInfoRequest struct {
	NetworkID  string
	EndpointID string
}

EndpointInfoRequest retrieves information about the endpoint from the network driver.

type EndpointInfoResponse

type EndpointInfoResponse struct {
	Response
	Value map[string]interface{}
}

EndpointInfoResponse is the response to an EndpointInfoRequest.

type EndpointInterface

type EndpointInterface struct {
	ID          int
	Address     string
	AddressIPv6 string
	MacAddress  string
}

EndpointInterface represents an interface endpoint.

type Interface

type Interface struct {
	ID          int
	Address     *net.IPNet
	AddressIPv6 *net.IPNet
	MacAddress  net.HardwareAddr
}

Interface is the representation of a linux interface.

type InterfaceName

type InterfaceName struct {
	SrcName   string
	DstName   string
	DstPrefix string
}

InterfaceName is the struct represetation of a pair of devices with source and destination, for the purposes of putting an endpoint into a container.

type JoinRequest

type JoinRequest struct {
	NetworkID  string
	EndpointID string
	SandboxKey string
	Options    map[string]interface{}
}

JoinRequest describes the API for joining an endpoint to a sandbox.

type JoinResponse

type JoinResponse struct {
	Response
	InterfaceNames []*InterfaceName
	Gateway        string
	GatewayIPv6    string
	HostsPath      string
	ResolvConfPath string
	StaticRoutes   []StaticRoute
}

JoinResponse is the response to a JoinRequest.

type LeaveRequest

type LeaveRequest struct {
	NetworkID  string
	EndpointID string
}

LeaveRequest describes the API for detaching an endpoint from a sandbox.

type LeaveResponse

type LeaveResponse struct {
	Response
}

LeaveResponse is the answer to LeaveRequest.

type Response

type Response struct {
	Err string
}

Response is the basic response structure used in all responses.

func (*Response) GetError

func (r *Response) GetError() string

GetError returns the error from the response, if any.

type StaticRoute

type StaticRoute struct {
	Destination string
	RouteType   int
	NextHop     string
	InterfaceID int
}

StaticRoute is the plain JSON representation of a static route.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL