infoblox

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsInt64

func AsInt64(i *uint32) int64

func AsString

func AsString(str *string) string

func PagingGetObject

func PagingGetObject[T any](
	c ibclient.IBConnector,
	obj ibclient.IBObject,
	ref string,
	queryParams map[string]string,
	res *[]T,
) (err error)

func SameEndpoint

func SameEndpoint(a, b *endpoint.Endpoint) bool

SameEndpoint returns true if two endpoints are same considers example.org. and example.org DNSName/Target as different endpoints

func SameEndpoints

func SameEndpoints(a, b []*endpoint.Endpoint) bool

SameEndpoints compares two slices of endpoints regardless of order [x,y,z] == [z,x,y] [x,x,z] == [x,z,x] [x,y,y] != [x,x,y] [x,x,x] != [x,x,z]

func SameProviderSpecific

func SameProviderSpecific(a, b endpoint.ProviderSpecific) bool

SameProviderSpecific verifies that two maps contain the same string/string key/value pairs

Types

type ExtendedRequestBuilder

type ExtendedRequestBuilder struct {
	ibclient.WapiRequestBuilder
	// contains filtered or unexported fields
}

ExtendedRequestBuilder implements a HttpRequestBuilder which sets additional query parameter on all get requests

func NewExtendedRequestBuilder

func NewExtendedRequestBuilder(maxResults int, fqdnRegEx string, nameRegEx string) *ExtendedRequestBuilder

NewExtendedRequestBuilder returns a ExtendedRequestBuilder which adds _max_results query parameter to all GET requests

func (*ExtendedRequestBuilder) BuildRequest

func (mrb *ExtendedRequestBuilder) BuildRequest(t ibclient.RequestType, obj ibclient.IBObject, ref string, queryParams *ibclient.QueryParams) (req *http.Request, err error)

BuildRequest prepares the api request. it uses BuildRequest of WapiRequestBuilder and then add the _max_requests parameter

type Provider

type Provider struct {
	provider.BaseProvider
	// contains filtered or unexported fields
}

func NewInfobloxProvider

func NewInfobloxProvider(cfg *StartupConfig, domainFilter endpoint.DomainFilter) (*Provider, error)

NewInfobloxProvider creates a new Infoblox provider.

func (*Provider) AdjustEndpoints

func (p *Provider) AdjustEndpoints(endpoints []*endpoint.Endpoint) ([]*endpoint.Endpoint, error)

func (*Provider) ApplyChanges

func (p *Provider) ApplyChanges(_ context.Context, changes *plan.Changes) error

ApplyChanges applies the given changes.

func (*Provider) ChangesByZone

func (p *Provider) ChangesByZone(zones []*ibclient.ZoneAuth, changeSets []*infobloxChange) map[string][]*infobloxChange

func (*Provider) CountDiff

func (p *Provider) CountDiff(changes *plan.Changes)

if updateNew is not part of Update Old , object should be created if updateOld is not part of Update New , object should be deleted if it is not there (TTL might change) , object should be updated if we rename the object , object should be deleted and created

func (*Provider) Records

func (p *Provider) Records(_ context.Context) (endpoints []*endpoint.Endpoint, err error)

Records gets the current records.

type ResponseDetail

type ResponseDetail struct {
	Target string
	TTL    int64
}

type ResponseDetails

type ResponseDetails []ResponseDetail

func (ResponseDetails) ToEndpointDetail

func (rd ResponseDetails) ToEndpointDetail() (targets []string, ttl endpoint.TTL)

type ResponseMap

type ResponseMap struct {
	RecordType string
	Map        map[string]ResponseDetails
}

func ToAResponseMap

func ToAResponseMap(res []ibclient.RecordA) *ResponseMap

func ToCNAMEResponseMap

func ToCNAMEResponseMap(res []ibclient.RecordCNAME) *ResponseMap

func ToHostResponseMap

func ToHostResponseMap(res []ibclient.HostRecord) *ResponseMap

func ToPTRResponseMap added in v1.2.0

func ToPTRResponseMap(res []ibclient.RecordPTR) *ResponseMap

func ToTXTResponseMap

func ToTXTResponseMap(res []ibclient.RecordTXT) *ResponseMap

func (*ResponseMap) ToEndpoints

func (rm *ResponseMap) ToEndpoints() []*endpoint.Endpoint

type StartupConfig

type StartupConfig struct {
	Host         string `env:"INFOBLOX_HOST,required" envDefault:"localhost"`
	Port         int    `env:"INFOBLOX_PORT,required" envDefault:"443"`
	Username     string `env:"INFOBLOX_WAPI_USER,required"`
	Password     string `env:"INFOBLOX_WAPI_PASSWORD,required"`
	Version      string `env:"INFOBLOX_VERSION,required"`
	SSLVerify    bool   `env:"INFOBLOX_SSL_VERIFY" envDefault:"true"`
	DryRun       bool   `env:"INFOBLOX_DRY_RUN" envDefault:"false"`
	View         string `env:"INFOBLOX_VIEW" envDefault:"default"`
	MaxResults   int    `env:"INFOBLOX_MAX_RESULTS" envDefault:"1500"`
	CreatePTR    bool   `env:"INFOBLOX_CREATE_PTR" envDefault:"false"`
	DefaultTTL   int    `env:"INFOBLOX_DEFAULT_TTL" envDefault:"300"`
	ExtAttrsJSON string `env:"INFOBLOX_EXTENSIBLE_ATTRIBUTES_JSON" envDefault:"{}"`
	FQDNRegEx    string
	NameRegEx    string
}

StartupConfig clarifies the method signature

Jump to

Keyboard shortcuts

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