api

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2020 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

TODO: add logging TODO: add timeouts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBluecatGatewayToken

func GetBluecatGatewayToken(cfg BluecatConfig) (string, http.Cookie, error)

GetBluecatGatewayToken retrieves a Bluecat Gateway API token.

func IsValidDNSDeployType

func IsValidDNSDeployType(deployType string) bool

IsValidDNSDeployType validates the deployment type provided by a users configuration is supported by the Bluecat Provider.

func SplitProperties

func SplitProperties(props string) map[string]string

SplitProperties is a helper function to break a '|' separated string into key/value pairs i.e. "foo=bar|baz=mop"

Types

type BluecatCNAMERecord

type BluecatCNAMERecord struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Properties string `json:"properties"`
	Type       string `json:"type"`
}

BluecatCNAMERecord defines dns CNAME record

type BluecatConfig

type BluecatConfig struct {
	GatewayHost      string `json:"gatewayHost"`
	GatewayUsername  string `json:"gatewayUsername,omitempty"`
	GatewayPassword  string `json:"gatewayPassword,omitempty"`
	DNSConfiguration string `json:"dnsConfiguration"`
	DNSServerName    string `json:"dnsServerName"`
	DNSDeployType    string `json:"dnsDeployType"`
	View             string `json:"dnsView"`
	RootZone         string `json:"rootZone"`
	SkipTLSVerify    bool   `json:"skipTLSVerify"`
}

TODO: Ensure DNS Deploy Type Defaults to no-deploy instead of ""

type BluecatCreateCNAMERecordRequest

type BluecatCreateCNAMERecordRequest struct {
	AbsoluteName string `json:"absolute_name"`
	LinkedRecord string `json:"linked_record"`
	TTL          int    `json:"ttl"`
	Properties   string `json:"properties"`
}

type BluecatCreateHostRecordRequest

type BluecatCreateHostRecordRequest struct {
	AbsoluteName string `json:"absolute_name"`
	IP4Address   string `json:"ip4_address"`
	TTL          int    `json:"ttl"`
	Properties   string `json:"properties"`
}

type BluecatCreateTXTRecordRequest

type BluecatCreateTXTRecordRequest struct {
	AbsoluteName string `json:"absolute_name"`
	Text         string `json:"txt"`
}

type BluecatHostRecord

type BluecatHostRecord struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Properties string `json:"properties"`
	Type       string `json:"type"`
}

BluecatHostRecord defines dns Host record

type BluecatServerFullDeployRequest

type BluecatServerFullDeployRequest struct {
	ServerName string `json:"server_name"`
}

type BluecatTXTRecord

type BluecatTXTRecord struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Properties string `json:"properties"`
}

BluecatTXTRecord defines dns TXT record

type BluecatZone

type BluecatZone struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Properties string `json:"properties"`
	Type       string `json:"type"`
}

BluecatZone defines a zone to hold records

type GatewayClient

type GatewayClient interface {
	GetBluecatZones(zoneName string) ([]BluecatZone, error)
	GetHostRecords(zone string, records *[]BluecatHostRecord) error
	GetCNAMERecords(zone string, records *[]BluecatCNAMERecord) error
	GetHostRecord(name string, record *BluecatHostRecord) error
	GetCNAMERecord(name string, record *BluecatCNAMERecord) error
	CreateHostRecord(zone string, req *BluecatCreateHostRecordRequest) error
	CreateCNAMERecord(zone string, req *BluecatCreateCNAMERecordRequest) error
	DeleteHostRecord(name string, zone string) (err error)
	DeleteCNAMERecord(name string, zone string) (err error)
	GetTXTRecords(zone string, records *[]BluecatTXTRecord) error
	GetTXTRecord(name string, record *BluecatTXTRecord) error
	CreateTXTRecord(zone string, req *BluecatCreateTXTRecordRequest) error
	DeleteTXTRecord(name string, zone string) error
	ServerFullDeploy() error
}

type GatewayClientConfig

type GatewayClientConfig struct {
	Cookie           http.Cookie
	Token            string
	Host             string
	DNSConfiguration string
	View             string
	RootZone         string
	DNSServerName    string
	SkipTLSVerify    bool
}

GatewayClientConfig defines the configuration for a Bluecat Gateway Client

func NewGatewayClientConfig

func NewGatewayClientConfig(cookie http.Cookie, token, gatewayHost, dnsConfiguration, view, rootZone, dnsServerName string, skipTLSVerify bool) GatewayClientConfig

NewGatewayClient creates and returns a new Bluecat gateway client

func (GatewayClientConfig) CreateCNAMERecord

func (c GatewayClientConfig) CreateCNAMERecord(zone string, req *BluecatCreateCNAMERecordRequest) error

func (GatewayClientConfig) CreateHostRecord

func (c GatewayClientConfig) CreateHostRecord(zone string, req *BluecatCreateHostRecordRequest) error

func (GatewayClientConfig) CreateTXTRecord

func (c GatewayClientConfig) CreateTXTRecord(zone string, req *BluecatCreateTXTRecordRequest) error

func (GatewayClientConfig) DeleteCNAMERecord

func (c GatewayClientConfig) DeleteCNAMERecord(name string, zone string) (err error)

func (GatewayClientConfig) DeleteHostRecord

func (c GatewayClientConfig) DeleteHostRecord(name string, zone string) (err error)

func (GatewayClientConfig) DeleteTXTRecord

func (c GatewayClientConfig) DeleteTXTRecord(name string, zone string) error

func (GatewayClientConfig) GetBluecatZones

func (c GatewayClientConfig) GetBluecatZones(zoneName string) ([]BluecatZone, error)

func (GatewayClientConfig) GetCNAMERecord

func (c GatewayClientConfig) GetCNAMERecord(name string, record *BluecatCNAMERecord) error

func (GatewayClientConfig) GetCNAMERecords

func (c GatewayClientConfig) GetCNAMERecords(zone string, records *[]BluecatCNAMERecord) error

func (GatewayClientConfig) GetHostRecord

func (c GatewayClientConfig) GetHostRecord(name string, record *BluecatHostRecord) error

func (GatewayClientConfig) GetHostRecords

func (c GatewayClientConfig) GetHostRecords(zone string, records *[]BluecatHostRecord) error

func (GatewayClientConfig) GetTXTRecord

func (c GatewayClientConfig) GetTXTRecord(name string, record *BluecatTXTRecord) error

func (GatewayClientConfig) GetTXTRecords

func (c GatewayClientConfig) GetTXTRecords(zone string, records *[]BluecatTXTRecord) error

func (GatewayClientConfig) ServerFullDeploy

func (c GatewayClientConfig) ServerFullDeploy() error

Jump to

Keyboard shortcuts

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