vsphere

package module
v0.0.0-...-73b13b2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: GPL-2.0 Imports: 18 Imported by: 0

README

CoreDNS vSphere plugin

This plugin queries the vSphere API and looks for VM a matching name/hostname.

All VMs are fetched at once and cached, the cache is updated whenever a request is not found.

Usage

To activate the plugin you need to compile CoreDNS with the plugin added to plugin.cfg

vsphere:github.com/cosandr/coredns-vsphere-plugin

Then add it to Corefile:

. {
    vsphere {
        url "<URL to vSphere>"
        user "<username>"
        pass "<password>"
        insecure "<true/false, defaults to false>"
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, clientURL string, user string, pass string, insecure bool) (*vim25.Client, error)

Types

type VSphere

type VSphere struct {
	Next   plugin.Handler
	Client *vim25.Client
}

VSphere is an vsphere plugin to show how to write a plugin.

func NewVSphere

func NewVSphere(url string, user string, pass string, insecure bool) (VSphere, error)

func (VSphere) Name

func (v VSphere) Name() string

Name implements the Handler interface.

func (VSphere) Ready

func (v VSphere) Ready() bool

func (VSphere) ServeDNS

func (v VSphere) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface. This method gets called when vsphere is used in a Server.

Jump to

Keyboard shortcuts

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