ibclient

package module
v0.0.0-...-5efc80b Latest Latest
Warning

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

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

README

Infoblox Go Client

An Infoblox Client library for Go.

This library is compatible with Go 1.2+

Prerequisites

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

Installation

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

Usage

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

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

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

Supported NIOS operations

  • AllocateNetwork
  • CreateDefaultNetviews
  • CreateEADefinition
  • CreateNetwork
  • CreateNetworkContainer
  • CreateNetworkView
  • DeleteNetwork
  • DeleteNetworkView
  • GetAllMembers
  • GetCapacityReport
  • GetEADefinition
  • GetFixedAddress
  • GetNetwork
  • GetNetworkContainer
  • GetNetworkView
  • GetUpgradeStatus (2.7 or above)
  • ReleaseIP
  • UpdateFixedAddress
  • UpdateNetworkViewEA

Documentation

Index

Constants

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

Variables

View Source
var ValidateConnector = validateConnector

Functions

func GetIPAddressFromRef

func GetIPAddressFromRef(ref string) string

Types

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 {
	HostConfig      HostConfig
	TransportConfig TransportConfig
	RequestBuilder  HttpRequestBuilder
	Requestor       HttpRequestor
}

func NewConnector

func NewConnector(hostConfig HostConfig, 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, 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 EA

type EA map[string]interface{}

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,omitempty"`
	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"`
	IPAddress   string `json:"ipv4addr,omitempty"`
	Mac         string `json:"mac,omitempty"`
	Name        string `json:"name,omitempty"`
	MatchClient string `json:"match_client,omitempty"`
	Ea          EA     `json:"extattrs,omitempty"`
}

func NewFixedAddress

func NewFixedAddress(fixedAddr FixedAddress) *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
	Username string
	Password string
}

type HostRecord

type HostRecord struct {
	IBBase      `json:"-"`
	Ref         string               `json:"_ref,omitempty"`
	Ipv4Addr    string               `json:"ipv4addr,omitempty"`
	Ipv4Addrs   []HostRecordIpv4Addr `json:"ipv4addrs,omitempty"`
	Name        string               `json:"name,omitempty"`
	View        string               `json:"view,omitempty"`
	Zone        string               `json:"zone,omitempty"`
	EnableDns   *bool                `json:"configure_for_dns,omitempty"`
	NetworkView string               `json:"network_view,omitempty"`
	Ea          EA                   `json:"extattrs,omitempty"`
}

func NewHostRecord

func NewHostRecord(rh HostRecord) *HostRecord

type HostRecordIpv4Addr

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

func NewHostRecordIpv4Addr

func NewHostRecordIpv4Addr(hostAddr HostRecordIpv4Addr) *HostRecordIpv4Addr

type HttpRequestBuilder

type HttpRequestBuilder interface {
	Init(HostConfig)
	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(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, 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 {
	AllocateIP(netview string, cidr string, ipAddr string, macAddress string, name string, ea EA) (*FixedAddress, error)
	AllocateNetwork(netview string, cidr string, prefixLen uint, name string) (network *Network, err error)
	CreateARecord(netview string, dnsview string, recordname string, cidr string, ipAddr string, ea EA) (*RecordA, error)
	CreateCNAMERecord(canonical string, recordname string, dnsview string, ea EA) (*RecordCNAME, error)
	CreateDefaultNetviews(globalNetview string, localNetview string) (globalNetviewRef string, localNetviewRef string, err error)
	CreateEADefinition(eadef EADefinition) (*EADefinition, error)
	CreateHostRecord(enabledns bool, recordName string, netview string, dnsview string, cidr string, ipAddr string, macAddress string, ea EA) (*HostRecord, error)
	CreateNetwork(netview string, cidr string, name string) (*Network, error)
	CreateNetworkContainer(netview string, cidr string) (*NetworkContainer, error)
	CreateNetworkView(name string) (*NetworkView, error)
	CreatePTRRecord(netview string, dnsview string, recordname string, cidr string, ipAddr string, ea EA) (*RecordPTR, error)
	DeleteARecord(ref string) (string, error)
	DeleteCNAMERecord(ref string) (string, error)
	DeleteFixedAddress(ref string) (string, error)
	DeleteHostRecord(ref string) (string, error)
	DeleteNetwork(ref string, netview string) (string, error)
	DeleteNetworkView(ref string) (string, error)
	DeletePTRRecord(ref string) (string, error)
	GetARecordByRef(ref string) (*RecordA, error)
	GetCNAMERecordByRef(ref string) (*RecordA, error)
	GetEADefinition(name string) (*EADefinition, error)
	GetFixedAddress(netview string, cidr string, ipAddr string, macAddr string) (*FixedAddress, error)
	GetFixedAddressByRef(ref string) (*FixedAddress, error)
	GetHostRecord(recordName string, netview string, cidr string, ipAddr string) (*HostRecord, error)
	GetHostRecordByRef(ref string) (*HostRecord, error)
	GetIpAddressFromHostRecord(host HostRecord) (string, error)
	GetNetwork(netview string, cidr string, ea EA) (*Network, error)
	GetNetworkContainer(netview string, cidr string) (*NetworkContainer, error)
	GetNetworkView(name string) (*NetworkView, error)
	GetPTRRecordByRef(ref string) (*RecordPTR, error)
	ReleaseIP(netview string, cidr string, ipAddr string, macAddr string) (string, error)
	UpdateFixedAddress(fixedAddrRef string, matchclient string, macAddress string, vmID string, vmName string) (*FixedAddress, error)
	UpdateHostRecord(hostRref string, ipAddr string, macAddress string, vmID string, vmName string) (string, error)
	UpdateNetworkViewEA(ref string, addEA EA, removeEA EA) error
}

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,omitempty"`
}

func BuildNetworkFromRef

func BuildNetworkFromRef(ref string) *Network

func NewNetwork

func NewNetwork(nw Network) *Network

type NetworkContainer

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

func NewNetworkContainer

func NewNetworkContainer(nc NetworkContainer) *NetworkContainer

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"`
	Ea     EA     `json:"extattrs,omitempty"`
}

func BuildNetworkViewFromRef

func BuildNetworkViewFromRef(ref string) *NetworkView

func NewNetworkView

func NewNetworkView(nv NetworkView) *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 ObjectManager

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

func NewObjectManager

func NewObjectManager(connector IBConnector, cmpType string, tenantID string) *ObjectManager

func (*ObjectManager) AllocateIP

func (objMgr *ObjectManager) AllocateIP(netview string, cidr string, ipAddr string, macAddress string, name string, ea EA) (*FixedAddress, error)

func (*ObjectManager) AllocateNetwork

func (objMgr *ObjectManager) AllocateNetwork(netview string, cidr string, prefixLen uint, name string) (network *Network, err error)

func (*ObjectManager) CreateARecord

func (objMgr *ObjectManager) CreateARecord(netview string, dnsview string, recordname string, cidr string, ipAddr string, ea EA) (*RecordA, error)

func (*ObjectManager) CreateCNAMERecord

func (objMgr *ObjectManager) CreateCNAMERecord(canonical string, recordname string, dnsview string, ea 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, recordName string, netview string, dnsview string, cidr string, ipAddr string, macAddress string, ea EA) (*HostRecord, 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, name string, comment string) (*Network, error)

func (*ObjectManager) CreateNetworkContainer

func (objMgr *ObjectManager) CreateNetworkContainer(netview string, cidr string) (*NetworkContainer, error)

func (*ObjectManager) CreateNetworkView

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

func (*ObjectManager) CreatePTRRecord

func (objMgr *ObjectManager) CreatePTRRecord(netview string, dnsview string, recordname string, cidr string, ipAddr string, ea EA) (*RecordPTR, error)

func (*ObjectManager) CreateTXTRecord

func (objMgr *ObjectManager) CreateTXTRecord(recordname string, text string, ttl int, dnsview string) (*RecordTXT, error)

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

func (*ObjectManager) CreateZoneDelegated

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

CreateZoneDelegated creates delegated zone

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) DeleteNetwork

func (objMgr *ObjectManager) DeleteNetwork(ref string, netview 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) DeleteTXTRecord

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

func (*ObjectManager) DeleteZoneDelegated

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

DeleteZoneDelegated deletes delegated zone

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) 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) GetEADefinition

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

func (*ObjectManager) GetFixedAddress

func (objMgr *ObjectManager) GetFixedAddress(netview string, cidr string, ipAddr string, macAddr 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(recordName string, netview string, cidr string, ipAddr 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) GetNetwork

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

func (*ObjectManager) GetNetworkContainer

func (objMgr *ObjectManager) GetNetworkContainer(netview string, cidr string) (*NetworkContainer, error)

func (*ObjectManager) GetNetworkView

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

func (*ObjectManager) GetNetworkwithref

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

func (*ObjectManager) GetPTRRecordByRef

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

func (*ObjectManager) GetTXTRecord

func (objMgr *ObjectManager) GetTXTRecord(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) 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, macAddr string) (string, error)

func (*ObjectManager) UpdateFixedAddress

func (objMgr *ObjectManager) UpdateFixedAddress(fixedAddrRef string, matchClient string, macAddress string, vmID string, vmName string) (*FixedAddress, error)

func (*ObjectManager) UpdateHostRecord

func (objMgr *ObjectManager) UpdateHostRecord(hostRref string, ipAddr string, macAddress string, vmID string, vmName string) (string, error)

func (*ObjectManager) UpdateNetworkViewEA

func (objMgr *ObjectManager) UpdateNetworkViewEA(ref string, addEA EA, removeEA EA) error

func (*ObjectManager) UpdateTXTRecord

func (objMgr *ObjectManager) UpdateTXTRecord(recordname string, text string) (*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

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"`
	Ea       EA     `json:"extattrs,omitempty"`
}

func NewRecordA

func NewRecordA(ra RecordA) *RecordA

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,omitempty"`
}

func NewRecordCNAME

func NewRecordCNAME(rc RecordCNAME) *RecordCNAME

type RecordPTR

type RecordPTR struct {
	IBBase   `json:"-"`
	Ref      string `json:"_ref,omitempty"`
	Ipv4Addr string `json:"ipv4addr,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,omitempty"`
}

func NewRecordPTR

func NewRecordPTR(rptr RecordPTR) *RecordPTR

type RecordTXT

type RecordTXT struct {
	IBBase `json:"-"`
	Ref    string `json:"_ref,omitempty"`
	Name   string `json:"name,omitempty"`
	Text   string `json:"text,omitempty"`
	TTL    int    `json:"ttl,omitempty"`
	View   string `json:"view,omitempty"`
	Zone   string `json:"zone,omitempty"`
	Ea     EA     `json:"extattrs,omitempty"`
}

func NewRecordTXT

func NewRecordTXT(rt RecordTXT) *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
	// 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(cfg TransportConfig)

func (*WapiHttpRequestor) SendRequest

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

type WapiRequestBuilder

type WapiRequestBuilder struct {
	HostConfig HostConfig
}

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(cfg HostConfig)

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,omitempty"`
}

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,omitempty"`
}

func NewZoneDelegated

func NewZoneDelegated(za ZoneDelegated) *ZoneDelegated

Jump to

Keyboard shortcuts

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