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: 0 Imported by: 0

Documentation

Index

Constants

View Source
const TriggerPlacementInventoryUsagesSynced = "triggers/sync/openstack/placement/types/inventory_usages"

Trigger executed when new inventory usages are available.

View Source
const TriggerPlacementResourceProvidersSynced = "triggers/sync/openstack/placement/types/resource_providers"

Trigger executed when new resource providers are available.

View Source
const TriggerPlacementTraitsSynced = "triggers/sync/openstack/placement/types/traits"

Trigger executed when new traits are available.

Variables

This section is empty.

Functions

This section is empty.

Types

type InventoryUsage

type InventoryUsage struct {
	ResourceProviderUUID       string `db:"resource_provider_uuid,primarykey"`
	ResourceProviderGeneration int    `db:"resource_provider_generation"`

	// Something like: DISK_GB, VCPU, MEMORY_MB.
	InventoryClassName string `db:"inventory_class_name,primarykey"`
	// Overcommit factor for the inventory class.
	AllocationRatio float32 `db:"allocation_ratio"`
	// A maximum amount any single allocation against an inventory can have.
	MaxUnit int `db:"max_unit"`
	// A minimum amount any single allocation against an inventory can have.
	MinUnit int `db:"min_unit"`
	// The amount of the resource a provider has reserved for its own use.
	Reserved int `db:"reserved"`
	// A representation of the divisible amount of the resource that may be
	// requested. For example, step_size = 5 means that only values divisible by
	// 5 (5, 10, 15, etc.) can be requested.
	StepSize int `db:"step_size"`
	// The actual amount of the resource that the provider can accommodate.
	Total int `db:"total"`

	// The amount of the resource that is currently in use.
	Used int `db:"used"`
}

Combined model for resource provider inventories and usages.

Both models are combined in one table to avoid frequent joins, since both are used in conjunction to calculate capacity. They are also fetched and displayed together when using the cli command `openstack resource provider inventory list`.

See: https://docs.openstack.org/api-ref/placement/#list-resource-provider-inventories And: https://docs.openstack.org/api-ref/placement/#list-usages

func (InventoryUsage) Indexes

func (InventoryUsage) Indexes() map[string][]string

Indexes for the resource provider inventory table.

func (InventoryUsage) TableName

func (InventoryUsage) TableName() string

Table in which the openstack inventory usage model is stored.

type ResourceProvider

type ResourceProvider struct {
	UUID                       string `json:"uuid" db:"uuid,primarykey"`
	Name                       string `json:"name" db:"name"`
	ParentProviderUUID         string `json:"parent_provider_uuid" db:"parent_provider_uuid"`
	RootProviderUUID           string `json:"root_provider_uuid" db:"root_provider_uuid"`
	ResourceProviderGeneration int    `json:"resource_provider_generation" db:"resource_provider_generation"`
}

Resource provider model from the OpenStack placement API. This model is returned when listing resource providers.

func (ResourceProvider) Indexes

func (r ResourceProvider) Indexes() map[string][]string

Indexes for the resource provider table.

func (ResourceProvider) TableName

func (r ResourceProvider) TableName() string

Table in which the openstack model is stored.

type Trait

type Trait struct {
	// Corresponds to the hypervisor uuid in the nova hypervisors table.
	ResourceProviderUUID       string `db:"resource_provider_uuid,primarykey"`
	Name                       string `db:"name,primarykey"`
	ResourceProviderGeneration int    `db:"resource_provider_generation"`
}

Resource provider trait model from the OpenStack placement API.

func (Trait) Indexes

func (r Trait) Indexes() map[string][]string

Indexes for the resource provider trait table.

func (Trait) TableName

func (r Trait) TableName() string

Table in which the openstack trait model is stored.

Jump to

Keyboard shortcuts

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