Documentation
¶
Index ¶
- type NovaAPI
- type NovaSyncer
- func (s *NovaSyncer) Init(ctx context.Context)
- func (s *NovaSyncer) Sync(ctx context.Context) error
- func (s *NovaSyncer) SyncAllAggregates(ctx context.Context) ([]nova.Aggregate, error)
- func (s *NovaSyncer) SyncAllFlavors(ctx context.Context) ([]nova.Flavor, error)
- func (s *NovaSyncer) SyncAllHypervisors(ctx context.Context) ([]nova.Hypervisor, error)
- func (s *NovaSyncer) SyncAllMigrations(ctx context.Context) ([]nova.Migration, error)
- func (s *NovaSyncer) SyncAllServers(ctx context.Context) ([]nova.Server, error)
- func (s *NovaSyncer) SyncDeletedServers(ctx context.Context) ([]nova.DeletedServer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NovaAPI ¶
type NovaAPI interface {
// Init the nova API.
Init(ctx context.Context)
// Get all nova servers that are NOT deleted. (Includes ERROR, SHUTOFF etc)
GetAllServers(ctx context.Context) ([]nova.Server, error)
// Get all deleted nova servers since the timestamp.
GetDeletedServers(ctx context.Context, since time.Time) ([]nova.DeletedServer, error)
// Get all nova hypervisors.
GetAllHypervisors(ctx context.Context) ([]nova.Hypervisor, error)
// Get all nova flavors.
GetAllFlavors(ctx context.Context) ([]nova.Flavor, error)
// Get all nova migrations.
GetAllMigrations(ctx context.Context) ([]nova.Migration, error)
// Get all aggregates.
GetAllAggregates(ctx context.Context) ([]nova.Aggregate, error)
}
func NewNovaAPI ¶
func NewNovaAPI(mon sync.Monitor, k keystone.KeystoneAPI, conf conf.SyncOpenStackNovaConfig) NovaAPI
Create a new OpenStack server syncer.
type NovaSyncer ¶
type NovaSyncer struct {
// Database to store the nova objects in.
DB db.DB
// Monitor to track the syncer.
Mon sync.Monitor
// Configuration for the nova syncer.
Conf conf.SyncOpenStackNovaConfig
// Nova API client to fetch the data.
API NovaAPI
// MQTT client to publish mqtt data.
MqttClient mqtt.Client
}
Syncer for OpenStack nova.
func (*NovaSyncer) Init ¶
func (s *NovaSyncer) Init(ctx context.Context)
Init the OpenStack nova syncer.
func (*NovaSyncer) Sync ¶
func (s *NovaSyncer) Sync(ctx context.Context) error
Sync the OpenStack nova objects and publish triggers.
func (*NovaSyncer) SyncAllAggregates ¶
Sync the OpenStack aggregates into the database.
func (*NovaSyncer) SyncAllFlavors ¶
Sync the OpenStack flavors into the database.
func (*NovaSyncer) SyncAllHypervisors ¶
func (s *NovaSyncer) SyncAllHypervisors(ctx context.Context) ([]nova.Hypervisor, error)
Sync the OpenStack hypervisors into the database.
func (*NovaSyncer) SyncAllMigrations ¶
Sync the OpenStack migrations into the database.
func (*NovaSyncer) SyncAllServers ¶
Sync all the active OpenStack servers into the database. (Includes ERROR, SHUTOFF, etc. state)
func (*NovaSyncer) SyncDeletedServers ¶
func (s *NovaSyncer) SyncDeletedServers(ctx context.Context) ([]nova.DeletedServer, error)
Sync all the deleted OpenStack servers into the database. Only fetch servers that were deleted since the last sync run.
Click to show internal directories.
Click to hide internal directories.