Documentation ¶
Index ¶
- Variables
- type Discovery
- type HypervisorDiscovery
- type InstanceDiscovery
- type Role
- type SDConfig
- type SDMock
- func (m *SDMock) Endpoint() string
- func (m *SDMock) HandleAuthSuccessfully()
- func (m *SDMock) HandleFloatingIPListSuccessfully()
- func (m *SDMock) HandleHypervisorListSuccessfully()
- func (m *SDMock) HandleServerListSuccessfully()
- func (m *SDMock) HandleVersionsSuccessfully()
- func (m *SDMock) Setup()
- func (m *SDMock) ShutdownServer()
Constants ¶
This section is empty.
Variables ¶
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.
type HypervisorDiscovery ¶
type HypervisorDiscovery struct {
// contains filtered or unexported fields
}
HypervisorDiscovery discovers OpenStack hypervisors.
func NewHypervisorDiscovery ¶
func NewHypervisorDiscovery(opts *gophercloud.AuthOptions, interval time.Duration, port int, region string, l log.Logger) *HypervisorDiscovery
NewHypervisorDiscovery returns a new hypervisor discovery.
func (*HypervisorDiscovery) Run ¶
func (h *HypervisorDiscovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group)
Run implements the Discoverer interface.
type InstanceDiscovery ¶
type InstanceDiscovery struct {
// contains filtered or unexported fields
}
InstanceDiscovery discovers OpenStack instances.
func NewInstanceDiscovery ¶
func NewInstanceDiscovery(opts *gophercloud.AuthOptions, interval time.Duration, port int, region string, l log.Logger) *InstanceDiscovery
NewInstanceDiscovery returns a new instance discovery.
func (*InstanceDiscovery) Run ¶
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 ¶
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"` }
SDConfig is the configuration for OpenStack based service discovery.
func (*SDConfig) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type SDMock ¶
type SDMock struct { Server *httptest.Server Mux *http.ServeMux // contains filtered or unexported fields }
SDMock is the interface for the OpenStack mock
func (*SDMock) HandleAuthSuccessfully ¶
func (m *SDMock) HandleAuthSuccessfully()
HandleAuthSuccessfully mocks auth call
func (*SDMock) HandleFloatingIPListSuccessfully ¶
func (m *SDMock) HandleFloatingIPListSuccessfully()
HandleFloatingIPListSuccessfully mocks floating ips call
func (*SDMock) HandleHypervisorListSuccessfully ¶
func (m *SDMock) HandleHypervisorListSuccessfully()
HandleHypervisorListSuccessfully mocks os-hypervisors detail call
func (*SDMock) HandleServerListSuccessfully ¶
func (m *SDMock) HandleServerListSuccessfully()
HandleServerListSuccessfully mocks server detail call
func (*SDMock) HandleVersionsSuccessfully ¶
func (m *SDMock) HandleVersionsSuccessfully()
HandleVersionsSuccessfully mocks version call
func (*SDMock) ShutdownServer ¶
func (m *SDMock) ShutdownServer()
ShutdownServer creates the mock server