nova

package
v0.0.0-...-b959757 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

type Aggregate struct {
	UUID             string  `json:"uuid" db:"uuid"`
	Name             string  `json:"name" db:"name"`
	AvailabilityZone *string `json:"availability_zone" db:"availability_zone"`
	ComputeHost      *string `json:"compute_host" db:"compute_host"` // Host that the aggregate is associated with.
	Metadata         string  `json:"metadata" db:"metadata"`         // JSON string of properties.
}

Aggregate as converted to be handled efficiently in a database.

func (Aggregate) Indexes

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

Index for the openstack model.

func (Aggregate) TableName

func (Aggregate) TableName() string

Table in which the openstack model is stored.

type DeletedServer

type DeletedServer struct {
	ID                             string  `json:"id" db:"id,primarykey"`
	Name                           string  `json:"name" db:"name"`
	Status                         string  `json:"status" db:"status"`
	TenantID                       string  `json:"tenant_id" db:"tenant_id"`
	UserID                         string  `json:"user_id" db:"user_id"`
	HostID                         string  `json:"hostId" db:"host_id"`
	Created                        string  `json:"created" db:"created"`
	Updated                        string  `json:"updated" db:"updated"`
	OSEXTAvailabilityZone          string  `json:"OS-EXT-AZ:availability_zone" db:"os_ext_az_availability_zone"`
	OSSRVUSGLaunchedAt             string  `json:"OS-SRV-USG:launched_at" db:"os_srv_usg_launched_at"`
	OSSRVUSGTerminatedAt           *string `json:"OS-SRV-USG:terminated_at" db:"os_srv_usg_terminated_at"`
	OSEXTSRVATTRHost               string  `json:"OS-EXT-SRV-ATTR:host" db:"os_ext_srv_attr_host"`
	OSEXTSRVATTRInstanceName       string  `json:"OS-EXT-SRV-ATTR:instance_name" db:"os_ext_srv_attr_instance_name"`
	OSEXTSRVATTRHypervisorHostname string  `json:"OS-EXT-SRV-ATTR:hypervisor_hostname" db:"os_ext_srv_attr_hypervisor_hostname"`

	// From nested JSON.
	FlavorName string `json:"-" db:"flavor_name"`
}

OpenStack server model as returned by the Nova API under /servers/detail. See: https://docs.openstack.org/api-ref/compute/#list-servers-detailed

func (DeletedServer) Indexes

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

Index for the openstack model.

func (*DeletedServer) MarshalJSON

func (s *DeletedServer) MarshalJSON() ([]byte, error)

Custom marshaler for OpenStackServer to handle nested JSON.

func (DeletedServer) TableName

func (DeletedServer) TableName() string

Table in which the openstack model is stored.

func (*DeletedServer) UnmarshalJSON

func (s *DeletedServer) UnmarshalJSON(data []byte) error

Custom unmarshaler for OpenStackServer to handle nested JSON.

type Flavor

type Flavor struct {
	ID          string  `json:"id" db:"id,primarykey"`
	Disk        uint64  `json:"disk" db:"disk"` // in GB.
	RAM         uint64  `json:"ram" db:"ram"`   // in MB.
	Name        string  `json:"name" db:"name"`
	RxTxFactor  float64 `json:"rxtx_factor" db:"rxtx_factor"`
	VCPUs       uint64  `json:"vcpus" db:"vcpus"`
	IsPublic    bool    `json:"os-flavor-access:is_public" db:"is_public"`
	Ephemeral   uint64  `json:"OS-FLV-EXT-DATA:ephemeral" db:"ephemeral"`
	Description string  `json:"description" db:"description"`

	// JSON string of extra specifications used when scheduling the flavor.
	ExtraSpecs string `json:"extra_specs" db:"extra_specs"`
}

OpenStack flavor model as returned by the Nova API under /flavors/detail. See: https://docs.openstack.org/api-ref/compute/#list-flavors

func (Flavor) Indexes

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

Index for the openstack model.

func (*Flavor) MarshalJSON

func (f *Flavor) MarshalJSON() ([]byte, error)

Custom marshaler for OpenStackFlavor to handle nested JSON.

func (Flavor) TableName

func (Flavor) TableName() string

Table in which the openstack model is stored.

func (*Flavor) UnmarshalJSON

func (f *Flavor) UnmarshalJSON(data []byte) error

Custom unmarshaler for OpenStackFlavor to handle nested JSON.

type Hypervisor

type Hypervisor struct {
	ID                string `json:"id" db:"id,primarykey"`
	Hostname          string `json:"hypervisor_hostname" db:"hostname"`
	State             string `json:"state" db:"state"`
	Status            string `json:"status" db:"status"`
	HypervisorType    string `json:"hypervisor_type" db:"hypervisor_type"`
	HypervisorVersion int    `json:"hypervisor_version" db:"hypervisor_version"`
	HostIP            string `json:"host_ip" db:"host_ip"`
	// From nested JSON
	ServiceID             string  `json:"service_id" db:"service_id"`
	ServiceHost           string  `json:"service_host" db:"service_host"` // Used by the scheduler.
	ServiceDisabledReason *string `json:"service_disabled_reason" db:"service_disabled_reason"`
	VCPUs                 int     `json:"vcpus" db:"vcpus"`
	MemoryMB              int     `json:"memory_mb" db:"memory_mb"`
	LocalGB               int     `json:"local_gb" db:"local_gb"`
	VCPUsUsed             int     `json:"vcpus_used" db:"vcpus_used"`
	MemoryMBUsed          int     `json:"memory_mb_used" db:"memory_mb_used"`
	LocalGBUsed           int     `json:"local_gb_used" db:"local_gb_used"`
	FreeRAMMB             int     `json:"free_ram_mb" db:"free_ram_mb"`
	FreeDiskGB            int     `json:"free_disk_gb" db:"free_disk_gb"`
	CurrentWorkload       int     `json:"current_workload" db:"current_workload"`
	RunningVMs            int     `json:"running_vms" db:"running_vms"`
	DiskAvailableLeast    *int    `json:"disk_available_least" db:"disk_available_least"`
	CPUInfo               string  `json:"cpu_info" db:"cpu_info"`
}

OpenStack hypervisor model as returned by the Nova API under /os-hypervisors/detail. See: https://docs.openstack.org/api-ref/compute/#list-hypervisors-details

func (Hypervisor) Indexes

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

Index for the openstack model.

func (*Hypervisor) MarshalJSON

func (h *Hypervisor) MarshalJSON() ([]byte, error)

Custom marshaler for OpenStackHypervisor to handle nested JSON. Specifically, we wrap the "service" field into a separate JSON object. This is the reverse operation of the UnmarshalJSON method.

func (Hypervisor) TableName

func (Hypervisor) TableName() string

Table in which the openstack model is stored.

func (*Hypervisor) UnmarshalJSON

func (h *Hypervisor) UnmarshalJSON(data []byte) error

Custom unmarshaler for OpenStackHypervisor to handle nested JSON. Specifically, we unwrap the "service" field into separate fields. Flattening these fields makes querying the data easier.

type Migration

type Migration struct {
	ID                int    `json:"id" db:"id,primarykey"`
	UUID              string `json:"uuid" db:"uuid"`
	SourceCompute     string `json:"source_compute" db:"source_compute"`
	DestCompute       string `json:"dest_compute" db:"dest_compute"`
	SourceNode        string `json:"source_node" db:"source_node"`
	DestNode          string `json:"dest_node" db:"dest_node"`
	DestHost          string `json:"dest_host" db:"dest_host"`
	OldInstanceTypeID int    `json:"old_instance_type_id" db:"old_instance_type_id"`
	NewInstanceTypeID int    `json:"new_instance_type_id" db:"new_instance_type_id"`
	InstanceUUID      string `json:"instance_uuid" db:"instance_uuid"`
	Status            string `json:"status" db:"status"`
	MigrationType     string `json:"migration_type" db:"migration_type"`
	UserID            string `json:"user_id" db:"user_id"`
	ProjectID         string `json:"project_id" db:"project_id"`
	CreatedAt         string `json:"created_at" db:"created_at"`
	UpdatedAt         string `json:"updated_at" db:"updated_at"`
}

OpenStack migration model as returned by the Nova API under /os-migrations. See: https://docs.openstack.org/api-ref/compute/#list-migrations

func (Migration) Indexes

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

Index for the openstack model.

func (Migration) TableName

func (Migration) TableName() string

Table in which the openstack model is stored.

type RawAggregate

type RawAggregate struct {
	UUID             string            `json:"uuid"`
	Name             string            `json:"name"`
	AvailabilityZone *string           `json:"availability_zone"`
	Hosts            []string          `json:"hosts"`
	Metadata         map[string]string `json:"metadata"`
}

Raw aggregate as returned by the Nova API under /os-aggregates.

type Server

type Server struct {
	ID                             string  `json:"id" db:"id,primarykey"`
	Name                           string  `json:"name" db:"name"`
	Status                         string  `json:"status" db:"status"`
	TenantID                       string  `json:"tenant_id" db:"tenant_id"`
	UserID                         string  `json:"user_id" db:"user_id"`
	HostID                         string  `json:"hostId" db:"host_id"`
	Created                        string  `json:"created" db:"created"`
	Updated                        string  `json:"updated" db:"updated"`
	AccessIPv4                     string  `json:"accessIPv4" db:"access_ipv4"`
	AccessIPv6                     string  `json:"accessIPv6" db:"access_ipv6"`
	OSDCFdiskConfig                string  `json:"OS-DCF:diskConfig" db:"os_dcf_disk_config"`
	Progress                       int     `json:"progress" db:"progress"`
	OSEXTAvailabilityZone          string  `json:"OS-EXT-AZ:availability_zone" db:"os_ext_az_availability_zone"`
	ConfigDrive                    string  `json:"config_drive" db:"config_drive"`
	KeyName                        string  `json:"key_name" db:"key_name"`
	OSSRVUSGLaunchedAt             string  `json:"OS-SRV-USG:launched_at" db:"os_srv_usg_launched_at"`
	OSSRVUSGTerminatedAt           *string `json:"OS-SRV-USG:terminated_at" db:"os_srv_usg_terminated_at"`
	OSEXTSRVATTRHost               string  `json:"OS-EXT-SRV-ATTR:host" db:"os_ext_srv_attr_host"`
	OSEXTSRVATTRInstanceName       string  `json:"OS-EXT-SRV-ATTR:instance_name" db:"os_ext_srv_attr_instance_name"`
	OSEXTSRVATTRHypervisorHostname string  `json:"OS-EXT-SRV-ATTR:hypervisor_hostname" db:"os_ext_srv_attr_hypervisor_hostname"`
	OSEXTSTSTaskState              *string `json:"OS-EXT-STS:task_state" db:"os_ext_sts_task_state"`
	OSEXTSTSVmState                string  `json:"OS-EXT-STS:vm_state" db:"os_ext_sts_vm_state"`
	OSEXTSTSPowerState             int     `json:"OS-EXT-STS:power_state" db:"os_ext_sts_power_state"`

	// From nested JSON
	FlavorName string `json:"-" db:"flavor_name"`
}

OpenStack server model as returned by the Nova API under /servers/detail. See: https://docs.openstack.org/api-ref/compute/#list-servers-detailed

func (Server) Indexes

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

Index for the openstack model.

func (*Server) MarshalJSON

func (s *Server) MarshalJSON() ([]byte, error)

Custom marshaler for OpenStackServer to handle nested JSON.

func (Server) TableName

func (Server) TableName() string

Table in which the openstack model is stored.

func (*Server) UnmarshalJSON

func (s *Server) UnmarshalJSON(data []byte) error

Custom unmarshaler for OpenStackServer to handle nested JSON.

Jump to

Keyboard shortcuts

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