Movatterモバイル変換


[0]ホーム

URL:


ipamapi

package
v2.0.0-beta.5Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License:Apache-2.0Imports:4Imported by:0

Details

Repository

github.com/moby/moby

Links

Documentation

Overview

Package ipamapi specifies the contract the IPAM service (built-in or remote) needs to satisfy.

Index

Constants

View Source
const (// PluginEndpointType represents the Endpoint Type used by Plugin systemPluginEndpointType = "IpamDriver"// RequestAddressType represents the Address Type used when requesting an addressRequestAddressType = "RequestAddressType")

IPAM plugin types

View Source
const (// Prefix constant marks the reserved label space for libnetworkPrefix = "com.docker.network"// AllocSerialPrefix constant marks the reserved label space for libnetwork ipam// allocation ordering.(serial/first available)AllocSerialPrefix =Prefix + ".ipam.serial")

Variables

View Source
var (ErrInvalidAddressSpace =types.InvalidParameterErrorf("invalid address space")ErrInvalidPool         =types.InvalidParameterErrorf("invalid address pool")ErrInvalidSubPool      =types.InvalidParameterErrorf("invalid address subpool")ErrNoAvailableIPs      =types.UnavailableErrorf("no available addresses on this pool")ErrNoIPReturned        =types.UnavailableErrorf("no address returned")ErrIPAlreadyAllocated  =types.ForbiddenErrorf("Address already in use")ErrIPOutOfRange        =types.InvalidParameterErrorf("requested address is out of range")ErrPoolOverlap         =types.ForbiddenErrorf("Pool overlaps with other one on this address space")ErrBadPool             =types.InvalidParameterErrorf("address space does not contain specified address pool")ErrNoMoreSubnets       =types.InvalidParameterErrorf("all predefined address pools have been fully subnetted"))

Well-known errors returned by IPAM

Functions

This section is empty.

Types

typeAllocatedPool

type AllocatedPool struct {// PoolID represents the ID of the allocated pool. Its value is opaque and// shouldn't be interpreted by anything but the IPAM driver that generated// it.PoolIDstring// Pool is the allocated prefix.Poolnetip.Prefix// Meta represents a list of extra IP addresses automatically reserved// during the pool allocation. These are generally keyed by well-known// strings defined in the netlabel package.Meta map[string]string}

typeCapability

type Capability struct {// Whether on address request, libnetwork must// specify the endpoint MAC addressRequiresMACAddressbool// Whether of daemon start, libnetwork must replay the pool// request and the address request for current local networksRequiresRequestReplaybool}

Capability represents the requirements and capabilities of the IPAM driver

typeIpam

type Ipam interface {// GetDefaultAddressSpaces returns the default local and global address spaces for this ipamGetDefaultAddressSpaces() (string,string,error)// RequestPool allocate an address pool either statically or dynamically// based on req.RequestPool(reqPoolRequest) (AllocatedPool,error)// ReleasePool releases the address pool identified by the passed idReleasePool(poolIDstring)error// RequestAddress request an address from the specified pool ID. Input options or required IP can be passed.RequestAddress(string,net.IP, map[string]string) (*net.IPNet, map[string]string,error)// ReleaseAddress releases the address from the specified pool ID.ReleaseAddress(string,net.IP)error// IsBuiltIn returns true if it is a built-in driver.IsBuiltIn()bool}

Ipam represents the interface the IPAM service plugins must implementin order to allow injection/modification of IPAM database.

typePoolRequest

type PoolRequest struct {// AddressSpace is a mandatory field which denotes which block of pools// should be used to make the allocation. This value is opaque, and only// the IPAM driver can interpret it. Each driver might support a different// set of AddressSpace.AddressSpacestring// Pool is a prefix in CIDR notation. It's non-mandatory. When specified// the Pool will be statically allocated. The Pool is used for dynamic// address allocation -- except when SubPool is specified.Poolstring// SubPool is a subnet from Pool, in CIDR notation too. It's non-mandatory.// When specified, it represents the subnet where addresses will be// dynamically allocated. It can't be specified if Pool isn't specified.SubPoolstring// Options is a map of opaque k/v passed to the driver. It's non-mandatory.// Drivers are free to ignore it.Options map[string]string// Exclude is a list of prefixes the requester wish to not be dynamically// allocated (ie. when Pool isn't specified). It's up to the IPAM driver to// take it into account, or totally ignore it. It's required to be sorted.Exclude []netip.Prefix// V6 indicates which address family should be used to dynamically allocate// a prefix (ie. when Pool isn't specified).V6bool}

typePoolStatuser

type PoolStatuser interface {Ipam// Status returns the operational status of the specified IPAM pool.PoolStatus(poolIDstring) (network.SubnetStatus,error)}

typeRegisterer

type Registerer interface {// RegisterIpamDriver provides a way for drivers to dynamically register with libnetworkRegisterIpamDriver(namestring, driverIpam)error// RegisterIpamDriverWithCapabilities provides a way for drivers to dynamically register with libnetwork and specify capabilitiesRegisterIpamDriverWithCapabilities(namestring, driverIpam, capability *Capability)error}

Registerer provides a callback interface for registering IPAM instances into libnetwork.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp