Documentation
¶
Overview ¶
Package bigip interacts with F5 BIG-IP systems using the REST API.
Index ¶
- type APIRequest
- type BigIP
- func (b *BigIP) APICall(options *APIRequest) ([]byte, error)
- func (b *BigIP) AddInterfaceToVlan(vlan, iface string, tagged bool) error
- func (b *BigIP) AddMonitorToPool(monitor, pool string) error
- func (b *BigIP) AddPoolMember(pool, member string) error
- func (b *BigIP) CreateIRule(name, rule string) error
- func (b *BigIP) CreateMonitor(name, parent string, interval, timeout int, send, receive string) error
- func (b *BigIP) CreateNode(name, address string) error
- func (b *BigIP) CreatePool(name string) error
- func (b *BigIP) CreateRoute(name, dest, gateway string) error
- func (b *BigIP) CreateRouteDomain(name string, id int, strict bool, vlans string) error
- func (b *BigIP) CreateSelfIP(name, address, vlan string) error
- func (b *BigIP) CreateTrunk(name, interfaces string, lacp bool) error
- func (b *BigIP) CreateVirtualServer(name, destination, mask, pool string, port int) error
- func (b *BigIP) CreateVlan(name string, tag int) error
- func (b *BigIP) DeleteIRule(name string) error
- func (b *BigIP) DeleteMonitor(name, parent string) error
- func (b *BigIP) DeleteNode(name string) error
- func (b *BigIP) DeletePool(name string) error
- func (b *BigIP) DeletePoolMember(pool, member string) error
- func (b *BigIP) DeleteRoute(name string) error
- func (b *BigIP) DeleteRouteDomain(name string) error
- func (b *BigIP) DeleteSelfIP(name string) error
- func (b *BigIP) DeleteTrunk(name string) error
- func (b *BigIP) DeleteVirtualServer(name string) error
- func (b *BigIP) DeleteVlan(name string) error
- func (b *BigIP) GetNode(name string) (*Node, error)
- func (b *BigIP) GetPool(name string) (*Pool, error)
- func (b *BigIP) GetVirtualServer(name string) (*VirtualServer, error)
- func (b *BigIP) IRule(name string) (*IRule, error)
- func (b *BigIP) IRules() (*IRules, error)
- func (b *BigIP) Interfaces() (*Interfaces, error)
- func (b *BigIP) ModifyIRule(name string, irule *IRule) error
- func (b *BigIP) ModifyMonitor(name, parent string, config *Monitor) error
- func (b *BigIP) ModifyNode(name string, config *Node) error
- func (b *BigIP) ModifyPool(name string, config *Pool) error
- func (b *BigIP) ModifyRoute(name string, config *Route) error
- func (b *BigIP) ModifyRouteDomain(name string, config *RouteDomain) error
- func (b *BigIP) ModifySelfIP(name string, config *SelfIP) error
- func (b *BigIP) ModifyTrunk(name string, config *Trunk) error
- func (b *BigIP) ModifyVirtualServer(name string, config *VirtualServer) error
- func (b *BigIP) ModifyVlan(name string, config *Vlan) error
- func (b *BigIP) Monitors() ([]Monitor, error)
- func (b *BigIP) NodeStatus(name, state string) error
- func (b *BigIP) Nodes() (*Nodes, error)
- func (b *BigIP) PoolMemberStatus(pool, member, state string) error
- func (b *BigIP) PoolMembers(name string) ([]string, error)
- func (b *BigIP) Pools() (*Pools, error)
- func (b *BigIP) RouteDomains() (*RouteDomains, error)
- func (b *BigIP) Routes() (*Routes, error)
- func (b *BigIP) SafeGet(url string) ([]byte, error)
- func (b *BigIP) SelfIPs() (*SelfIPs, error)
- func (b *BigIP) Trunks() (*Trunks, error)
- func (b *BigIP) VirtualAddressStatus(vaddr, state string) error
- func (b *BigIP) VirtualAddresses() (*VirtualAddresses, error)
- func (b *BigIP) VirtualServerProfiles(vs string) (*Profiles, error)
- func (b *BigIP) VirtualServers() (*VirtualServers, error)
- func (b *BigIP) Vlans() (*Vlans, error)
- type IRule
- type IRules
- type Interface
- type Interfaces
- type Monitor
- type Monitors
- type Node
- type Nodes
- type Pool
- type Pools
- type Profile
- type Profiles
- type RequestError
- type Route
- type RouteDomain
- type RouteDomains
- type Routes
- type SelfIP
- type SelfIPs
- type Trunk
- type Trunks
- type VirtualAddress
- type VirtualAddresses
- type VirtualServer
- type VirtualServers
- type Vlan
- type VlanInterface
- type Vlans
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIRequest ¶
APIRequest builds our request before sending it to the server.
type BigIP ¶
BigIP is a container for our session state.
func NewSession ¶
NewSession sets up our connection to the BIG-IP system.
func (*BigIP) APICall ¶
func (b *BigIP) APICall(options *APIRequest) ([]byte, error)
APICall is used to query the BIG-IP web API.
func (*BigIP) AddInterfaceToVlan ¶
AddInterfaceToVlan associates the given interface to the specified VLAN.
func (*BigIP) AddMonitorToPool ¶
AddMonitorToPool assigns the monitor, <monitor> to the given <pool>.
func (*BigIP) AddPoolMember ¶
AddPoolMember adds a node/member to the given pool. <member> must be in the form of <node>:<port>, i.e.: "web-server1:443".
func (*BigIP) CreateIRule ¶
IRules returns a list of irules
func (*BigIP) CreateMonitor ¶
func (b *BigIP) CreateMonitor(name, parent string, interval, timeout int, send, receive string) error
CreateMonitor adds a new monitor to the BIG-IP system. <parent> must be one of "http", "https", "icmp", or "gateway icmp".
func (*BigIP) CreateNode ¶
CreateNode adds a new node to the BIG-IP system.
func (*BigIP) CreatePool ¶
CreatePool adds a new pool to the BIG-IP system.
func (*BigIP) CreateRoute ¶
CreateRoute adds a new static route to the BIG-IP system. <dest> must include the subnet mask in CIDR notation, i.e.: "10.1.1.0/24".
func (*BigIP) CreateRouteDomain ¶
CreateRouteDomain adds a new route domain to the BIG-IP system. <vlans> must be separated by a comma, i.e.: "vlan1010, vlan1020".
func (*BigIP) CreateSelfIP ¶
CreateSelfIP adds a new self IP to the BIG-IP system. For <address>, you must include the subnet mask in CIDR notation, i.e.: "10.1.1.1/24".
func (*BigIP) CreateTrunk ¶
CreateTrunk adds a new trunk to the BIG-IP system. <interfaces> must be separated by a comma, i.e.: "1.4, 1.6, 1.8".
func (*BigIP) CreateVirtualServer ¶
CreateVirtualServer adds a new virtual server to the BIG-IP system. <mask> can either be in CIDR notation or decimal, i.e.: "24" or "255.255.255.0". A CIDR mask of "0" is the same as "0.0.0.0".
func (*BigIP) CreateVlan ¶
CreateVlan adds a new VLAN to the BIG-IP system.
func (*BigIP) DeleteIRule ¶
DeleteNode removes a node.
func (*BigIP) DeleteMonitor ¶
DeleteMonitor removes a monitor.
func (*BigIP) DeletePoolMember ¶
DeletePoolMember removes a member from the given pool. <member> must be in the form of <node>:<port>, i.e.: "web-server1:443".
func (*BigIP) DeleteRoute ¶
DeleteRoute removes a static route.
func (*BigIP) DeleteRouteDomain ¶
DeleteRouteDomain removes a route domain.
func (*BigIP) DeleteSelfIP ¶
DeleteSelfIP removes a self IP.
func (*BigIP) DeleteTrunk ¶
DeleteTrunk removes a trunk.
func (*BigIP) DeleteVirtualServer ¶
DeleteVirtualServer removes a virtual server.
func (*BigIP) GetVirtualServer ¶
func (b *BigIP) GetVirtualServer(name string) (*VirtualServer, error)
Get a VirtualServer by name. Returns nil if the VirtualServer does not exist
func (*BigIP) Interfaces ¶
func (b *BigIP) Interfaces() (*Interfaces, error)
Interfaces returns a list of interfaces.
func (*BigIP) ModifyMonitor ¶
ModifyMonitor allows you to change any attribute of a monitor. <parent> must be one of "http", "https", "icmp", or "gateway icmp". Fields that can be modified are referenced in the Monitor struct.
func (*BigIP) ModifyNode ¶
ModifyNode allows you to change any attribute of a node. Fields that can be modified are referenced in the Node struct.
func (*BigIP) ModifyPool ¶
ModifyPool allows you to change any attribute of a pool. Fields that can be modified are referenced in the Pool struct.
func (*BigIP) ModifyRoute ¶
ModifyRoute allows you to change any attribute of a static route. Fields that can be modified are referenced in the Route struct.
func (*BigIP) ModifyRouteDomain ¶
func (b *BigIP) ModifyRouteDomain(name string, config *RouteDomain) error
ModifyRouteDomain allows you to change any attribute of a route domain. Fields that can be modified are referenced in the RouteDomain struct.
func (*BigIP) ModifySelfIP ¶
ModifySelfIP allows you to change any attribute of a self IP. Fields that can be modified are referenced in the SelfIP struct.
func (*BigIP) ModifyTrunk ¶
ModifyTrunk allows you to change any attribute of a trunk. Fields that can be modified are referenced in the Trunk struct.
func (*BigIP) ModifyVirtualServer ¶
func (b *BigIP) ModifyVirtualServer(name string, config *VirtualServer) error
ModifyVirtualServer allows you to change any attribute of a virtual server. Fields that can be modified are referenced in the VirtualServer struct.
func (*BigIP) ModifyVlan ¶
ModifyVlan allows you to change any attribute of a VLAN. Fields that can be modified are referenced in the Vlan struct.
func (*BigIP) Monitors ¶
Monitors returns a list of all HTTP, HTTPS, Gateway ICMP, and ICMP monitors.
func (*BigIP) NodeStatus ¶
NodeStatus changes the status of a node. <state> can be either "enable" or "disable".
func (*BigIP) PoolMemberStatus ¶
PoolMemberStatus changes the status of a pool member. <state> can be either "enable" or "disable". <member> must be in the form of <node>:<port>, i.e.: "web-server1:443".
func (*BigIP) PoolMembers ¶
PoolMembers returns a list of pool members for the given pool.
func (*BigIP) RouteDomains ¶
func (b *BigIP) RouteDomains() (*RouteDomains, error)
RouteDomains returns a list of route domains.
func (*BigIP) VirtualAddressStatus ¶
VirtualAddressStatus changes the status of a virtual address. <state> can be either "enable" or "disable".
func (*BigIP) VirtualAddresses ¶
func (b *BigIP) VirtualAddresses() (*VirtualAddresses, error)
VirtualAddresses returns a list of virtual addresses.
func (*BigIP) VirtualServerProfiles ¶
VirtualServerProfiles gets the profiles currently associated with a virtual server.
func (*BigIP) VirtualServers ¶
func (b *BigIP) VirtualServers() (*VirtualServers, error)
VirtualServers returns a list of virtual servers.
type Interface ¶
type Interface struct { Name string `json:"name,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` Bundle string `json:"bundle,omitempty"` Enabled bool `json:"enabled,omitempty"` FlowControl string `json:"flowControl,omitempty"` ForceGigabitFiber string `json:"forceGigabitFiber,omitempty"` IfIndex int `json:"ifIndex,omitempty"` LLDPAdmin string `json:"lldpAdmin,omitempty"` LLDPTlvmap int `json:"lldpTlvmap,omitempty"` MACAddress string `json:"macAddress,omitempty"` MediaActive string `json:"mediaActive,omitempty"` MediaFixed string `json:"mediaFixed,omitempty"` MediaMax string `json:"mediaMax,omitempty"` MediaSFP string `json:"mediaSfp,omitempty"` MTU int `json:"mtu,omitempty"` PreferPort string `json:"preferPort,omitempty"` SFlow struct { PollInterval int `json:"pollInterval,omitempty"` PollIntervalGlobal string `json:"pollIntervalGlobal,omitempty"` } `json:"sflow,omitempty"` STP string `json:"stp,omitempty"` STPAutoEdgePort string `json:"stpAutoEdgePort,omitempty"` STPEdgePort string `json:"stpEdgePort,omitempty"` STPLinkType string `json:"stpLinkType,omitempty"` }
Interface contains information about each individual interface.
type Interfaces ¶
type Interfaces struct {
Interfaces []Interface `json:"items"`
}
Interfaces contains a list of every interface on the BIG-IP system.
type Monitor ¶
type Monitor struct { Name string Partition string FullPath string Generation int ParentMonitor string Description string Destination string Interval int IPDSCP int ManualResume bool ReceiveString string ReceiveDisable string Reverse bool SendString string TimeUntilUp int Timeout int Transparent bool UpInterval int }
Monitor contains information about each individual monitor.
func (*Monitor) MarshalJSON ¶
func (*Monitor) UnmarshalJSON ¶
type Monitors ¶
type Monitors struct {
Monitors []Monitor `json:"items"`
}
Monitors contains a list of all monitors on the BIG-IP system.
type Node ¶
type Node struct { Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` Address string `json:"address,omitempty"` ConnectionLimit int `json:"connectionLimit,omitempty"` DynamicRatio int `json:"dynamicRatio,omitempty"` Logging string `json:"logging,omitempty"` Monitor string `json:"monitor,omitempty"` RateLimit string `json:"rateLimit,omitempty"` Ratio int `json:"ratio,omitempty"` Session string `json:"session,omitempty"` State string `json:"state,omitempty"` }
Node contains information about each individual node. You can use all of these fields when modifying a node.
type Nodes ¶
type Nodes struct {
Nodes []Node `json:"items"`
}
Nodes contains a list of every node on the BIG-IP system.
type Pool ¶
type Pool struct { Name string Partition string FullPath string Generation int AllowNAT bool AllowSNAT bool IgnorePersistedWeight bool IPTOSToClient string IPTOSToServer string LinkQoSToClient string LinkQoSToServer string LoadBalancingMode string MinActiveMembers int MinUpMembers int MinUpMembersAction string MinUpMembersChecking string Monitor string QueueDepthLimit int QueueOnConnectionLimit string QueueTimeLimit int ReselectTries int SlowRampTime int }
Pool contains information about each pool. You can use all of these fields when modifying a pool.
func (*Pool) MarshalJSON ¶
func (*Pool) UnmarshalJSON ¶
type Pools ¶
type Pools struct {
Pools []Pool `json:"items"`
}
Pools contains a list of pools on the BIG-IP system.
type RequestError ¶
type RequestError struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` ErrorStack []string `json:"errorStack,omitempty"` }
RequestError contains information about any error we get from a request.
func (*RequestError) Error ¶
func (r *RequestError) Error() error
type Route ¶
type Route struct { Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` Gateway string `json:"gw,omitempty"` MTU int `json:"mtu,omitempty"` Network string `json:"network,omitempty"` }
Route contains information about each individual route. You can use all of these fields when modifying a route.
type RouteDomain ¶
type RouteDomain struct { Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` ID int `json:"id,omitempty"` Strict string `json:"strict,omitempty"` Vlans []string `json:"vlans,omitempty"` }
RouteDomain contains information about each individual route domain. You can use all of these fields when modifying a route domain.
type RouteDomains ¶
type RouteDomains struct {
RouteDomains []RouteDomain `json:"items"`
}
RouteDomains contains a list of every route domain on the BIG-IP system.
type Routes ¶
type Routes struct {
Routes []Route `json:"items"`
}
Routes contains a list of every route on the BIG-IP system.
type SelfIP ¶
type SelfIP struct { Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` Address string `json:"address,omitempty"` Floating string `json:"floating,omitempty"` InheritedTrafficGroup string `json:"inheritedTrafficGroup,omitempty"` TrafficGroup string `json:"trafficGroup,omitempty"` Unit int `json:"unit,omitempty"` Vlan string `json:"vlan,omitempty"` }
SelfIP contains information about each individual self IP. You can use all of these fields when modifying a self IP.
type SelfIPs ¶
type SelfIPs struct {
SelfIPs []SelfIP `json:"items"`
}
SelfIPs contains a list of every self IP on the BIG-IP system.
type Trunk ¶
type Trunk struct { Name string `json:"name,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` Bandwidth int `json:"bandwidth,omitempty"` MemberCount int `json:"cfgMbrCount,omitempty"` DistributionHash string `json:"distributionHash,omitempty"` ID int `json:"id,omitempty"` LACP string `json:"lacp,omitempty"` LACPMode string `json:"lacpMode,omitempty"` LACPTimeout string `json:"lacpTimeout,omitempty"` LinkSelectPolicy string `json:"linkSelectPolicy,omitempty"` MACAddress string `json:"macAddress,omitempty"` STP string `json:"stp,omitempty"` Type string `json:"type,omitempty"` WorkingMemberCount int `json:"workingMbrCount,omitempty"` Interfaces []string `json:"interfaces,omitempty"` }
Trunk contains information about each individual trunk. You can use all of these fields when modifying a trunk.
type Trunks ¶
type Trunks struct {
Trunks []Trunk `json:"items"`
}
Trunks contains a list of every trunk on the BIG-IP system.
type VirtualAddress ¶
type VirtualAddress struct { Name string Partition string FullPath string Generation int Address string ARP bool AutoDelete string ConnectionLimit int Enabled bool Floating bool ICMPEcho bool InheritedTrafficGroup bool Mask string RouteAdvertisement bool ServerScope string TrafficGroup string Unit int }
VirtualAddress contains information about each individual virtual address.
func (*VirtualAddress) MarshalJSON ¶
func (p *VirtualAddress) MarshalJSON() ([]byte, error)
func (*VirtualAddress) UnmarshalJSON ¶
func (p *VirtualAddress) UnmarshalJSON(b []byte) error
type VirtualAddresses ¶
type VirtualAddresses struct {
VirtualAddresses []VirtualAddress `json:"items"`
}
VirtualAddresses contains a list of all virtual addresses on the BIG-IP system.
type VirtualServer ¶
type VirtualServer struct { Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` AddressStatus string `json:"addressStatus,omitempty"` AutoLastHop string `json:"autoLastHop,omitempty"` CMPEnabled string `json:"cmpEnabled,omitempty"` ConnectionLimit int `json:"connectionLimit,omitempty"` Destination string `json:"destination,omitempty"` Enabled bool `json:"enabled,omitempty"` GTMScore int `json:"gtmScore,omitempty"` IPProtocol string `json:"ipProtocol,omitempty"` Mask string `json:"mask,omitempty"` Mirror string `json:"mirror,omitempty"` MobileAppTunnel string `json:"mobileAppTunnel,omitempty"` NAT64 string `json:"nat64,omitempty"` Pool string `json:"pool,omitempty"` RateLimit string `json:"rateLimit,omitempty"` RateLimitDestinationMask int `json:"rateLimitDstMask,omitempty"` RateLimitMode string `json:"rateLimitMode,omitempty"` RateLimitSourceMask int `json:"rateLimitSrcMask,omitempty"` Source string `json:"source,omitempty"` SourceAddressTranslation struct { Type string `json:"type,omitempty"` } `json:"sourceAddressTranslation,omitempty"` SourcePort string `json:"sourcePort,omitempty"` SYNCookieStatus string `json:"synCookieStatus,omitempty"` TranslateAddress string `json:"translateAddress,omitempty"` TranslatePort string `json:"translatePort,omitempty"` VlansDisabled bool `json:"vlansDisabled,omitempty"` VSIndex int `json:"vsIndex,omitempty"` Rules []string `json:"rules,omitempty"` Profiles []Profile `json:"profiles,omitempty"` }
VirtualServer contains information about each individual virtual server.
type VirtualServers ¶
type VirtualServers struct {
VirtualServers []VirtualServer `json:"items"`
}
VirtualServers contains a list of all virtual servers on the BIG-IP system.
type Vlan ¶
type Vlan struct { Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` FullPath string `json:"fullPath,omitempty"` Generation int `json:"generation,omitempty"` AutoLastHop string `json:"autoLastHop,omitempty"` CMPHash string `json:"cmpHash,omitempty"` DAGRoundRobin string `json:"dagRoundRobin,omitempty"` Failsafe string `json:"failsafe,omitempty"` FailsafeAction string `json:"failsafeAction,omitempty"` FailsafeTimeout int `json:"failsafeTimeout,omitempty"` IfIndex int `json:"ifIndex,omitempty"` Learning string `json:"learning,omitempty"` MTU int `json:"mtu,omitempty"` SFlow struct { PollInterval int `json:"pollInterval,omitempty"` PollIntervalGlobal string `json:"pollIntervalGlobal,omitempty"` SamplingRate int `json:"samplingRate,omitempty"` SamplingRateGlobal string `json:"samplingRateGlobal,omitempty"` } `json:"sflow,omitempty"` SourceChecking string `json:"sourceChecking,omitempty"` Tag int `json:"tag,omitempty"` }
Vlan contains information about each individual VLAN. You can use all of these fields when modifying a VLAN.
type VlanInterface ¶
type VlanInterface struct { Name string `json:"name,omitempty"` Tagged bool `json:"tagged,omitempty"` Untagged bool `json:"untagged,omitempty"` }
VlanInterface contains fields to be used when adding an interface to a VLAN.