ibclient

package module
v2.3.2 Latest Latest
Warning

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

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

README

Infoblox Go Client

An Infoblox NIOS WAPI client library in Golang. The library enables us to do a CRUD oprations on NIOS Objects.

This library is compatible with Go 1.2+

Build Status

Build Status

Prerequisites

  • Infoblox GRID with 2.5 or above WAPI support
  • Go 1.2 or above

Installation

To get the latest released version v2.1.0 of Go Client use below command.

go get github.com/infobloxopen/infoblox-go-client/v2

To get the previous major version v1.1.1 use below command.

go get github.com/infobloxopen/infoblox-go-client

Note: Go client version v2.0.0 and above have breaking changes and are not backward compatible.

Usage

The following is a very simple example for the client usage:

   package main

   import (
     "fmt"
     ibclient "github.com/infobloxopen/infoblox-go-client/v2"
   )

   func main() {
     hostConfig := ibclient.HostConfig{
     	Host:    "<NIOS grid IP>",
        Version: "<WAPI version>",
        Port:    "PORT",
     }
     authConfig := ibclient.AuthConfig{
        Username: "username",
        Password: "password",
     }
     transportConfig := ibclient.NewTransportConfig("false", 20, 10)
     requestBuilder := &ibclient.WapiRequestBuilder{}
     requestor := &ibclient.WapiHttpRequestor{}
     conn, err := ibclient.NewConnector(hostConfig, authConfig, transportConfig, requestBuilder, requestor)
     if err != nil {
     	fmt.Println(err)
     }
     defer conn.Logout()
     objMgr := ibclient.NewObjectManager(conn, "myclient", "")
     //Fetches grid information
     fmt.Println(objMgr.GetGridLicense())
   } 

Supported NIOS operations

  • AllocateIP
  • AllocateNetwork
  • AllocateNetworkContainer
  • CreateARecord
  • CreateAAAARecord
  • CreateZoneAuth
  • CreateCNAMERecord
  • CreateDefaultNetviews
  • CreateEADefinition
  • CreateHostRecord
  • CreateNetwork
  • CreateNetworkContainer
  • CreateNetworkView
  • CreatePTRRecord
  • CreateTXTRecord
  • CreateZoneDelegated
  • DeleteARecord
  • DeleteAAAARecord
  • DeleteZoneAuth
  • DeleteCNAMERecord
  • DeleteFixedAddress
  • DeleteHostRecord
  • DeleteNetwork
  • DeleteNetworkView
  • DeletePTRRecord
  • DeleteTXTRecord
  • DeleteZoneDelegated
  • GetAllMembers
  • GetARecordByRef
  • GetARecord
  • GetAAAARecordByRef
  • GetAAAARecord
  • GetCapacityReport
  • GetCNAMERecordByRef
  • GetCNAMERecord
  • GetEADefinition
  • GetFixedAddress
  • GetFixedAddressByRef
  • GetHostRecord
  • GetHostRecordByRef
  • SearchHostRecordByAltId
  • GetIpAddressFromHostRecord
  • GetNetwork
  • GetNetworkByRef
  • GetNetworkContainer
  • GetNetworkContainerByRef
  • GetNetworkView
  • GetNetworkViewByRef
  • GetPTRRecordByRef
  • GetPTRRecord
  • GetTXTRecord
  • GetTXTRecordByRef
  • GetZoneAuthByRef
  • GetZoneDelegated
  • GetUpgradeStatus (2.7 or above)
  • GetAllMembers
  • GetGridInfo
  • GetGridLicense
  • ReleaseIP
  • UpdateAAAARecord
  • UpdateCNAMERecord
  • UpdateFixedAddress
  • UpdateHostRecord
  • UpdateNetwork
  • UpdateNetworkContainer
  • UpdateNetworkView
  • UpdatePTRRecord
  • UpdateTXTRecord
  • UpdateARecord
  • UpdateZoneDelegated

Documentation

Index

Constants

View Source
const MACADDR_ZERO = "00:00:00:00:00:00"

Variables

View Source
var ValidateConnector = validateConnector

Functions

func CheckIntRange

func CheckIntRange(name string, value int, min int, max int) error

func GetIPAddressFromRef

func GetIPAddressFromRef(ref string) string

func ValidateDomainName

func ValidateDomainName(name string) error

ValidateDomainName return an error if the domain name does not conform to standards. The domain name may be in Unicode format (internationalized domain name)

func ValidateSrvRecName

func ValidateSrvRecName(name string) error

ValidateSrvRecName return an error if the record's name does not conform to standards.

Types

type AuthConfig

type AuthConfig struct {
	Username string
	Password string

	ClientCert []byte
	ClientKey  []byte
}

type Bool

type Bool bool

func (Bool) MarshalJSON

func (b Bool) MarshalJSON() ([]byte, error)

type CapacityReport

type CapacityReport struct {
	IBBase `json:"-"`
	Ref    string `json:"_ref,omitempty"`

	Name         string                   `json:"name,omitempty"`
	HardwareType string                   `json:"hardware_type,omitempty"`
	MaxCapacity  int                      `json:"max_capacity,omitempty"`
	ObjectCount  []map[string]interface{} `json:"object_counts,omitempty"`
	PercentUsed  int                      `json:"percent_used,omitempty"`
	Role         string                   `json:"role,omitempty"`
	TotalObjects int                      `json:"total_objects,omitempty"`
}

CapacityReport represents capacityreport object

func NewCapcityReport

func NewCapcityReport(capReport CapacityReport) *CapacityReport

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

func NewConnector

func NewConnector(hostConfig HostConfig, authCfg AuthConfig, transportConfig TransportConfig,
	requestBuilder HttpRequestBuilder, requestor HttpRequestor) (res *Connector, err error)

func (*Connector) CreateObject

func (c *Connector) CreateObject(obj IBObject) (ref string, err error)

func (*Connector) DeleteObject

func (c *Connector) DeleteObject(ref string) (refRes string, err error)

func (*Connector) GetObject

func (c *Connector) GetObject(
	obj IBObject, ref string,
	queryParams *QueryParams, res interface{}) (err error)

func (*Connector) Logout

func (c *Connector) Logout() (err error)

Logout sends a request to invalidate the ibapauth cookie and should be used in a defer statement after the Connector has been successfully initialized.

func (*Connector) UpdateObject

func (c *Connector) UpdateObject(obj IBObject, ref string) (refRes string, err error)

type DNSView

type DNSView struct {
	IBBase      `json:"-"`
	Ref         string `json:"_ref"`
	Name        string `json:"name"`
	NetworkView string `json:"network_view"`
	Comment     string `json:"comment"`
	Ea          EA     `json:"extattrs"`
}

func NewEmptyDNSView

func NewEmptyDNSView() *DNSView

type EA

type EA map[string]interface{}

func (EA) Count

func (ea EA) Count() int

func (EA) MarshalJSON

func (ea EA) MarshalJSON() ([]byte, error)

func (*EA) UnmarshalJSON

func (ea *EA) UnmarshalJSON(b []byte) (err error)

type EADefListValue

type EADefListValue string

func (EADefListValue) MarshalJSON

func (v EADefListValue) MarshalJSON() ([]byte, error)

func (*EADefListValue) UnmarshalJSON

func (v *EADefListValue) UnmarshalJSON(b []byte) (err error)

type EADefinition

type EADefinition struct {
	IBBase             `json:"-"`
	Ref                string           `json:"_ref,omitempty"`
	Comment            string           `json:"comment"`
	Flags              string           `json:"flags,omitempty"`
	ListValues         []EADefListValue `json:"list_values,omitempty"`
	Name               string           `json:"name,omitempty"`
	Type               string           `json:"type,omitempty"`
	AllowedObjectTypes []string         `json:"allowed_object_types,omitempty"`
}

func NewEADefinition

func NewEADefinition(eadef EADefinition) *EADefinition

type EASearch

type EASearch map[string]interface{}

func (EASearch) MarshalJSON

func (eas EASearch) MarshalJSON() ([]byte, error)

type FixedAddress

type FixedAddress struct {
	IBBase      `json:"-"`
	Ref         string `json:"_ref,omitempty"`
	NetviewName string `json:"network_view,omitempty"`
	Cidr        string `json:"network,omitempty"`
	Comment     string `json:"comment"`
	IPv4Address string `json:"ipv4addr,omitempty"`
	IPv6Address string `json:"ipv6addr,omitempty"`
	Duid        string `json:"duid,omitempty"`
	Mac         string `json:"mac,omitempty"`
	Name        string `json:"name,omitempty"`
	MatchClient string `json:"match_client,omitempty"`
	Ea          EA     `json:"extattrs"`
}

func NewEmptyFixedAddress

func NewEmptyFixedAddress(isIPv6 bool) *FixedAddress

func NewFixedAddress

func NewFixedAddress(
	netView string,
	name string,
	ipAddr string,
	cidr string,
	macOrDuid string,
	clients string,
	eas EA,
	ref string,
	isIPv6 bool,
	comment string) *FixedAddress

type Grid

type Grid struct {
	IBBase     `json:"-"`
	Ref        string      `json:"_ref,omitempty"`
	Name       string      `json:"name,omitempty"`
	NTPSetting *NTPSetting `json:"ntp_setting,omitempty"`
}

func NewGrid

func NewGrid(grid Grid) *Grid

type HostConfig

type HostConfig struct {
	Host    string
	Version string
	Port    string
}

type HostRecord

type HostRecord struct {
	IBBase      `json:"-"`
	Ref         string               `json:"_ref,omitempty"`
	Ipv4Addr    string               `json:"ipv4addr,omitempty"`
	Ipv4Addrs   []HostRecordIpv4Addr `json:"ipv4addrs"`
	Ipv6Addr    string               `json:"ipv6addr,omitempty"`
	Ipv6Addrs   []HostRecordIpv6Addr `json:"ipv6addrs"`
	Name        string               `json:"name,omitempty"`
	View        string               `json:"view,omitempty"`
	Zone        string               `json:"zone,omitempty"`
	EnableDns   bool                 `json:"configure_for_dns"`
	NetworkView string               `json:"network_view,omitempty"`
	Comment     string               `json:"comment"`
	Ea          EA                   `json:"extattrs"`
	UseTtl      bool                 `json:"use_ttl"`
	Ttl         uint32               `json:"ttl"`
	Aliases     []string             `json:"aliases,omitempty"`
}

func NewEmptyHostRecord

func NewEmptyHostRecord() *HostRecord

func NewHostRecord

func NewHostRecord(
	netView string,
	name string,
	ipv4Addr string,
	ipv6Addr string,
	ipv4AddrList []HostRecordIpv4Addr,
	ipv6AddrList []HostRecordIpv6Addr,
	eas EA,
	enableDNS bool,
	dnsView string,
	zone string,
	ref string,
	useTtl bool,
	ttl uint32,
	comment string,
	aliases []string) *HostRecord

type HostRecordIpv4Addr

type HostRecordIpv4Addr struct {
	IBBase     `json:"-"`
	Ipv4Addr   string `json:"ipv4addr,omitempty"`
	Ref        string `json:"_ref,omitempty"`
	Mac        string `json:"mac"`
	View       string `json:"view,omitempty"`
	Cidr       string `json:"network,omitempty"`
	EnableDhcp bool   `json:"configure_for_dhcp"`
}

func NewEmptyHostRecordIpv4Addr

func NewEmptyHostRecordIpv4Addr() *HostRecordIpv4Addr

func NewHostRecordIpv4Addr

func NewHostRecordIpv4Addr(
	ipAddr string,
	macAddr string,
	enableDhcp bool,
	ref string) *HostRecordIpv4Addr

type HostRecordIpv6Addr

type HostRecordIpv6Addr struct {
	IBBase     `json:"-"`
	Ipv6Addr   string `json:"ipv6addr,omitempty"`
	Ref        string `json:"_ref,omitempty"`
	Duid       string `json:"duid"`
	View       string `json:"view,omitempty"`
	Cidr       string `json:"network,omitempty"`
	EnableDhcp bool   `json:"configure_for_dhcp"`
}

func NewEmptyHostRecordIpv6Addr

func NewEmptyHostRecordIpv6Addr() *HostRecordIpv6Addr

func NewHostRecordIpv6Addr

func NewHostRecordIpv6Addr(
	ipAddr string,
	duid string,
	enableDhcp bool,
	ref string) *HostRecordIpv6Addr

type HttpRequestBuilder

type HttpRequestBuilder interface {
	Init(HostConfig, AuthConfig)
	BuildUrl(r RequestType, objType string, ref string, returnFields []string, queryParams *QueryParams) (urlStr string)
	BuildBody(r RequestType, obj IBObject) (jsonStr []byte)
	BuildRequest(r RequestType, obj IBObject, ref string, queryParams *QueryParams) (req *http.Request, err error)
}

type HttpRequestor

type HttpRequestor interface {
	Init(AuthConfig, TransportConfig)
	SendRequest(*http.Request) ([]byte, error)
}

type IBBase

type IBBase struct {
	// contains filtered or unexported fields
}

func (*IBBase) EaSearch

func (obj *IBBase) EaSearch() EASearch

func (*IBBase) ObjectType

func (obj *IBBase) ObjectType() string

func (*IBBase) ReturnFields

func (obj *IBBase) ReturnFields() []string

type IBConnector

type IBConnector interface {
	CreateObject(obj IBObject) (ref string, err error)
	GetObject(obj IBObject, ref string, queryParams *QueryParams, res interface{}) error
	DeleteObject(ref string) (refRes string, err error)
	UpdateObject(obj IBObject, ref string) (refRes string, err error)
}

type IBObject

type IBObject interface {
	ObjectType() string
	ReturnFields() []string
	EaSearch() EASearch
}

type IBObjectManager

type IBObjectManager interface {
	GetDNSView(name string) (*DNSView, error)
	AllocateIP(netview string, cidr string, ipAddr string, isIPv6 bool, macOrDuid string, name string, comment string, eas EA) (*FixedAddress, error)
	AllocateNetwork(netview string, cidr string, isIPv6 bool, prefixLen uint, comment string, eas EA) (network *Network, err error)
	AllocateNetworkContainer(netview string, cidr string, isIPv6 bool, prefixLen uint, comment string, eas EA) (netContainer *NetworkContainer, err error)
	CreateARecord(netView string, dnsView string, name string, cidr string, ipAddr string, ttl uint32, useTTL bool, comment string, ea EA) (*RecordA, error)
	CreateAAAARecord(netView string, dnsView string, recordName string, cidr string, ipAddr string, useTtl bool, ttl uint32, comment string, eas EA) (*RecordAAAA, error)
	CreateZoneAuth(fqdn string, ea EA) (*ZoneAuth, error)
	CreateCNAMERecord(dnsview string, canonical string, recordname string, useTtl bool, ttl uint32, comment string, eas EA) (*RecordCNAME, error)
	CreateDefaultNetviews(globalNetview string, localNetview string) (globalNetviewRef string, localNetviewRef string, err error)
	CreateEADefinition(eadef EADefinition) (*EADefinition, error)
	CreateHostRecord(enabledns bool, enabledhcp bool, recordName string, netview string, dnsview string, ipv4cidr string, ipv6cidr string, ipv4Addr string, ipv6Addr string, macAddr string, duid string, useTtl bool, ttl uint32, comment string, eas EA, aliases []string) (*HostRecord, error)
	CreateMXRecord(dnsView string, fqdn string, mx string, preference uint32, ttl uint32, useTtl bool, comment string, eas EA) (*RecordMX, error)
	CreateNetwork(netview string, cidr string, isIPv6 bool, comment string, eas EA) (*Network, error)
	CreateNetworkContainer(netview string, cidr string, isIPv6 bool, comment string, eas EA) (*NetworkContainer, error)
	CreateNetworkView(name string, comment string, setEas EA) (*NetworkView, error)
	CreatePTRRecord(networkView string, dnsView string, ptrdname string, recordName string, cidr string, ipAddr string, useTtl bool, ttl uint32, comment string, eas EA) (*RecordPTR, error)
	CreateSRVRecord(dnsView string, name string, priority uint32, weight uint32, port uint32, target string, ttl uint32, useTtl bool, comment string, eas EA) (*RecordSRV, error)
	CreateTXTRecord(dnsView string, recordName string, text string, ttl uint32, useTtl bool, comment string, eas EA) (*RecordTXT, error)
	CreateZoneDelegated(fqdn string, delegate_to []NameServer) (*ZoneDelegated, error)
	DeleteARecord(ref string) (string, error)
	DeleteAAAARecord(ref string) (string, error)
	DeleteZoneAuth(ref string) (string, error)
	DeleteCNAMERecord(ref string) (string, error)
	DeleteFixedAddress(ref string) (string, error)
	DeleteHostRecord(ref string) (string, error)
	DeleteMXRecord(ref string) (string, error)
	DeleteNetwork(ref string) (string, error)
	DeleteNetworkContainer(ref string) (string, error)
	DeleteNetworkView(ref string) (string, error)
	DeletePTRRecord(ref string) (string, error)
	DeleteSRVRecord(ref string) (string, error)
	DeleteTXTRecord(ref string) (string, error)
	DeleteZoneDelegated(ref string) (string, error)
	GetARecordByRef(ref string) (*RecordA, error)
	GetARecord(dnsview string, recordName string, ipAddr string) (*RecordA, error)
	GetAAAARecord(dnsview string, recordName string, ipAddr string) (*RecordAAAA, error)
	GetAAAARecordByRef(ref string) (*RecordAAAA, error)
	GetCNAMERecord(dnsview string, canonical string, recordName string) (*RecordCNAME, error)
	GetCNAMERecordByRef(ref string) (*RecordCNAME, error)
	GetEADefinition(name string) (*EADefinition, error)
	GetFixedAddress(netview string, cidr string, ipAddr string, isIPv6 bool, macOrDuid string) (*FixedAddress, error)
	GetFixedAddressByRef(ref string) (*FixedAddress, error)
	GetHostRecord(netview string, dnsview string, recordName string, ipv4addr string, ipv6addr string) (*HostRecord, error)
	SearchHostRecordByAltId(internalId string, ref string, eaNameForInternalId string) (*HostRecord, error)
	GetHostRecordByRef(ref string) (*HostRecord, error)
	GetIpAddressFromHostRecord(host HostRecord) (string, error)
	GetMXRecord(dnsView string, fqdn string, mx string, preference uint32) (*RecordMX, error)
	GetMXRecordByRef(ref string) (*RecordMX, error)
	GetNetwork(netview string, cidr string, isIPv6 bool, ea EA) (*Network, error)
	GetNetworkByEA(netview string, ea map[string]interface{}) (interface{}, error)
	GetNetworkByRef(ref string) (*Network, error)
	GetNetworkContainer(netview string, cidr string, isIPv6 bool, eaSearch EA) (*NetworkContainer, error)
	GetNetworkContainerByRef(ref string) (*NetworkContainer, error)
	GetNetworkView(name string) (*NetworkView, error)
	GetNetworkViewByRef(ref string) (*NetworkView, error)
	GetPTRRecord(dnsview string, ptrdname string, recordName string, ipAddr string) (*RecordPTR, error)
	GetPTRRecordByRef(ref string) (*RecordPTR, error)
	GetSRVRecord(dnsView string, name string, target string, port uint32) (*RecordSRV, error)
	GetSRVRecordByRef(ref string) (*RecordSRV, error)
	GetTXTRecord(dnsview string, name string) (*RecordTXT, error)
	GetTXTRecordByRef(ref string) (*RecordTXT, error)
	GetZoneAuthByRef(ref string) (*ZoneAuth, error)
	GetZoneDelegated(fqdn string) (*ZoneDelegated, error)
	GetCapacityReport(name string) ([]CapacityReport, error)
	GetUpgradeStatus(statusType string) ([]UpgradeStatus, error)
	GetAllMembers() ([]Member, error)
	GetGridInfo() ([]Grid, error)
	GetGridLicense() ([]License, error)
	ReleaseIP(netview string, cidr string, ipAddr string, isIPv6 bool, macAddr string) (string, error)
	UpdateAAAARecord(ref string, netView string, recordName string, cidr string, ipAddr string, useTtl bool, ttl uint32, comment string, setEas EA) (*RecordAAAA, error)
	UpdateCNAMERecord(ref string, canonical string, recordName string, useTtl bool, ttl uint32, comment string, setEas EA) (*RecordCNAME, error)
	UpdateFixedAddress(fixedAddrRef string, netview string, name string, cidr string, ipAddr string, matchclient string, macOrDuid string, comment string, eas EA) (*FixedAddress, error)
	UpdateHostRecord(hostRref string, enabledns bool, enabledhcp bool, name string, netview string, dnsView string, ipv4cidr string, ipv6cidr string, ipv4Addr string, ipv6Addr string, macAddress string, duid string, useTtl bool, ttl uint32, comment string, eas EA, aliases []string) (*HostRecord, error)
	UpdateMXRecord(ref string, dnsView string, fqdn string, mx string, preference uint32, ttl uint32, useTtl bool, comment string, eas EA) (*RecordMX, error)
	UpdateNetwork(ref string, setEas EA, comment string) (*Network, error)
	UpdateNetworkContainer(ref string, setEas EA, comment string) (*NetworkContainer, error)
	UpdateNetworkView(ref string, name string, comment string, setEas EA) (*NetworkView, error)
	UpdatePTRRecord(ref string, netview string, ptrdname string, name string, cidr string, ipAddr string, useTtl bool, ttl uint32, comment string, setEas EA) (*RecordPTR, error)
	UpdateSRVRecord(ref string, name string, priority uint32, weight uint32, port uint32, target string, ttl uint32, useTtl bool, comment string, eas EA) (*RecordSRV, error)
	UpdateTXTRecord(ref string, recordName string, text string, ttl uint32, useTtl bool, comment string, eas EA) (*RecordTXT, error)
	UpdateARecord(ref string, name string, ipAddr string, cidr string, netview string, ttl uint32, useTTL bool, comment string, eas EA) (*RecordA, error)
	UpdateZoneDelegated(ref string, delegate_to []NameServer) (*ZoneDelegated, error)
}

func NewObjectManager

func NewObjectManager(connector IBConnector, cmpType string, tenantID string) IBObjectManager

type Ipv6Setting

type Ipv6Setting struct {
	AutoRouterConfigEnabled bool   `json:"auto_router_config_enabled"`
	CidrPrefix              uint   `json:"cidr_prefix,omitempty"`
	Dscp                    uint   `json:"dscp,omitempty"`
	Enabled                 bool   `json:"enabled,omitempty"`
	Gateway                 string `json:"gateway"`
	Primary                 string `json:"primary,omitempty"`
	VirtualIp               string `json:"virtual_ip"`
	VlanId                  uint   `json:"vlan_id,emitempty"`
	UseDscp                 bool   `json:"use_dscp,omitempty"`
}

type LanHaPortSetting

type LanHaPortSetting struct {
	HAIpAddress    string              `json:"ha_ip_address,omitempty"`
	HaPortSetting  PhysicalPortSetting `json:"ha_port_setting,omitempty"`
	LanPortSetting PhysicalPortSetting `json:"lan_port_setting,omitempty"`
	MgmtIpv6addr   string              `json:"mgmt_ipv6addr,omitempty"`
	MgmtLan        string              `json:"mgmt_lan,omitempty"`
}

type License

type License struct {
	IBBase           `json:"-"`
	Ref              string `json:"_ref,omitempty"`
	ExpirationStatus string `json:"expiration_status,omitempty"`
	ExpiryDate       int    `json:"expiry_date,omitempty"`
	HwID             string `json:"hwid,omitempty"`
	Key              string `json:"key,omitempty"`
	Kind             string `json:"kind,omitempty"`
	Limit            string `json:"limit,omitempty"`
	LimitContext     string `json:"limit_context,omitempty"`
	Licensetype      string `json:"type,omitempty"`
}

License represents license wapi object

func NewGridLicense

func NewGridLicense(license License) *License

func NewLicense

func NewLicense(license License) *License

type Lock

type Lock interface {
	Lock() error
	UnLock(force bool) error
}

type Member

type Member struct {
	IBBase                   `json:"-"`
	Ref                      string     `json:"_ref,omitempty"`
	HostName                 string     `json:"host_name,omitempty"`
	ConfigAddrType           string     `json:"config_addr_type,omitempty"`
	PLATFORM                 string     `json:"platform,omitempty"`
	ServiceTypeConfiguration string     `json:"service_type_configuration,omitempty"`
	Nodeinfo                 []NodeInfo `json:"node_info,omitempty"`
	TimeZone                 string     `json:"time_zone,omitempty"`
}

Member represents NIOS member

func NewMember

func NewMember(member Member) *Member

type MultiRequest

type MultiRequest struct {
	IBBase `json:"-"`
	Body   []*RequestBody
}

func NewMultiRequest

func NewMultiRequest(body []*RequestBody) *MultiRequest

func (*MultiRequest) MarshalJSON

func (r *MultiRequest) MarshalJSON() ([]byte, error)

type NTPSetting

type NTPSetting struct {
	EnableNTP  bool                   `json:"enable_ntp,omitempty"`
	NTPAcl     map[string]interface{} `json:"ntp_acl,omitempty"`
	NTPKeys    []string               `json:"ntp_keys,omitempty"`
	NTPKod     bool                   `json:"ntp_kod,omitempty"`
	NTPServers []NTPserver            `json:"ntp_servers,omitempty"`
}

type NTPserver

type NTPserver struct {
	Address              string `json:"address,omitempty"`
	Burst                bool   `json:"burst,omitempty"`
	EnableAuthentication bool   `json:"enable_authentication,omitempty"`
	IBurst               bool   `json:"iburst,omitempty"`
	NTPKeyNumber         uint   `json:"ntp_key_number,omitempty"`
	Preffered            bool   `json:"preffered,omitempty"`
}

type NameServer

type NameServer struct {
	Address string `json:"address,omitempty"`
	Name    string `json:"name,omitempty"`
}

type Network

type Network struct {
	IBBase
	Ref         string `json:"_ref,omitempty"`
	NetviewName string `json:"network_view,omitempty"`
	Cidr        string `json:"network,omitempty"`
	Ea          EA     `json:"extattrs"`
	Comment     string `json:"comment"`
}

func BuildIPv6NetworkFromRef

func BuildIPv6NetworkFromRef(ref string) (*Network, error)

func BuildNetworkFromRef

func BuildNetworkFromRef(ref string) (*Network, error)

func NewNetwork

func NewNetwork(netview string, cidr string, isIPv6 bool, comment string, ea EA) *Network

type NetworkContainer

type NetworkContainer struct {
	IBBase      `json:"-"`
	Ref         string `json:"_ref,omitempty"`
	NetviewName string `json:"network_view,omitempty"`
	Cidr        string `json:"network,omitempty"`
	Comment     string `json:"comment"`
	Ea          EA     `json:"extattrs"`
}

func BuildIPv6NetworkContainerFromRef

func BuildIPv6NetworkContainerFromRef(ref string) (*NetworkContainer, error)

func BuildNetworkContainerFromRef

func BuildNetworkContainerFromRef(ref string) (*NetworkContainer, error)

func NewNetworkContainer

func NewNetworkContainer(netview, cidr string, isIPv6 bool, comment string, ea EA) *NetworkContainer

type NetworkContainerNextAvailable

type NetworkContainerNextAvailable struct {
	IBBase  `json:"-"`
	Network *NetworkContainerNextAvailableInfo `json:"network"`
	Comment string                             `json:"comment"`
	Ea      EA                                 `json:"extattrs"`
}

func NewNetworkContainerNextAvailable

func NewNetworkContainerNextAvailable(ncav *NetworkContainerNextAvailableInfo, isIPv6 bool, comment string, ea EA) *NetworkContainerNextAvailable

type NetworkContainerNextAvailableInfo

type NetworkContainerNextAvailableInfo struct {
	Function     string            `json:"_object_function"`
	ResultField  string            `json:"_result_field"`
	Object       string            `json:"_object"`
	ObjectParams map[string]string `json:"_object_parameters"`
	Params       map[string]uint   `json:"_parameters"`
	NetviewName  string            `json:"network_view,omitempty"`
}

func NewNetworkContainerNextAvailableInfo

func NewNetworkContainerNextAvailableInfo(netview, cidr string, prefixLen uint, isIPv6 bool) *NetworkContainerNextAvailableInfo

type NetworkSetting

type NetworkSetting struct {
	Address    string `json:"address"`
	Dscp       uint   `json:"dscp"`
	Gateway    string `json:"gateway"`
	Primary    bool   `json:"primary"`
	SubnetMask string `json:"subnet_mask"`
	UseDscp    bool   `json:"use_dscp,omiempty"`
	VlanId     uint   `json:"vlan_id,omitempty"`
}

type NetworkView

type NetworkView struct {
	IBBase  `json:"-"`
	Ref     string `json:"_ref,omitempty"`
	Name    string `json:"name,omitempty"`
	Comment string `json:"comment"`
	Ea      EA     `json:"extattrs"`
}

func BuildNetworkViewFromRef

func BuildNetworkViewFromRef(ref string) *NetworkView

func NewEmptyNetworkView

func NewEmptyNetworkView() *NetworkView

func NewNetworkView

func NewNetworkView(name string, comment string, eas EA, ref string) *NetworkView

type NetworkViewLock

type NetworkViewLock struct {
	Name          string
	ObjMgr        *ObjectManager
	LockEA        string
	LockTimeoutEA string
}

func (*NetworkViewLock) Lock

func (l *NetworkViewLock) Lock() error

func (*NetworkViewLock) UnLock

func (l *NetworkViewLock) UnLock(force bool) error

type NodeInfo

type NodeInfo struct {
	HaStatus             string              `json:"ha_status,omitempty"`
	HwId                 string              `json:"hwid,omitempty"`
	HwModel              string              `json:"hwmodel,omitempty"`
	HwPlatform           string              `json:"hwplatform,omitempty"`
	HwType               string              `json:"hwtype,omitempty"`
	Lan2PhysicalSetting  PhysicalPortSetting `json:"lan2_physical_setting,omitempty"`
	LanHaPortSetting     LanHaPortSetting    `json:"lan_ha_Port_Setting,omitempty"`
	MgmtNetworkSetting   NetworkSetting      `json:"mgmt_network_setting,omitempty"`
	MgmtPhysicalSetting  PhysicalPortSetting `json:"mgmt_physical_setting,omitempty"`
	PaidNios             bool                `json:"paid_nios,omitempty"`
	PhysicalOid          string              `json:"physical_oid,omitempty"`
	ServiceStatus        []ServiceStatus     `json:"service_status,omitempty"`
	V6MgmtNetworkSetting Ipv6Setting         `json:"v6_mgmt_network_setting,omitempty"`
}

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func NewNotFoundError

func NewNotFoundError(msg string) *NotFoundError

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type ObjectManager

type ObjectManager struct {
	// contains filtered or unexported fields
}

func (*ObjectManager) AllocateIP

func (objMgr *ObjectManager) AllocateIP(
	netview string,
	cidr string,
	ipAddr string,
	isIPv6 bool,
	macOrDuid string,
	name string,
	comment string,
	eas EA) (*FixedAddress, error)

func (*ObjectManager) AllocateNetwork

func (objMgr *ObjectManager) AllocateNetwork(
	netview string,
	cidr string,
	isIPv6 bool,
	prefixLen uint,
	comment string,
	eas EA) (network *Network, err error)

func (*ObjectManager) AllocateNetworkContainer

func (objMgr *ObjectManager) AllocateNetworkContainer(
	netview string,
	cidr string,
	isIPv6 bool,
	prefixLen uint,
	comment string,
	eas EA) (*NetworkContainer, error)

func (*ObjectManager) CreateAAAARecord

func (objMgr *ObjectManager) CreateAAAARecord(
	netView string,
	dnsView string,
	recordName string,
	cidr string,
	ipAddr string,
	useTtl bool,
	ttl uint32,
	comment string,
	eas EA) (*RecordAAAA, error)

func (*ObjectManager) CreateARecord

func (objMgr *ObjectManager) CreateARecord(
	netView string,
	dnsView string,
	name string,
	cidr string,
	ipAddr string,
	ttl uint32,
	useTTL bool,
	comment string,
	eas EA) (*RecordA, error)

func (*ObjectManager) CreateCNAMERecord

func (objMgr *ObjectManager) CreateCNAMERecord(
	dnsview string,
	canonical string,
	recordname string,
	useTtl bool,
	ttl uint32,
	comment string,
	eas EA) (*RecordCNAME, error)

func (*ObjectManager) CreateDefaultNetviews

func (objMgr *ObjectManager) CreateDefaultNetviews(globalNetview string, localNetview string) (globalNetviewRef string, localNetviewRef string, err error)

func (*ObjectManager) CreateEADefinition

func (objMgr *ObjectManager) CreateEADefinition(eadef EADefinition) (*EADefinition, error)

func (*ObjectManager) CreateHostRecord

func (objMgr *ObjectManager) CreateHostRecord(
	enabledns bool,
	enableDhcp bool,
	recordName string,
	netview string,
	dnsview string,
	ipv4cidr string,
	ipv6cidr string,
	ipv4Addr string,
	ipv6Addr string,
	macAddr string,
	duid string,
	useTtl bool,
	ttl uint32,
	comment string,
	eas EA,
	aliases []string) (*HostRecord, error)

func (*ObjectManager) CreateMXRecord

func (objMgr *ObjectManager) CreateMXRecord(
	dnsView string,
	fqdn string,
	mx string,
	preference uint32,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) (*RecordMX, error)

func (*ObjectManager) CreateMultiObject

func (objMgr *ObjectManager) CreateMultiObject(req *MultiRequest) ([]map[string]interface{}, error)

CreateMultiObject unmarshals the result into slice of maps

func (*ObjectManager) CreateNetwork

func (objMgr *ObjectManager) CreateNetwork(netview string, cidr string, isIPv6 bool, comment string, eas EA) (*Network, error)

func (*ObjectManager) CreateNetworkContainer

func (objMgr *ObjectManager) CreateNetworkContainer(netview string, cidr string, isIPv6 bool, comment string, eas EA) (*NetworkContainer, error)

func (*ObjectManager) CreateNetworkView

func (objMgr *ObjectManager) CreateNetworkView(name string, comment string, setEas EA) (*NetworkView, error)

func (*ObjectManager) CreatePTRRecord

func (objMgr *ObjectManager) CreatePTRRecord(
	networkView string,
	dnsView string,
	ptrdname string,
	recordName string,
	cidr string,
	ipAddr string,
	useTtl bool,
	ttl uint32,
	comment string,
	eas EA) (*RecordPTR, error)

TODO check if the respective zone exists before creation of the record

func (*ObjectManager) CreateSRVRecord

func (objMgr *ObjectManager) CreateSRVRecord(
	dnsView string,
	name string,
	priority uint32,
	weight uint32,
	port uint32,
	target string,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) (*RecordSRV, error)

CreateSRVRecord creates an SRV-record.

Also, it preforms validation of input parameters: name, priority, weight, port and target.

func (*ObjectManager) CreateTXTRecord

func (objMgr *ObjectManager) CreateTXTRecord(
	dnsView string,
	recordName string,
	text string,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) (*RecordTXT, error)

Creates TXT Record. Use TTL of 0 to inherit TTL from the Zone

func (*ObjectManager) CreateZoneAuth

func (objMgr *ObjectManager) CreateZoneAuth(
	fqdn string,
	eas EA) (*ZoneAuth, error)

CreateZoneAuth creates zones and subs by passing fqdn

func (*ObjectManager) CreateZoneDelegated

func (objMgr *ObjectManager) CreateZoneDelegated(fqdn string, delegate_to []NameServer) (*ZoneDelegated, error)

CreateZoneDelegated creates delegated zone

func (*ObjectManager) DeleteAAAARecord

func (objMgr *ObjectManager) DeleteAAAARecord(ref string) (string, error)

func (*ObjectManager) DeleteARecord

func (objMgr *ObjectManager) DeleteARecord(ref string) (string, error)

func (*ObjectManager) DeleteCNAMERecord

func (objMgr *ObjectManager) DeleteCNAMERecord(ref string) (string, error)

func (*ObjectManager) DeleteFixedAddress

func (objMgr *ObjectManager) DeleteFixedAddress(ref string) (string, error)

func (*ObjectManager) DeleteHostRecord

func (objMgr *ObjectManager) DeleteHostRecord(ref string) (string, error)

func (*ObjectManager) DeleteMXRecord

func (objMgr *ObjectManager) DeleteMXRecord(ref string) (string, error)

func (*ObjectManager) DeleteNetwork

func (objMgr *ObjectManager) DeleteNetwork(ref string) (string, error)

func (*ObjectManager) DeleteNetworkContainer

func (objMgr *ObjectManager) DeleteNetworkContainer(ref string) (string, error)

func (*ObjectManager) DeleteNetworkView

func (objMgr *ObjectManager) DeleteNetworkView(ref string) (string, error)

func (*ObjectManager) DeletePTRRecord

func (objMgr *ObjectManager) DeletePTRRecord(ref string) (string, error)

func (*ObjectManager) DeleteSRVRecord

func (objMgr *ObjectManager) DeleteSRVRecord(ref string) (string, error)

func (*ObjectManager) DeleteTXTRecord

func (objMgr *ObjectManager) DeleteTXTRecord(ref string) (string, error)

func (*ObjectManager) DeleteZoneAuth

func (objMgr *ObjectManager) DeleteZoneAuth(ref string) (string, error)

DeleteZoneAuth deletes an auth zone

func (*ObjectManager) DeleteZoneDelegated

func (objMgr *ObjectManager) DeleteZoneDelegated(ref string) (string, error)

DeleteZoneDelegated deletes delegated zone

func (*ObjectManager) GetAAAARecord

func (objMgr *ObjectManager) GetAAAARecord(dnsview string, recordName string, ipAddr string) (*RecordAAAA, error)

func (*ObjectManager) GetAAAARecordByRef

func (objMgr *ObjectManager) GetAAAARecordByRef(ref string) (*RecordAAAA, error)

func (*ObjectManager) GetARecord

func (objMgr *ObjectManager) GetARecord(dnsview string, recordName string, ipAddr string) (*RecordA, error)

func (*ObjectManager) GetARecordByRef

func (objMgr *ObjectManager) GetARecordByRef(ref string) (*RecordA, error)

func (*ObjectManager) GetAllMembers

func (objMgr *ObjectManager) GetAllMembers() ([]Member, error)

GetAllMembers returns all members information

func (*ObjectManager) GetCNAMERecord

func (objMgr *ObjectManager) GetCNAMERecord(dnsview string, canonical string, recordName string) (*RecordCNAME, error)

func (*ObjectManager) GetCNAMERecordByRef

func (objMgr *ObjectManager) GetCNAMERecordByRef(ref string) (*RecordCNAME, error)

func (*ObjectManager) GetCapacityReport

func (objMgr *ObjectManager) GetCapacityReport(name string) ([]CapacityReport, error)

GetCapacityReport returns all capacity for members

func (*ObjectManager) GetDNSView

func (objMgr *ObjectManager) GetDNSView(name string) (*DNSView, error)

func (*ObjectManager) GetEADefinition

func (objMgr *ObjectManager) GetEADefinition(name string) (*EADefinition, error)

func (*ObjectManager) GetFixedAddress

func (objMgr *ObjectManager) GetFixedAddress(netview string, cidr string, ipAddr string, isIpv6 bool, macOrDuid string) (*FixedAddress, error)

func (*ObjectManager) GetFixedAddressByRef

func (objMgr *ObjectManager) GetFixedAddressByRef(ref string) (*FixedAddress, error)

func (*ObjectManager) GetGridInfo

func (objMgr *ObjectManager) GetGridInfo() ([]Grid, error)

GetGridInfo returns the details for grid

func (*ObjectManager) GetGridLicense

func (objMgr *ObjectManager) GetGridLicense() ([]License, error)

GetLicense returns the license details for grid

func (*ObjectManager) GetHostRecord

func (objMgr *ObjectManager) GetHostRecord(netview string, dnsview string, recordName string, ipv4addr string, ipv6addr string) (*HostRecord, error)

func (*ObjectManager) GetHostRecordByRef

func (objMgr *ObjectManager) GetHostRecordByRef(ref string) (*HostRecord, error)

func (*ObjectManager) GetIpAddressFromHostRecord

func (objMgr *ObjectManager) GetIpAddressFromHostRecord(host HostRecord) (string, error)

func (*ObjectManager) GetLicense

func (objMgr *ObjectManager) GetLicense() ([]License, error)

GetLicense returns the license details for member

func (*ObjectManager) GetMXRecord

func (objMgr *ObjectManager) GetMXRecord(dnsView string, fqdn string, mx string, preference uint32) (*RecordMX, error)

func (*ObjectManager) GetMXRecordByRef

func (objMgr *ObjectManager) GetMXRecordByRef(ref string) (*RecordMX, error)

func (*ObjectManager) GetNetwork

func (objMgr *ObjectManager) GetNetwork(netview string, cidr string, isIPv6 bool, ea EA) (*Network, error)

func (*ObjectManager) GetNetworkByEA

func (objMgr *ObjectManager) GetNetworkByEA(netview string, ea map[string]interface{}) (interface{}, error)

func (*ObjectManager) GetNetworkByRef

func (objMgr *ObjectManager) GetNetworkByRef(ref string) (*Network, error)

func (*ObjectManager) GetNetworkContainer

func (objMgr *ObjectManager) GetNetworkContainer(netview string, cidr string, isIPv6 bool, eaSearch EA) (*NetworkContainer, error)

TODO normalize IPv4 and IPv6 addresses

func (*ObjectManager) GetNetworkContainerByRef

func (objMgr *ObjectManager) GetNetworkContainerByRef(ref string) (*NetworkContainer, error)

func (*ObjectManager) GetNetworkView

func (objMgr *ObjectManager) GetNetworkView(name string) (*NetworkView, error)

func (*ObjectManager) GetNetworkViewByRef

func (objMgr *ObjectManager) GetNetworkViewByRef(ref string) (*NetworkView, error)

func (*ObjectManager) GetPTRRecord

func (objMgr *ObjectManager) GetPTRRecord(dnsview string, ptrdname string, recordName string, ipAddr string) (*RecordPTR, error)

func (*ObjectManager) GetPTRRecordByRef

func (objMgr *ObjectManager) GetPTRRecordByRef(ref string) (*RecordPTR, error)

func (*ObjectManager) GetSRVRecord

func (objMgr *ObjectManager) GetSRVRecord(dnsView string, name string, target string, port uint32) (*RecordSRV, error)

func (*ObjectManager) GetSRVRecordByRef

func (objMgr *ObjectManager) GetSRVRecordByRef(ref string) (*RecordSRV, error)

func (*ObjectManager) GetTXTRecord

func (objMgr *ObjectManager) GetTXTRecord(dnsview string, name string) (*RecordTXT, error)

func (*ObjectManager) GetTXTRecordByRef

func (objMgr *ObjectManager) GetTXTRecordByRef(ref string) (*RecordTXT, error)

func (*ObjectManager) GetUpgradeStatus

func (objMgr *ObjectManager) GetUpgradeStatus(statusType string) ([]UpgradeStatus, error)

GetUpgradeStatus returns the grid upgrade information

func (*ObjectManager) GetZoneAuth

func (objMgr *ObjectManager) GetZoneAuth() ([]ZoneAuth, error)

GetZoneAuth returns the authoritatives zones

func (*ObjectManager) GetZoneAuthByRef

func (objMgr *ObjectManager) GetZoneAuthByRef(ref string) (*ZoneAuth, error)

Retreive a authortative zone by ref

func (*ObjectManager) GetZoneDelegated

func (objMgr *ObjectManager) GetZoneDelegated(fqdn string) (*ZoneDelegated, error)

GetZoneDelegated returns the delegated zone

func (*ObjectManager) ReleaseIP

func (objMgr *ObjectManager) ReleaseIP(netview string, cidr string, ipAddr string, isIpv6 bool, macOrDuid string) (string, error)

func (*ObjectManager) SearchHostRecordByAltId

func (objMgr *ObjectManager) SearchHostRecordByAltId(
	internalId string, ref string, eaNameForInternalId string) (*HostRecord, error)

func (*ObjectManager) UpdateAAAARecord

func (objMgr *ObjectManager) UpdateAAAARecord(
	ref string,
	netView string,
	recordName string,
	ipAddr string,
	cidr string,
	useTtl bool,
	ttl uint32,
	comment string,
	setEas EA) (*RecordAAAA, error)

func (*ObjectManager) UpdateARecord

func (objMgr *ObjectManager) UpdateARecord(
	ref string,
	name string,
	ipAddr string,
	cidr string,
	netView string,
	ttl uint32,
	useTTL bool,
	comment string,
	eas EA) (*RecordA, error)

func (*ObjectManager) UpdateCNAMERecord

func (objMgr *ObjectManager) UpdateCNAMERecord(
	ref string,
	canonical string,
	recordName string,
	useTtl bool,
	ttl uint32,
	comment string,
	setEas EA) (*RecordCNAME, error)

func (*ObjectManager) UpdateFixedAddress

func (objMgr *ObjectManager) UpdateFixedAddress(
	fixedAddrRef string,
	netview string,
	name string,
	cidr string,
	ipAddr string,
	matchClient string,
	macOrDuid string,
	comment string,
	eas EA) (*FixedAddress, error)

func (*ObjectManager) UpdateHostRecord

func (objMgr *ObjectManager) UpdateHostRecord(
	hostRref string,
	enabledns bool,
	enableDhcp bool,
	name string,
	netView string,
	dnsView string,
	ipv4cidr string,
	ipv6cidr string,
	ipv4Addr string,
	ipv6Addr string,
	macAddr string,
	duid string,
	useTtl bool,
	ttl uint32,
	comment string,
	eas EA,
	aliases []string) (*HostRecord, error)

func (*ObjectManager) UpdateMXRecord

func (objMgr *ObjectManager) UpdateMXRecord(
	ref string,
	dnsView string,
	fqdn string,
	mx string,
	preference uint32,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) (*RecordMX, error)

func (*ObjectManager) UpdateNetwork

func (objMgr *ObjectManager) UpdateNetwork(
	ref string,
	setEas EA,
	comment string) (*Network, error)

UpdateNetwork updates comment and EA parameters. EAs which exist will be updated, those which do exist but not in setEas map, will be deleted, EAs which do not exist will be created as new.

func (*ObjectManager) UpdateNetworkContainer

func (objMgr *ObjectManager) UpdateNetworkContainer(
	ref string,
	setEas EA,
	comment string) (*NetworkContainer, error)

func (*ObjectManager) UpdateNetworkView

func (objMgr *ObjectManager) UpdateNetworkView(ref string, name string, comment string, setEas EA) (*NetworkView, error)

func (*ObjectManager) UpdatePTRRecord

func (objMgr *ObjectManager) UpdatePTRRecord(
	ref string,
	netview string,
	ptrdname string,
	name string,
	cidr string,
	ipAddr string,
	useTtl bool,
	ttl uint32,
	comment string,
	setEas EA) (*RecordPTR, error)

func (*ObjectManager) UpdateSRVRecord

func (objMgr *ObjectManager) UpdateSRVRecord(
	ref string,
	name string,
	priority uint32,
	weight uint32,
	port uint32,
	target string,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) (*RecordSRV, error)

UpdateSRVRecord updates the SRV-record.

Also, it preforms validation of input parameters: name, priority, weight, port and target.

func (*ObjectManager) UpdateTXTRecord

func (objMgr *ObjectManager) UpdateTXTRecord(
	ref string,
	recordName string,
	text string,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) (*RecordTXT, error)

func (*ObjectManager) UpdateZoneDelegated

func (objMgr *ObjectManager) UpdateZoneDelegated(ref string, delegate_to []NameServer) (*ZoneDelegated, error)

UpdateZoneDelegated updates delegated zone

type PhysicalPortSetting

type PhysicalPortSetting struct {
	AutoPortSettingEnabled bool   `json:"auto_port_setting_enabled"`
	Duplex                 string `json:"duplex,omitempty"`
	Speed                  string `json:"speed,omitempty"`
}

type QueryParams

type QueryParams struct {
	// contains filtered or unexported fields
}

This is a general struct to add query params used in makeRequest

func NewQueryParams

func NewQueryParams(forceProxy bool, searchFields map[string]string) *QueryParams

type RecordA

type RecordA struct {
	IBBase   `json:"-"`
	Ref      string `json:"_ref,omitempty"`
	Ipv4Addr string `json:"ipv4addr,omitempty"`
	Name     string `json:"name,omitempty"`
	View     string `json:"view,omitempty"`
	Zone     string `json:"zone,omitempty"`
	UseTtl   bool   `json:"use_ttl"`
	Ttl      uint32 `json:"ttl"`
	Comment  string `json:"comment"`
	Ea       EA     `json:"extattrs"`
}

func NewEmptyRecordA

func NewEmptyRecordA() *RecordA

func NewRecordA

func NewRecordA(
	view string,
	zone string,
	name string,
	ipAddr string,
	ttl uint32,
	useTTL bool,
	comment string,
	eas EA,
	ref string) *RecordA

type RecordAAAA

type RecordAAAA struct {
	IBBase   `json:"-"`
	Ref      string `json:"_ref,omitempty"`
	Ipv6Addr string `json:"ipv6addr,omitempty"`
	Name     string `json:"name,omitempty"`
	View     string `json:"view,omitempty"`
	Zone     string `json:"zone,omitempty"`
	UseTtl   bool   `json:"use_ttl"`
	Ttl      uint32 `json:"ttl"`
	Comment  string `json:"comment"`
	Ea       EA     `json:"extattrs"`
}

func NewEmptyRecordAAAA

func NewEmptyRecordAAAA() *RecordAAAA

func NewRecordAAAA

func NewRecordAAAA(
	view string,
	name string,
	ipAddr string,
	useTtl bool,
	ttl uint32,
	comment string,
	eas EA,
	ref string) *RecordAAAA

type RecordCNAME

type RecordCNAME struct {
	IBBase    `json:"-"`
	Ref       string `json:"_ref,omitempty"`
	Canonical string `json:"canonical,omitempty"`
	Name      string `json:"name,omitempty"`
	View      string `json:"view,omitempty"`
	Zone      string `json:"zone,omitempty"`
	Ea        EA     `json:"extattrs"`
	Comment   string `json:"comment"`
	UseTtl    bool   `json:"use_ttl"`
	Ttl       uint32 `json:"ttl"`
}

func NewEmptyRecordCNAME

func NewEmptyRecordCNAME() *RecordCNAME

func NewRecordCNAME

func NewRecordCNAME(dnsView string,
	canonical string,
	recordName string,
	useTtl bool,
	ttl uint32,
	comment string,
	ea EA,
	ref string) *RecordCNAME

type RecordMX

type RecordMX struct {
	IBBase     `json:"-"`
	Ref        string `json:"_ref,omitempty"`
	View       string `json:"view,omitempty"`
	Fqdn       string `json:"name,omitempty"`
	MX         string `json:"mail_exchanger,omitempty"`
	Preference uint32 `json:"preference"`
	Zone       string `json:"zone,omitempty"`
	Ttl        uint32 `json:"ttl"`
	UseTtl     bool   `json:"use_ttl"`
	Comment    string `json:"comment"`
	Ea         EA     `json:"extattrs"`
}

func NewEmptyRecordMX

func NewEmptyRecordMX() *RecordMX

func NewRecordMX

func NewRecordMX(rm RecordMX) *RecordMX

type RecordNS

type RecordNS struct {
	IBBase     `json:"-"`
	Ref        string           `json:"_ref,omitempty"`
	Addresses  []ZoneNameServer `json:"addresses,omitempty"`
	Name       string           `json:"name,omitempty"`
	Nameserver string           `json:"nameserver,omitempty"`
	View       string           `json:"view,omitempty"`
	Zone       string           `json:"zone,omitempty"`
}

func NewRecordNS

func NewRecordNS(rc RecordNS) *RecordNS

type RecordPTR

type RecordPTR struct {
	IBBase   `json:"-"`
	Ref      string `json:"_ref,omitempty"`
	Ipv4Addr string `json:"ipv4addr,omitempty"`
	Ipv6Addr string `json:"ipv6addr,omitempty"`
	Name     string `json:"name,omitempty"`
	PtrdName string `json:"ptrdname,omitempty"`
	View     string `json:"view,omitempty"`
	Zone     string `json:"zone,omitempty"`
	Ea       EA     `json:"extattrs"`
	UseTtl   bool   `json:"use_ttl"`
	Ttl      uint32 `json:"ttl"`
	Comment  string `json:"comment"`
}

func NewEmptyRecordPTR

func NewEmptyRecordPTR() *RecordPTR

func NewRecordPTR

func NewRecordPTR(dnsView string, ptrdname string, useTtl bool, ttl uint32, comment string, ea EA) *RecordPTR

type RecordSRV

type RecordSRV struct {
	IBBase   `json:"-"`
	Ref      string `json:"_ref,omitempty"`
	View     string `json:"view,omitempty"`
	Name     string `json:"name,omitempty"`
	Priority uint32 `json:"priority"`
	Weight   uint32 `json:"weight"`
	Port     uint32 `json:"port"`
	Target   string `json:"target,omitempty"`
	Zone     string `json:"zone,omitempty"`
	Ttl      uint32 `json:"ttl"`
	UseTtl   bool   `json:"use_ttl"`
	Comment  string `json:"comment"`
	Ea       EA     `json:"extattrs"`
}

func NewEmptyRecordSRV

func NewEmptyRecordSRV() *RecordSRV

func NewRecordSRV

func NewRecordSRV(rv RecordSRV) *RecordSRV

type RecordTXT

type RecordTXT struct {
	IBBase  `json:"-"`
	View    string `json:"view,omitempty"`
	Zone    string `json:"zone,omitempty"`
	Ref     string `json:"_ref,omitempty"`
	Name    string `json:"name,omitempty"`
	Text    string `json:"text,omitempty"`
	Ttl     uint32 `json:"ttl"`
	UseTtl  bool   `json:"use_ttl"`
	Comment string `json:"comment"`
	Ea      EA     `json:"extattrs"`
}

func NewEmptyRecordTXT

func NewEmptyRecordTXT() *RecordTXT

func NewRecordTXT

func NewRecordTXT(
	dnsview string,
	zone string,
	recordname string,
	text string,
	ttl uint32,
	useTtl bool,
	comment string,
	eas EA) *RecordTXT

type RequestBody

type RequestBody struct {
	Data               map[string]interface{} `json:"data,omitempty"`
	Args               map[string]string      `json:"args,omitempty"`
	Method             string                 `json:"method"`
	Object             string                 `json:"object,omitempty"`
	EnableSubstitution bool                   `json:"enable_substitution,omitempty"`
	AssignState        map[string]string      `json:"assign_state,omitempty"`
	Discard            bool                   `json:"discard,omitempty"`
}

type RequestType

type RequestType int
const (
	CREATE RequestType = iota
	GET
	DELETE
	UPDATE
)

type ServiceStatus

type ServiceStatus struct {
	Desciption string `json:"description,omitempty"`
	Service    string `json:"service,omitempty"`
	Status     string `json:"status,omitempty"`
}

type SingleRequest

type SingleRequest struct {
	IBBase `json:"-"`
	Body   *RequestBody
}

func NewRequest

func NewRequest(body *RequestBody) *SingleRequest

type SubElementsStatus

type SubElementsStatus struct {
	Ref            string `json:"_ref,omitempty"`
	CurrentVersion string `json:"current_version"`
	ElementStatus  string `json:"element_status"`
	Ipv4Address    string `json:"ipv4_address"`
	Ipv6Address    string `json:"ipv6_address"`
	StatusValue    string `json:"status_value"`
	StepsTotal     int    `json:"steps_total"`
	StepsCompleted int    `json:"steps_completed"`
	NodeType       string `json:"type"`
	Member         string `json:"member"`
}

SubElementsStatus object representation

type TransportConfig

type TransportConfig struct {
	SslVerify bool

	HttpRequestTimeout  time.Duration // in seconds
	HttpPoolConnections int
	ProxyUrl            *url.URL
	// contains filtered or unexported fields
}

func NewTransportConfig

func NewTransportConfig(sslVerify string, httpRequestTimeout int, httpPoolConnections int) (cfg TransportConfig)

type UpgradeStatus

type UpgradeStatus struct {
	IBBase           `json:"-"`
	Ref              string              `json:"_ref,omitempty"`
	Type             string              `json:"type"`
	SubElementStatus []SubElementsStatus `json:"subelements_status,omitempty"`
	UpgradeGroup     string              `json:"upgrade_group,omitempty"`
}

UpgradeStatus object representation

func NewUpgradeStatus

func NewUpgradeStatus(upgradeStatus UpgradeStatus) *UpgradeStatus

type UserProfile

type UserProfile struct {
	IBBase `json:"-"`
	Ref    string `json:"_ref,omitempty"`
	Name   string `json:"name,omitempty"`
}

func NewUserProfile

func NewUserProfile(userprofile UserProfile) *UserProfile

type WapiHttpRequestor

type WapiHttpRequestor struct {
	// contains filtered or unexported fields
}

func (*WapiHttpRequestor) Init

func (whr *WapiHttpRequestor) Init(authCfg AuthConfig, trCfg TransportConfig)

func (*WapiHttpRequestor) SendRequest

func (whr *WapiHttpRequestor) SendRequest(req *http.Request) (res []byte, err error)

type WapiRequestBuilder

type WapiRequestBuilder struct {
	// contains filtered or unexported fields
}

func NewWapiRequestBuilder

func NewWapiRequestBuilder(hostCfg HostConfig, authCfg AuthConfig) (*WapiRequestBuilder, error)

func (*WapiRequestBuilder) BuildBody

func (wrb *WapiRequestBuilder) BuildBody(t RequestType, obj IBObject) []byte

func (*WapiRequestBuilder) BuildRequest

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

func (*WapiRequestBuilder) BuildUrl

func (wrb *WapiRequestBuilder) BuildUrl(t RequestType, objType string, ref string, returnFields []string, queryParams *QueryParams) (urlStr string)

func (*WapiRequestBuilder) Init

func (wrb *WapiRequestBuilder) Init(hostCfg HostConfig, authCfg AuthConfig)

type ZoneAuth

type ZoneAuth struct {
	IBBase `json:"-"`
	Ref    string `json:"_ref,omitempty"`
	Fqdn   string `json:"fqdn,omitempty"`
	View   string `json:"view,omitempty"`
	Ea     EA     `json:"extattrs"`
}

func NewZoneAuth

func NewZoneAuth(za ZoneAuth) *ZoneAuth

type ZoneDelegated

type ZoneDelegated struct {
	IBBase     `json:"-"`
	Ref        string       `json:"_ref,omitempty"`
	Fqdn       string       `json:"fqdn,omitempty"`
	DelegateTo []NameServer `json:"delegate_to,omitempty"`
	View       string       `json:"view,omitempty"`
	Ea         EA           `json:"extattrs"`
}

func NewZoneDelegated

func NewZoneDelegated(za ZoneDelegated) *ZoneDelegated

type ZoneNameServer

type ZoneNameServer struct {
	Address string `json:"address,omitempty"`
}

Jump to

Keyboard shortcuts

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