{"modulePath":"github.com/cloudnativelabs/libnetwork","version":"v0.5.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ipamapi\n\nPackage ipamapi specifies the contract the IPAM service (built-in or remote) needs to satisfy.\n\n## Constants\n\n```go\nconst (\n\t// DefaultIPAM is the name of the built-in default ipam driver\n\tDefaultIPAM = \"default\"\n\t// PluginEndpointType represents the Endpoint Type used by Plugin system\n\tPluginEndpointType = \"IpamDriver\"\n\t// RequestAddressType represents the Address Type used when requesting an address\n\tRequestAddressType = \"RequestAddressType\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrIpamInternalError   = types.InternalErrorf(\"IPAM Internal Error\")\n\tErrInvalidAddressSpace = types.BadRequestErrorf(\"Invalid Address Space\")\n\tErrInvalidPool         = types.BadRequestErrorf(\"Invalid Address Pool\")\n\tErrInvalidSubPool      = types.BadRequestErrorf(\"Invalid Address SubPool\")\n\tErrInvalidRequest      = types.BadRequestErrorf(\"Invalid Request\")\n\tErrPoolNotFound        = types.BadRequestErrorf(\"Address Pool not found\")\n\tErrOverlapPool         = types.ForbiddenErrorf(\"Address pool overlaps with existing pool on this address space\")\n\tErrNoAvailablePool     = types.NoServiceErrorf(\"No available pool\")\n\tErrNoAvailableIPs      = types.NoServiceErrorf(\"No available addresses on this pool\")\n\tErrIPAlreadyAllocated  = types.ForbiddenErrorf(\"Address already in use\")\n\tErrIPOutOfRange        = types.BadRequestErrorf(\"Requested address is out of range\")\n\tErrPoolOverlap         = types.ForbiddenErrorf(\"Pool overlaps with other one on this address space\")\n\tErrBadPool             = types.BadRequestErrorf(\"Address space does not contain specified address pool\")\n)\n```\nWeel-known errors returned by IPAM\n\n## Types\n\n```go\ntype Callback interface {\n\t// RegisterIpamDriver provides a way for Remote drivers to dynamically register with libnetwork\n\tRegisterIpamDriver(name string, driver Ipam) error\n\t// RegisterIpamDriverWithCapabilities provides a way for Remote drivers to dynamically register with libnetwork and specify cpaabilities\n\tRegisterIpamDriverWithCapabilities(name string, driver Ipam, capability *Capability) error\n}\n```\nCallback provides a Callback interface for registering an IPAM instance into LibNetwork\n\n```go\ntype Capability struct {\n\tRequiresMACAddress bool\n}\n```\nCapability represents the requirements and capabilities of the IPAM driver\n\n```go\ntype Ipam interface {\n\t// GetDefaultAddressSpaces returns the default local and global address spaces for this ipam\n\tGetDefaultAddressSpaces() (string, string, error)\n\t// RequestPool returns an address pool along with its unique id. Address space is a mandatory field\n\t// which denotes a set of non-overlapping pools. pool describes the pool of addresses in CIDR notation.\n\t// subpool indicates a smaller range of addresses from the pool, for now it is specified in CIDR notation.\n\t// Both pool and subpool are non mandatory fields. When they are not specified, Ipam driver may choose to\n\t// return a self chosen pool for this request. In such case the v6 flag needs to be set appropriately so\n\t// that the driver would return the expected ip version pool.\n\tRequestPool(addressSpace, pool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error)\n\t// ReleasePool releases the address pool identified by the passed id\n\tReleasePool(poolID string) error\n\t// Request address from the specified pool ID. Input options or preferred IP can be passed.\n\tRequestAddress(string, net.IP, map[string]string) (*net.IPNet, map[string]string, error)\n\t// Release the address from the specified pool ID\n\tReleaseAddress(string, net.IP) error\n}\n```\nIpam represents the interface the IPAM service plugins must implement in order to allow injection/modification of IPAM database.\n\n","path":"github.com/cloudnativelabs/libnetwork/ipamapi","name":"ipamapi","synopsis":"Package ipamapi specifies the contract the IPAM service (built-in or remote) needs to satisfy.","isRedistributable":true}
