Documentation ¶
Overview ¶
Package prefix implements API functions residing under /ipam/prefix. This path contains methods for querying and setting IP prefixes.
Index ¶
Constants ¶
View Source
const ( // TypePublic means the prefix is globally routable. TypePublic int = 0 // TypePrivate means the prefix is scoped to a private network. TypePrivate int = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { List(ctx context.Context, page, limit int) ([]Summary, error) Get(ctx context.Context, id string) (Info, error) Delete(ctx context.Context, id string) error Create(ctx context.Context, create Create) (Summary, error) Update(ctx context.Context, id string, update Update) (Summary, error) }
API contains methods for IP manipulation.
type Create ¶
type Create struct { Location string `json:"location"` IPVersion int `json:"version"` Type int `json:"type"` NetworkMask int `json:"netmask"` CreateVLAN bool `json:"new_vlan,omitempty"` CreateEmpty bool `json:"create_empty"` VLANID string `json:"vlan,omitempty"` EnableRedundancy bool `json:"router_redundancy,omitempty"` EnableVMProvisioning bool `json:"vm_provisioning,omitempty"` CustomerDescription string `json:"description_customer,omitempty"` CustomerVLANDescription string `json:"description_vlan_customer,omitempty"` Organization string `json:"organization,omitempty"` }
Create defines meta data of a prefix to create.
type Info ¶
type Info struct { ID string `json:"identifier"` Name string `json:"name"` CustomerDescription string `json:"description_customer"` InternalDescription string `json:"description_internal"` IPVersion int `json:"version"` NetworkMask int `json:"netmask"` Role string `json:"role_text"` Status string `json:"status"` Locations []Location `json:"locations"` RouterRedundancy bool `json:"router_redundancy"` Vlans []Vlan `json:"vlans"` PrefixType int `json:"type"` }
Info contains extended information about a prefix.
type Location ¶
type Location struct { ID string `json:"identifier"` Code string `json:"code"` Name string `json:"name"` Country string `json:"country"` Latitude string `json:"lat"` Longitude string `json:"lon"` CityCode string `json:"city_code"` }
Location is part of info.
type Summary ¶
type Summary struct { ID string `json:"identifier"` Name string `json:"name"` CustomerDescription string `json:"description_customer"` }
Summary contains a abbreviated information set about a prefix.
Click to show internal directories.
Click to hide internal directories.