vsphere

package module
v0.0.0-...-77c689a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: GPL-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址