f5_bigip

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const TmUriPrefix = "/mgmt/tm"

Variables

View Source
var (
	// slog                       *utils.SLOG
	ResOrder                   []string
	BIGIPiControlTimeCostTotal *prometheus.GaugeVec
	BIGIPiControlTimeCostCount *prometheus.GaugeVec
)

Functions

func GatherKinds

func GatherKinds(ocfg, ncfg *map[string]interface{}) []string

Types

type BIGIP

type BIGIP struct {
	Version       string
	URL           string
	Authorization string
	// contains filtered or unexported fields
}

func New

func New(url, user, password string) *BIGIP

type BIGIPContext

type BIGIPContext struct {
	BIGIP
	context.Context
}

func (*BIGIPContext) All

func (bc *BIGIPContext) All(kind string) (*map[string]interface{}, error)

func (*BIGIPContext) Arps

func (bc *BIGIPContext) Arps() (*map[string]string, error)

func (*BIGIPContext) CommitTrans

func (bc *BIGIPContext) CommitTrans(transId float64) error

func (*BIGIPContext) Delete

func (bc *BIGIPContext) Delete(kind, name, partition, subfolder string) error

func (*BIGIPContext) DeleteDataGroup

func (bc *BIGIPContext) DeleteDataGroup(dgkey string) error

func (*BIGIPContext) DeletePartition

func (bc *BIGIPContext) DeletePartition(name string) error

DeletePartition delete the specified partition if exists on BIG-IP

func (*BIGIPContext) Deploy

func (bc *BIGIPContext) Deploy(kind, name, partition, subfolder string, body map[string]interface{}) error

func (*BIGIPContext) DeployPartition

func (bc *BIGIPContext) DeployPartition(name string) error

DeployPartition create the specified partition if not exists on BIG-IP

func (*BIGIPContext) DeployWithTrans

func (bc *BIGIPContext) DeployWithTrans(rr *[]RestRequest, transId float64) (int, error)

func (*BIGIPContext) DoRestRequests

func (bc *BIGIPContext) DoRestRequests(rr *[]RestRequest) error

func (*BIGIPContext) Exist

func (bc *BIGIPContext) Exist(kind, name, partition, subfolder string) (*map[string]interface{}, error)

func (*BIGIPContext) Fdbs

func (bc *BIGIPContext) Fdbs(tunnelName string) (*map[string]string, error)

func (*BIGIPContext) GenRestRequests

func (bc *BIGIPContext) GenRestRequests(partition string, ocfg, ncfg *map[string]interface{}) (*[]RestRequest, error)

GenRestRequests generate a list of rest requests, each item is type of RestRequest GenRestRequests will compare the passed ocfg and ncfg, and in addition the actual states got from BIG-IP, and concludes into a list of RestRequests indicating which resource needs to be POST, PATCH or DELETE, and in which order. The generated []RestRequest will be used by DoRestRequests function for execution in trasaction mode. ocfg, ncfg format:

{
	"<folder name>": {
		"[ltm|net|...]/<resource type>/<resource name>": {
			"resource property key": "resource property value",
			"...": "..."
		}
	},
	"...": "..."
}

The data transformation is:

{ocfgs}             	{ncfgs}

{typed-[rDels]} {typed-[rCrts]}

[c]         [u]        [d]

        Existings

u c u c d n/a

[sorted-rrs]

func (*BIGIPContext) GetExistingResources

func (bc *BIGIPContext) GetExistingResources(partition string, kinds []string) (*map[string]map[string]interface{}, error)

func (*BIGIPContext) ListPartitions

func (bc *BIGIPContext) ListPartitions() ([]string, error)

func (*BIGIPContext) LoadDataGroup

func (bc *BIGIPContext) LoadDataGroup(dgkey string) (*PersistedConfig, error)

func (*BIGIPContext) MakeTrans

func (bc *BIGIPContext) MakeTrans() (float64, error)

func (*BIGIPContext) Members

func (bc *BIGIPContext) Members(poolname string, partition string, subfolder string) ([]interface{}, error)

Members return []interface{} as /mgmt/tm/ltm/pool?expandSubcollections=true returns to us Key information like 'partition', 'name', 'address' are included.

func (*BIGIPContext) ModifyDbValue

func (bc *BIGIPContext) ModifyDbValue(name, value string) error

func (*BIGIPContext) Ndps

func (bc *BIGIPContext) Ndps() (*map[string]string, error)

func (*BIGIPContext) SaveDataGroup

func (bc *BIGIPContext) SaveDataGroup(dgkey string, pc *PersistedConfig) error

func (*BIGIPContext) SaveSysConfig

func (bc *BIGIPContext) SaveSysConfig(partitions []string) error

func (*BIGIPContext) Tmsh

func (bc *BIGIPContext) Tmsh(cmd string) (*map[string]interface{}, error)

func (*BIGIPContext) Update

func (bc *BIGIPContext) Update(kind, name, partition, subfolder string, body map[string]interface{}) error

func (*BIGIPContext) Upload

func (bc *BIGIPContext) Upload(name, content string) (string, error)

type BIGIPVersion

type BIGIPVersion struct {
	Build   string
	Date    string
	Edition string
	Product string
	Title   string
	Version string
}

type PersistedConfig

type PersistedConfig struct {
	AS3   string
	Rest  string
	CmKey string
	PsMap map[string]interface{}
}

type RestRequest

type RestRequest struct {
	ResName   string
	Partition string
	Subfolder string
	Kind      string

	Method     string
	ResUri     string
	Headers    map[string]interface{}
	Body       interface{}
	WithTrans  bool
	ScheduleIt string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL