openstack

package
v2.5.0-rc.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultSDConfig is the default OpenStack SD configuration.
	DefaultSDConfig = SDConfig{
		Port:            80,
		RefreshInterval: model.Duration(60 * time.Second),
	}
)

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	Run(ctx context.Context, ch chan<- []*targetgroup.Group)
	// contains filtered or unexported methods
}

Discovery periodically performs OpenStack-SD requests. It implements the Discoverer interface.

func NewDiscovery

func NewDiscovery(conf *SDConfig, l log.Logger) (Discovery, error)

NewDiscovery returns a new OpenStackDiscovery which periodically refreshes its targets.

type HypervisorDiscovery added in v1.8.0

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

HypervisorDiscovery discovers OpenStack hypervisors.

func NewHypervisorDiscovery added in v1.8.0

func NewHypervisorDiscovery(provider *gophercloud.ProviderClient, opts *gophercloud.AuthOptions,
	interval time.Duration, port int, region string, l log.Logger) *HypervisorDiscovery

NewHypervisorDiscovery returns a new hypervisor discovery.

func (*HypervisorDiscovery) Run added in v1.8.0

func (h *HypervisorDiscovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group)

Run implements the Discoverer interface.

type InstanceDiscovery added in v1.8.0

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

InstanceDiscovery discovers OpenStack instances.

func NewInstanceDiscovery added in v1.8.0

func NewInstanceDiscovery(provider *gophercloud.ProviderClient, opts *gophercloud.AuthOptions,
	interval time.Duration, port int, region string, allTenants bool, l log.Logger) *InstanceDiscovery

NewInstanceDiscovery returns a new instance discovery.

func (*InstanceDiscovery) Run added in v1.8.0

func (i *InstanceDiscovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group)

Run implements the Discoverer interface.

type Role

type Role string

OpenStackRole is role of the target in OpenStack.

const (
	// OpenStack document reference
	// https://docs.openstack.org/nova/pike/admin/arch.html#hypervisors
	OpenStackRoleHypervisor Role = "hypervisor"
	// OpenStack document reference
	// https://docs.openstack.org/horizon/pike/user/launch-instances.html
	OpenStackRoleInstance Role = "instance"
)

The valid options for OpenStackRole.

func (*Role) UnmarshalYAML

func (c *Role) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type SDConfig

type SDConfig struct {
	IdentityEndpoint string                `yaml:"identity_endpoint"`
	Username         string                `yaml:"username"`
	UserID           string                `yaml:"userid"`
	Password         config_util.Secret    `yaml:"password"`
	ProjectName      string                `yaml:"project_name"`
	ProjectID        string                `yaml:"project_id"`
	DomainName       string                `yaml:"domain_name"`
	DomainID         string                `yaml:"domain_id"`
	Role             Role                  `yaml:"role"`
	Region           string                `yaml:"region"`
	RefreshInterval  model.Duration        `yaml:"refresh_interval,omitempty"`
	Port             int                   `yaml:"port"`
	AllTenants       bool                  `yaml:"all_tenants,omitempty"`
	TLSConfig        config_util.TLSConfig `yaml:"tls_config,omitempty"`
}

SDConfig is the configuration for OpenStack based service discovery.

func (*SDConfig) UnmarshalYAML

func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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