placement

package
v0.0.0-...-8f6c52d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 17 Imported by: 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlacementAPI

type PlacementAPI interface {
	// Init the placement API.
	Init(ctx context.Context)
	// Fetch all resource providers from the placement API.
	GetAllResourceProviders(ctx context.Context) ([]placement.ResourceProvider, error)
	// Fetch all traits for the given resource providers from the placement API.
	GetAllTraits(ctx context.Context, providers []placement.ResourceProvider) ([]placement.Trait, error)
	// Fetch all inventories + usages for the given resource providers from the placement API.
	GetAllInventoryUsages(ctx context.Context, providers []placement.ResourceProvider) ([]placement.InventoryUsage, error)
}

func NewPlacementAPI

Create a new OpenStack placement api.

type PlacementSyncer

type PlacementSyncer struct {
	// Database to store the placement objects in.
	DB db.DB
	// Monitor to track the syncer.
	Mon sync.Monitor
	// Configuration for the placement syncer.
	Conf conf.SyncOpenStackPlacementConfig
	// Placement API client to fetch the data.
	API PlacementAPI
	// MQTT client to publish mqtt data.
	MqttClient mqtt.Client
}

Syncer for OpenStack placement.

func (*PlacementSyncer) Init

func (s *PlacementSyncer) Init(ctx context.Context)

Init the OpenStack resource provider and trait syncer.

func (*PlacementSyncer) Sync

func (s *PlacementSyncer) Sync(ctx context.Context) error

Sync the OpenStack placement objects.

func (*PlacementSyncer) SyncInventoryUsages

func (s *PlacementSyncer) SyncInventoryUsages(ctx context.Context, rps []placement.ResourceProvider) ([]placement.InventoryUsage, error)

Sync the OpenStack resource provider inventories and usages into the database.

func (*PlacementSyncer) SyncResourceProviders

func (s *PlacementSyncer) SyncResourceProviders(ctx context.Context) ([]placement.ResourceProvider, error)

Sync the OpenStack resource providers into the database.

func (*PlacementSyncer) SyncTraits

Sync the OpenStack traits into the database.

Jump to

Keyboard shortcuts

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