as3

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAgent

func CreateAgent() agentAS3

func DeepEqualJSON

func DeepEqualJSON(decl1, decl2 string) bool

Types

type AS3Config

type AS3Config struct {
	Schema      string      `json:"$schema"`
	Class       string      `json:"class"`
	Action      string      `json:"action"`
	Persist     bool        `json:"persist"`
	Declaration Declaration `json:"declaration"`
	JsonObj     string      `json:"-"`
}

type AS3Manager

type AS3Manager struct {
	As3SchemaLatest string
	Schema          string
	// Override existing as3 declaration with this configmap
	//OverriderCfgMapName string
	// Path of schemas reside locally
	//SchemaLocalPath string
	// POSTs configuration to BIG-IP using AS3
	PostManager *PostManager
	// To put list of tenants in BIG-IP REST call URL that are in AS3 declaration
	//FilterTenants    bool
	DefaultPartition string
	ReqChan          chan AS3Config
	RspChan          chan interface{}
	// contains filtered or unexported fields
}

AS3Manager holds all the AS3 orchestration specific config

func NewAS3Manager

func NewAS3Manager(params *Params) *AS3Manager

Create and return a new app manager that meets the Manager interface

func (*AS3Manager) ConfigDeployer

func (am *AS3Manager) ConfigDeployer()

configDeployer blocks on ReqChan whenever gets unblocked posts active configuration to BIG-IP

func (*AS3Manager) IsBigIPAppServicesAvailable

func (am *AS3Manager) IsBigIPAppServicesAvailable() error

Method to verify if App Services are installed or CIS as3 version is compatible with BIG-IP, it will return with error if any one of the requirements are not met

type Action

type Action struct {
	Type     string               `json:"type"`
	Event    string               `json:"event"`
	Enabled  bool                 `json:"enabled,omitempty"`
	Select   *ActionForwardSelect `json:"select,omitempty"`
	Policy   *ResourcePointer     `json:"policy,omitempty"`
	Location string               `json:"location,omitempty"`
	Replace  *ActionReplaceMap    `json:"replace,omitempty"`
}

type ActionForwardSelect

type ActionForwardSelect struct {
	Pool    *ResourcePointer `json:"pool,omitempty"`
	Service *ResourcePointer `json:"service,omitempty"`
}

type ActionReplaceMap

type ActionReplaceMap struct {
	Value string `json:"value,omitempty"`
	Name  string `json:"name,omitempty"`
	Path  string `json:"path,omitempty"`
}

type CABundle

type CABundle struct {
	Name   string `json:"-"`
	Class  string `json:"class"`
	Bundle string `json:"bundle"`
}

type CertName

type CertName struct {
	Certificate string `json:"certificate"`
}

type Certificate

type Certificate struct {
	Name        string `json:"-"`
	Class       string `json:"class"`
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"privateKey"`
	ChainCA     string `json:"chainCA"`
}

type ClientTLS

type ClientTLS struct {
	Name                string `json:"-"`
	Class               string `json:"class"`
	Label               string `json:"label,omitempty"`
	Remark              string `json:"remark,omitempty"`
	SendSNI             string `json:"sendSNI,omitempty"`
	Ciphers             string `json:"ciphers,omitempty"`
	ServerName          string `json:"serverName,omitempty"`
	ValidateCertificate bool   `json:"validateCertificate,omitempty"`
	TrustCA             string `json:"trustCA,omitempty"`
	IgnoreExpired       bool   `json:"ignoreExpired,omitempty"`
	IgnoreUntrusted     bool   `json:"ignoreUntrusted,omitempty"`
	SessionTickets      bool   `json:"sessionTickets,omitempty"`
	ClientCertificate   string `json:"clientCertificate"`
}

type Condition

type Condition struct {
	Type        string               `json:"type,omitempty"`
	Name        string               `json:"name,omitempty"`
	Event       string               `json:"event,omitempty"`
	All         *PolicyCompareString `json:"all,omitempty"`
	Index       int                  `json:"index,omitempty"`
	ServerName  *PolicyCompareString `json:"serverName,omitempty"`
	Host        *PolicyCompareString `json:"host,omitempty"`
	PathSegment *PolicyCompareString `json:"pathSegment,omitempty"`
	Path        *PolicyCompareString `json:"path,omitempty"`
	Address     *PolicyCompareString `json:"address,omitempty"`
	Normalized  bool                 `json:"normalized"`
}

as3Condition maps to Policy_Condition in AS3 Resources

type Controls

type Controls struct {
	Class     string `json:"class"`
	UserAgent string `json:"userAgent"`
}

type DataGroup

type DataGroup struct {
	Class       string    `json:"class"`
	Label       string    `json:"label"`
	StorageType string    `json:"storageType"`
	Name        string    `json:"name"`
	KeyDataType string    `json:"keyDataType"`
	Records     []*Record `json:"records"`
}

type Declaration

type Declaration struct {
	Class         string    `json:"class"`
	SchemaVersion string    `json:"schemaVersion"`
	ID            string    `json:"id"`
	Label         string    `json:"label"`
	Remark        string    `json:"remark"`
	Controls      *Controls `json:"controls,omitempty"`
	Tenant        Tenant    `json:"TGW_Tenant"`
}

type IRule

type IRule struct {
	Name  string           `json:"-"`
	Class string           `json:"class"`
	IRule *ResourcePointer `json:"iRule"`
}

type Member

type Member struct {
	ServicePort      int      `json:"servicePort"`
	ServerAddresses  []string `json:"serverAddresses"`
	AddressDiscovery string   `json:"addressDiscovery,omitempty"`
}

type Monitor

type Monitor struct {
	Class             string  `json:"class,omitempty"`
	Interval          int     `json:"interval,omitempty"`
	MonitorType       string  `json:"monitorType,omitempty"`
	TargetAddress     *string `json:"targetAddress,omitempty"`
	Timeout           int     `json:"timeout,omitempty"`
	TimeUnitilUp      *int    `json:"timeUntilUp,omitempty"`
	Adaptive          *bool   `json:"adaptive,omitempty"`
	Dscp              *int    `json:"dscp,omitempty"`
	Receive           string  `json:"receive,omitempty"`
	Send              string  `json:"send,omitempty"`
	TargetPort        *int    `json:"targetPort,omitempty"`
	ClientCertificate string  `json:"clientCertificate,omitempty"`
	Ciphers           string  `json:"ciphers,omitempty"`
}

type Params

type Params struct {
	// Package local for unit testing only
	Schema                    string
	SchemaVersion             string
	AS3Validation             bool
	SSLInsecure               bool
	EnableTLS                 string
	TLS13CipherGroupReference string
	Ciphers                   string
	//Agent                     string
	OverriderCfgMapName string
	SchemaLocalPath     string
	FilterTenants       bool
	BIGIPUsername       string
	BIGIPPassword       string
	BIGIPURL            string
	TrustedCerts        string
	AS3PostDelay        int
	//ConfigWriter        writer.Writer
	EventChan chan interface{}
	//Log the AS3 response body in Controller logs
	LogResponse bool
	RspChan     chan interface{}
	UserAgent   string
	As3Version  string
	As3Release  string
	// contains filtered or unexported fields
}

Struct to allow NewManager to receive all or only specific parameters.

type PolicyCompareString

type PolicyCompareString struct {
	CaseSensitive bool     `json:"caseSensitive,omitempty"`
	Values        []string `json:"values,omitempty"`
	Operand       string   `json:"operand,omitempty"`
}

as3PolicyCompareString maps to Policy_Compare_String in AS3 Resources

type PolicyEndpoint

type PolicyEndpoint struct {
	Name     string        `json:"-"`
	Class    string        `json:"class"`
	Label    string        `json:"label"`
	Remark   string        `json:"remark"`
	Rules    []*PolicyRule `json:"rules"`
	Strategy string        `json:"strategy,omitempty"`
}

type PolicyRule

type PolicyRule struct {
	Name       string       `json:"name"`
	Conditions []*Condition `json:"conditions"`
	Actions    []*Action    `json:"actions"`
}

type Pool

type Pool struct {
	Name                 string            `json:"-"`
	Class                string            `json:"class"`
	Label                string            `json:"label"`
	Remark               string            `json:"remark,omitempty"`
	Members              []Member          `json:"members"`
	Monitors             []ResourcePointer `json:"monitors"`
	LoadBalancingMode    string            `json:"loadBalancingMode,omitempty"`
	MinimumMembersActive int               `json:"minimumMembersActive,omitempty"`
	ReselectTries        int               `json:"reselectTries,omitempty"`
	ServiceDownAction    string            `json:"serviceDownAction,omitempty"`
	SlowRampTime         int               `json:"slowRampTime,omitempty"`
	MinimumMonitors      int               `json:"minimumMonitors,omitempty"`
}

type PostManager

type PostManager struct {
	PostParams
	// contains filtered or unexported fields
}

func NewPostManager

func NewPostManager(params PostParams) *PostManager

func (*PostManager) DeletePartition

func (postMgr *PostManager) DeletePartition(tenants []string) error

func (*PostManager) GetBigipAS3Version

func (postMgr *PostManager) GetBigipAS3Version() (string, string, error)

type PostParams

type PostParams struct {
	BIGIPUsername string
	BIGIPPassword string
	BIGIPURL      string
	TrustedCerts  string
	SSLInsecure   bool
	AS3PostDelay  int
	//Log the AS3 response body in Controller logs
	LogResponse bool
}

type Record

type Record struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ResourcePointer

type ResourcePointer struct {
	BigIP  string `json:"bigip,omitempty"`
	Use    string `json:"use,omitempty"`
	Base64 string `json:"base64,omitempty"`
}

type ServerTLS

type ServerTLS struct {
	Name                    string           `json:"-"`
	Class                   string           `json:"class"`
	Label                   string           `json:"label"`
	Remark                  string           `json:"remark,omitempty"`
	Certificates            []CertName       `json:"certificates"`
	RequireSNI              string           `json:"requireSNI,omitempty"`
	Ciphers                 string           `json:"ciphers,omitempty"`
	CipherGroup             *ResourcePointer `json:"cipherGroup,omitempty"`
	Tls1_3Enabled           bool             `json:"tls1_3Enabled,omitempty"`
	RenegotiationEnabled    *bool            `json:"renegotiationEnabled,omitempty"`
	AuthenticationTrustCA   string           `json:"authenticationTrustCA,omitempty"`
	AuthenticationMode      string           `json:"authenticationMode"`
	AuthenticationFrequency string           `json:"authenticationFrequency,omitempty"`
}

type Service

type Service struct {
	Name                   string   `json:"-"`
	Class                  string   `json:"class"`
	Layer4                 string   `json:"layer4,omitempty"`
	Source                 string   `json:"source,omitempty"`
	TranslateServerAddress bool     `json:"translateServerAddress,omitempty"`
	TranslateServerPort    bool     `json:"translateServerPort,omitempty"`
	ServerTLS              string   `json:"serverTLS,omitempty"`
	ClientTLS              string   `json:"clientTLS,omitempty"`
	VirtualPort            int      `json:"virtualPort"`
	VirtualAddresses       []string `json:"virtualAddresses"`
	SNAT                   string   `json:"snat,omitempty"`
	Pool                   string   `json:"pool,omitempty"`
	PersistenceMethods     []string `json:"persistenceMethods,omitempty"`
	PolicyEndpoint         string   `json:"policyEndpoint,omitempty"`
	IRules                 []string `json:"iRules,omitempty"`
	Redirect80             *bool    `json:"redirect80,omitempty"`
}

type Tenant

type Tenant struct {
	Name               string                 `json:"-"`
	Class              string                 `json:"class"`
	DefaultRouteDomain int                    `json:"defaultRouteDomain"`
	Application        map[string]interface{} `json:"TermatingGateway"`
}

Jump to

Keyboard shortcuts

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