Documentation ¶
Overview ¶
Package ipamclient provides a client for interacting with the IPAM service
Index ¶
- Variables
- type Client
- func (c *Client) CreateIPAddressFromBlock(ctx context.Context, blockid string, nodeid string, nodeownerid string, ...) (*CreateIPAddressResult, error)
- func (c *Client) DeleteIPAddress(ctx context.Context, id string) (*DeleteIPAddress, error)
- func (c *Client) GetIPAddress(ctx context.Context, id string) (*GetIPAddress, error)
- func (c *Client) GetIPAddresses(ctx context.Context, nodeID string) ([]IPAddressNode, error)
- func (c *Client) GetIPBlock(ctx context.Context, id string) (*GetIPBlock, error)
- func (c *Client) GetNextAvailableAddressFromBlock(ctx context.Context, id string) (string, error)
- type CreateIPAddress
- type CreateIPAddressInput
- type CreateIPAddressResult
- type DeleteIPAddress
- type DeleteIPAddressResult
- type GQLClient
- type GetIPAddress
- type GetIPAddressResult
- type GetIPAddressesByNode
- type GetIPBlock
- type GetIPBlockResult
- type IPAddressEdge
- type IPAddressNode
- type IPAddressableFragment
- type IPAddresses
- type IPBlock
- type IPBlockType
- type Option
- type Owner
Constants ¶
This section is empty.
Variables ¶
var ( errors.New("ipam api received unauthorized request") // ErrIPAMHTTPNotfound is returned when the load balancer ID not found ErrIPAMHTTPNotfound = errors.New("ipam ID not found") // ErrIPAMHTTPError is returned when the http response is an error ErrIPAMHTTPError = errors.New("ipam api http error") // ErrNoAvailableIPs is returned when there are no available IPs within the specified block ErrNoAvailableIPs = errors.New("no available IPS within specified block") )ErrIPAMHTTPUnauthorized =
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client creates a new lb api client against a specific endpoint
func (*Client) CreateIPAddressFromBlock ¶
func (c *Client) CreateIPAddressFromBlock(ctx context.Context, blockid string, nodeid string, nodeownerid string, reserve bool) (*CreateIPAddressResult, error)
CreateIPAddressFromBlock creates an IP Address from the next available address in a given block
func (*Client) DeleteIPAddress ¶
DeleteIPAddress deletes an IP Address by id
func (*Client) GetIPAddress ¶
GetIPAddress returns an IP Address by id
func (*Client) GetIPAddresses ¶
GetIPAddresses returns a list of loadbalancer IP Addresses from node id
func (*Client) GetIPBlock ¶
GetIPBlock returns an IP Block by id
type CreateIPAddress ¶
type CreateIPAddress struct {
CreateIPAddressResult `graphql:"createIPAddress(input: $input)"`
}
CreateIPAddress is the mutation for creating an IP Address
type CreateIPAddressInput ¶
type CreateIPAddressInput struct { IP string `graphql:"ip" json:"ip"` IPBlockID string `graphql:"ipBlockID" json:"ipBlockID"` NodeID string `graphql:"nodeID" json:"nodeID"` NodeOwnerID string `graphql:"nodeOwnerID" json:"nodeOwnerID"` Reserved bool `graphql:"reserved" json:"reserved"` }
CreateIPAddressInput is the set of input required for creating an IP address
type CreateIPAddressResult ¶
type CreateIPAddressResult struct { // IPAddress MyIPAddress `graphql:"ipAddress"` IPAddress struct { IPAddressNode IPBlock IPBlock } `graphql:"ipAddress"` }
CreateIPAddressResult is the result of the mutation to create an IP Address
type DeleteIPAddress ¶
type DeleteIPAddress struct {
DeleteIPAddress DeleteIPAddressResult `graphql:"deleteIPAddress(id: $id)"`
}
DeleteIPAddress is the mutation for deleting an IP Address
type DeleteIPAddressResult ¶
type DeleteIPAddressResult struct {
DeletedID string `graphql:"deletedID"`
}
DeleteIPAddressResult is the result of the mutation to delete an IP Address
type GQLClient ¶
type GQLClient interface { Query(ctx context.Context, q interface{}, variables map[string]interface{}, options ...graphql.Option) error Mutate(ctx context.Context, m interface{}, variables map[string]interface{}, options ...graphql.Option) error }
GQLClient is an interface for a graphql client
type GetIPAddress ¶
type GetIPAddress struct {
IPAddress GetIPAddressResult `graphql:"ipAddress(id: $id)"`
}
GetIPAddress is the query used for getting an IP Address
type GetIPAddressResult ¶
type GetIPAddressResult struct { IPAddressNode IPBlock IPBlock `graphql:"ipBlock" json:"ipBlock"` }
GetIPAddressResult is the result of a query for an IP Address
type GetIPAddressesByNode ¶
type GetIPAddressesByNode struct { NodeIPAddress struct { ID string `graphql:"id" json:"id"` LoadBalancerFragment struct { IPAddressableFragment } `graphql:"... on LoadBalancer"` } `graphql:"node(id: $id)"` }
GetIPAddressesByNode query for getting IP Addresses by node
type GetIPBlock ¶
type GetIPBlock struct {
IPBlock GetIPBlockResult `graphql:"ipBlock(id: $id)"`
}
GetIPBlock is the query used for getting an IP Block
type GetIPBlockResult ¶
type GetIPBlockResult struct { IPBlock IPAddress IPAddresses `graphql:"ipAddress" json:"ipAddress"` }
GetIPBlockResult is the result of a query for an IP Block
type IPAddressEdge ¶
type IPAddressEdge struct {
Node IPAddressNode `graphql:"node" json:"node"`
}
IPAddressEdge is part of a returned query including an edge(s) associated to an IP Address
type IPAddressNode ¶
type IPAddressNode struct { ID string `graphql:"id" json:"id"` IP string `graphql:"ip" json:"ip"` Reserved bool `graphql:"reserved" json:"reserved"` }
IPAddressNode is part of a returned query including an associated IP address
type IPAddressableFragment ¶
type IPAddressableFragment struct {
IPAddresses []IPAddressNode `graphql:"IPAddresses"`
}
IPAddressableFragment fragment for getting IP Addresses by node
type IPAddresses ¶
type IPAddresses struct {
Edges []IPAddressEdge `graphql:"edges" json:"edges"`
}
IPAddresses is part of a returned query including the edges of an associated IP Address
type IPBlock ¶
type IPBlock struct { ID string `graphql:"id" json:"id"` Prefix string `graphql:"prefix" json:"prefix"` AllowAutoSubnet bool `graphql:"allowAutoSubnet" json:"allowAutoSubnet"` AllowAutoAllocate bool `graphql:"allowAutoAllocate" json:"allowAutoAllocate"` IPBlockType IPBlockType `graphql:"ipBlockType" json:"ipBlockType"` }
IPBlock is part of a returned query including an associated block
type IPBlockType ¶
type IPBlockType struct { ID string `graphql:"id" json:"id"` Name string `graphql:"name" json:"name"` Owner Owner `graphql:"owner" json:"owner"` }
IPBlockType is part of a returned query including an associated block type
type Option ¶ added in v0.1.0
type Option func(*Client)
Option is a function that modifies a client
func WithHTTPClient ¶
WithHTTPClient functional option to set the http client