nova

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ComputeNodeGetAll = `` /* 462-byte string literal not displayed */
View Source
const InstanceGetAll = `` /* 343-byte string literal not displayed */
View Source
const ServiceGetAll = `-- name: ServiceGetAll :many
SELECT 
    id,
    uuid,
    host,
    ` + "`" + `binary` + "`" + `,
    topic,
    disabled,
    disabled_reason,
    last_seen_up,
    forced_down,
    version,
    report_count,
    deleted
FROM services
WHERE deleted = 0
  AND last_seen_up IS NOT NULL
  AND topic IS NOT NULL
`

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeNode

type ComputeNode struct {
	CreatedAt           sql.NullTime
	UpdatedAt           sql.NullTime
	DeletedAt           sql.NullTime
	ID                  int32
	ServiceID           sql.NullInt32
	Vcpus               int32
	MemoryMb            int32
	LocalGb             int32
	VcpusUsed           int32
	MemoryMbUsed        int32
	LocalGbUsed         int32
	HypervisorType      string
	HypervisorVersion   int32
	CpuInfo             string
	DiskAvailableLeast  sql.NullInt32
	FreeRamMb           sql.NullInt32
	FreeDiskGb          sql.NullInt32
	CurrentWorkload     sql.NullInt32
	RunningVms          sql.NullInt32
	HypervisorHostname  sql.NullString
	Deleted             sql.NullInt32
	HostIp              sql.NullString
	SupportedInstances  sql.NullString
	PciStats            sql.NullString
	Metrics             sql.NullString
	ExtraResources      sql.NullString
	Stats               sql.NullString
	NumaTopology        sql.NullString
	Host                sql.NullString
	RamAllocationRatio  sql.NullFloat64
	CpuAllocationRatio  sql.NullFloat64
	Uuid                sql.NullString
	DiskAllocationRatio sql.NullFloat64
	Mapped              sql.NullInt32
}

type ComputeNodeGetAllRow

type ComputeNodeGetAllRow struct {
	ID                  int32
	Uuid                sql.NullString
	Host                sql.NullString
	HypervisorHostname  sql.NullString
	HypervisorType      string
	HypervisorVersion   int32
	Vcpus               int32
	VcpusUsed           int32
	MemoryMb            int32
	MemoryMbUsed        int32
	LocalGb             int32
	LocalGbUsed         int32
	DiskAvailableLeast  sql.NullInt32
	FreeRamMb           sql.NullInt32
	FreeDiskGb          sql.NullInt32
	CurrentWorkload     sql.NullInt32
	RunningVms          sql.NullInt32
	CpuAllocationRatio  sql.NullFloat64
	RamAllocationRatio  sql.NullFloat64
	DiskAllocationRatio sql.NullFloat64
	Deleted             sql.NullInt32
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Instance

type Instance struct {
	CreatedAt              sql.NullTime
	UpdatedAt              sql.NullTime
	DeletedAt              sql.NullTime
	ID                     int32
	InternalID             sql.NullInt32
	UserID                 sql.NullString
	ProjectID              sql.NullString
	ImageRef               sql.NullString
	KernelID               sql.NullString
	RamdiskID              sql.NullString
	LaunchIndex            sql.NullInt32
	KeyName                sql.NullString
	KeyData                sql.NullString
	PowerState             sql.NullInt32
	VmState                sql.NullString
	MemoryMb               sql.NullInt32
	Vcpus                  sql.NullInt32
	Hostname               sql.NullString
	Host                   sql.NullString
	UserData               sql.NullString
	ReservationID          sql.NullString
	LaunchedAt             sql.NullTime
	TerminatedAt           sql.NullTime
	DisplayName            sql.NullString
	DisplayDescription     sql.NullString
	AvailabilityZone       sql.NullString
	Locked                 sql.NullBool
	OsType                 sql.NullString
	LaunchedOn             sql.NullString
	InstanceTypeID         sql.NullInt32
	VmMode                 sql.NullString
	Uuid                   string
	Architecture           sql.NullString
	RootDeviceName         sql.NullString
	AccessIpV4             sql.NullString
	AccessIpV6             sql.NullString
	ConfigDrive            sql.NullString
	TaskState              sql.NullString
	DefaultEphemeralDevice sql.NullString
	DefaultSwapDevice      sql.NullString
	Progress               sql.NullInt32
	AutoDiskConfig         sql.NullBool
	ShutdownTerminate      sql.NullBool
	DisableTerminate       sql.NullBool
	RootGb                 sql.NullInt32
	EphemeralGb            sql.NullInt32
	CellName               sql.NullString
	Node                   sql.NullString
	Deleted                sql.NullInt32
	LockedBy               NullInstancesLockedBy
	Cleaned                sql.NullInt32
	EphemeralKeyUuid       sql.NullString
	Hidden                 sql.NullBool
	ComputeID              sql.NullInt64
}

type InstanceFilters

type InstanceFilters struct {
	UUIDs         []string
	ProjectIDs    []string
	Hosts         []string
	VMStates      []string
	Deleted       db.Deleted
	CreatedBefore time.Time
	DeletedAfter  time.Time
}

InstanceFilters combines exact-match filters with AND. Values within a slice use OR. Nil slices are unrestricted; non-nil empty slices match no records. CreatedBefore and DeletedAfter form an optional half-open lifetime window. The zero deletion policy excludes soft-deleted records.

type InstanceGetAllRow

type InstanceGetAllRow struct {
	ID               int32
	Uuid             string
	DisplayName      sql.NullString
	UserID           sql.NullString
	ProjectID        sql.NullString
	Host             sql.NullString
	AvailabilityZone sql.NullString
	VmState          sql.NullString
	PowerState       sql.NullInt32
	TaskState        sql.NullString
	MemoryMb         sql.NullInt32
	Vcpus            sql.NullInt32
	RootGb           sql.NullInt32
	EphemeralGb      sql.NullInt32
	LaunchedAt       sql.NullTime
	TerminatedAt     sql.NullTime
	InstanceTypeID   sql.NullInt32
	Deleted          sql.NullInt32
}

type InstancesLockedBy

type InstancesLockedBy string
const (
	InstancesLockedByOwner InstancesLockedBy = "owner"
	InstancesLockedByAdmin InstancesLockedBy = "admin"
)

func (*InstancesLockedBy) Scan

func (e *InstancesLockedBy) Scan(src interface{}) error

type NullInstancesLockedBy

type NullInstancesLockedBy struct {
	InstancesLockedBy InstancesLockedBy
	Valid             bool // Valid is true if InstancesLockedBy is not NULL
}

func (*NullInstancesLockedBy) Scan

func (ns *NullInstancesLockedBy) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInstancesLockedBy) Value

func (ns NullInstancesLockedBy) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ComputeNodeGetAll

func (q *Queries) ComputeNodeGetAll(ctx context.Context) ([]ComputeNodeGetAllRow, error)

func (*Queries) InstanceGetAll

func (q *Queries) InstanceGetAll(ctx context.Context) ([]InstanceGetAllRow, error)

func (*Queries) InstanceGetAllByFilters

func (q *Queries) InstanceGetAllByFilters(ctx context.Context, f InstanceFilters) ([]InstanceGetAllRow, error)

InstanceGetAllByFilters returns the resource projection for matching database records. It does not perform OpenStack authorization, cell discovery, or archive searches.

func (*Queries) InstanceGetByUUID

func (q *Queries) InstanceGetByUUID(ctx context.Context, id string) (InstanceGetAllRow, error)

InstanceGetByUUID returns one undeleted resource, or sql.ErrNoRows when absent.

func (*Queries) ServiceGetAll

func (q *Queries) ServiceGetAll(ctx context.Context) ([]ServiceGetAllRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Service

type Service struct {
	CreatedAt      sql.NullTime
	UpdatedAt      sql.NullTime
	DeletedAt      sql.NullTime
	ID             int32
	Host           sql.NullString
	Binary         sql.NullString
	Topic          sql.NullString
	ReportCount    int32
	Disabled       sql.NullBool
	Deleted        sql.NullInt32
	DisabledReason sql.NullString
	LastSeenUp     sql.NullTime
	ForcedDown     sql.NullBool
	Version        sql.NullInt32
	Uuid           sql.NullString
}

type ServiceGetAllRow

type ServiceGetAllRow struct {
	ID             int32
	Uuid           sql.NullString
	Host           sql.NullString
	Binary         sql.NullString
	Topic          sql.NullString
	Disabled       sql.NullBool
	DisabledReason sql.NullString
	LastSeenUp     sql.NullTime
	ForcedDown     sql.NullBool
	Version        sql.NullInt32
	ReportCount    int32
	Deleted        sql.NullInt32
}

Jump to

Keyboard shortcuts

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