nova

package
v0.0.0-...-e4c7a12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BAR_CHAR = "*"
View Source
var POWER_STATE = []string{
	"NOSTATE", "Running", "", "Paused", "ShutDown", "", "Crashed", "Suspend",
}

Functions

This section is empty.

Types

type AZHost

type AZHost map[string]ServiceState

type Address

type Address struct {
	MacAddr string `json:"OS-EXT-IPS-MAC:mac_addr"`
	Version int    `json:"version"`
	Addr    string `json:"addr"`
	Type    string `json:"OS-EXT-IPS:type"`
}

type AddressList

type AddressList []Address

func (AddressList) Addrs

func (a AddressList) Addrs() []string

type Aggregate

type Aggregate struct {
	Id               int               `json:"id,omitempty"`
	Name             string            `json:"name,omitempty"`
	AvailabilityZone string            `json:"availability_zone,omitempty"`
	Deleted          bool              `json:"deleted,omitempty"`
	Hosts            []string          `json:"hosts,omitempty"`
	Metadata         map[string]string `json:"metadata,omitempty"`
	CreatedAt        string            `json:"created_at,omitempty"`
	UpdatedAt        string            `json:"updated_at,omitempty"`
	DeletedAt        string            `json:"deleted_at,omitempty"`
}

func (Aggregate) GetMetadataList

func (agg Aggregate) GetMetadataList() []string

func (Aggregate) MarshalMetadata

func (agg Aggregate) MarshalMetadata() string

type AvailabilityZone

type AvailabilityZone struct {
	ZoneName  string            `json:"zoneName"`
	ZoneState ZoneState         `json:"zoneState"`
	Hosts     map[string]AZHost `json:"hosts,omitempty"`
}

type BlockDeviceMappingV2

type BlockDeviceMappingV2 struct {
	BootIndex          int    `json:"boot_index"`
	UUID               string `json:"uuid,omitempty"`
	VolumeSize         uint16 `json:"volume_size,omitempty"`
	SourceType         string `json:"source_type,omitempty"`
	DestinationType    string `json:"destination_type,omitempty"`
	VolumeType         string `json:"volume_type,omitempty"`
	DeleteOnTemination bool   `json:"delete_on_termination,omitempty"`
}

type Capacity

type Capacity struct {
	AllowedSoldNum int    `json:"allowed_sold_num"`
	AZ             string `json:"az"`
	FlavorId       string `json:"flavor_id"`
}

type Console

type Console struct {
	Type     string `json:"type,omitempty"`
	Url      string `json:"url,omitempty"`
	Protocol string `json:"protocol,omitempty"`
}

type ConsoleLog

type ConsoleLog struct {
	Output string `json:"output"`
}

type CpuInfo

type CpuInfo struct {
	Arch     string                 `json:"arch"`
	Model    string                 `json:"model"`
	Vendor   string                 `json:"vendor"`
	Features []string               `json:"Features"`
	Topology map[string]interface{} `json:"topology"`
}

type ExtraSpecs

type ExtraSpecs map[string]string

func ParseExtraSpecsMap

func ParseExtraSpecsMap(extraSpecs []string) ExtraSpecs

func (ExtraSpecs) Get

func (extraSpecs ExtraSpecs) Get(key string) string

func (ExtraSpecs) GetList

func (extraSpecs ExtraSpecs) GetList() []string

type Fault

type Fault struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
	Details string `json:"details,omitempty"`
}

func (*Fault) Marshal

func (fault *Fault) Marshal() string

type FixedIp

type FixedIp struct {
	IpAddress string `json:"ip_address"`
	SubnetId  string `json:"subnet_id"`
}

type Flavor

type Flavor struct {
	Id           string      `json:"id,omitempty"`
	Name         string      `json:"name,omitempty"`
	OriginalName string      `json:"original_name,omitempty"`
	Ram          int         `json:"ram,omitempty"`
	Vcpus        int         `json:"vcpus,omitempty"`
	Disk         int         `json:"disk"`
	Swap         interface{} `json:"swap,omitempty"`
	RXTXFactor   float32     `json:"rxtx_factor,omitempty"`
	ExtraSpecs   ExtraSpecs  `json:"extra_specs,omitempty"`
	IsPublic     bool        `json:"os-flavor-access:is_public,omitempty"`
	Ephemeral    int         `json:"OS-FLV-DISABLED:ephemeral,omitempty"`
	Disabled     bool        `json:"OS-FLV-DISABLED:disabled,omitempty"`
}

func (Flavor) BaseInfo

func (flavor Flavor) BaseInfo() string

func (Flavor) HumanRam

func (flavor Flavor) HumanRam() string

func (Flavor) Marshal

func (flavor Flavor) Marshal() string

type FlavorCapacities

type FlavorCapacities struct {
	PageInfo   PageInfo   `json:"page_info"`
	Capacities []Capacity `json:"capacities"`
}

type Flavors

type Flavors []Flavor

type Hypervisor

type Hypervisor struct {
	model.Resource
	Host               string                 `json:"host"`
	HypervisorHostname string                 `json:"hypervisor_hostname"`
	HostIp             string                 `json:"host_ip"`
	Status             string                 `json:"status"`
	State              string                 `json:"state"`
	Type               string                 `json:"hypervisor_type"`
	Version            int                    `json:"hypervisor_version"`
	Uptime             string                 `json:"uptime"`
	Vcpus              int                    `json:"vcpus"`
	VcpusUsed          int                    `json:"vcpus_used"`
	MemoryMB           int                    `json:"memory_mb"`
	MemoryMBUsed       int                    `json:"memory_mb_used"`
	ExtraResources     map[string]interface{} `json:"extra_resources"`
	CpuInfo            CpuInfo                `json:"cpu_info"`

	NumaNodes map[string]NumaNode
	Servers   []HypervisorServer
}

func (Hypervisor) ExtraResourcesMarshal

func (hypervisor Hypervisor) ExtraResourcesMarshal(indent bool) string

func (Hypervisor) NumaNodeKeys

func (hypervisor Hypervisor) NumaNodeKeys() []string

func (Hypervisor) NumaNodesBar

func (hypervisor Hypervisor) NumaNodesBar() string

func (Hypervisor) NumaNodesLine

func (hypervisor Hypervisor) NumaNodesLine() string

func (*Hypervisor) SetNumaNodes

func (hypervisor *Hypervisor) SetNumaNodes(data []byte) error

type HypervisorServer

type HypervisorServer struct {
	Name string `json:"name"`
	UUID string `json:"uuid"`
}

type Hypervisors

type Hypervisors []Hypervisor

type Image

type Image struct {
	Id   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type InstanceAction

type InstanceAction struct {
	model.Resource
	Action       string                `json:"action"`
	InstanceUUID string                `json:"instance_uuid"`
	Message      string                `json:"message"`
	RequestId    string                `json:"request_id"`
	StartTime    string                `json:"start_time"`
	Events       []InstanceActionEvent `json:"events"`
}

func (InstanceAction) GetSpendTime

func (actionWithEvents InstanceAction) GetSpendTime() (float64, error)

type InstanceActionEvent

type InstanceActionEvent struct {
	Event      string `json:"event"`
	StartTime  string `json:"start_time"`
	FinishTime string `json:"finish_time"`
	Host       string `json:"host"`
	HostId     string `json:"hostId"`
	Result     string `json:"result"`
	Traceback  string `json:"traceback"`
}

func (InstanceActionEvent) GetSpendTime

func (event InstanceActionEvent) GetSpendTime() (float64, error)

type InstanceActionEvents

type InstanceActionEvents []InstanceActionEvent

type InstanceActions

type InstanceActions []InstanceAction

type InterfaceAttachment

type InterfaceAttachment struct {
	model.RequestId
	MacAddr   string    `json:"mac_addr"`
	NetId     string    `json:"net_id"`
	PortId    string    `json:"port_id"`
	PortState string    `json:"port_state"`
	FixedIps  []FixedIp `json:"fixed_ips"`
}

func (InterfaceAttachment) GetIpAddresses

func (attachment InterfaceAttachment) GetIpAddresses() []string

type Keypair

type Keypair struct {
	Keypair keypair `json:"keypair"`
}

type KeypairOpt

type KeypairOpt struct {
	PublicKey string
	UserId    string
}

type Keypairs

type Keypairs []Keypair

type Migration

type Migration struct {
	Id                int    `json:"id"`
	OldInstanceTypeId int    `json:"old_instance_type_id"`
	NewInstanceTypeId int    `json:"new_instance_type_id"`
	InstanceUUID      string `json:"instance_uuid"`
	MigrationType     string `json:"migration_type"`
	Status            string `json:"status"`
	DestCompute       string `json:"dest_compute"`
	DestNode          string `json:"dest_node"`
	DestHost          string `json:"dest_host"`
	SourceCompute     string `json:"source_compute"`
	SourceNode        string `json:"source_node"`
	SourceRegion      string `json:"source_region,omitempty"`
	DestRegion        string `json:"dest_regoin,omitempty"`
	CreatedAt         string `json:"created_at,omitempty"`
	UpdatedAt         string `json:"updated_at,omitempty"`
}

type NumaNode

type NumaNode struct {
	HugePages NumaNodeHugePages
	CpuSet    NumaNodeCpuSet
}

type NumaNodeCpuSet

type NumaNodeCpuSet struct {
	Total    int
	Free     int
	Reserved int
	Used     int
}

func (NumaNodeCpuSet) Bar

func (cpuset NumaNodeCpuSet) Bar() string

func (NumaNodeCpuSet) String

func (cpuset NumaNodeCpuSet) String() string

type NumaNodeHugePages

type NumaNodeHugePages struct {
	Total    int
	Free     int
	Reserved int
	Used     int
}

func (NumaNodeHugePages) Bar

func (hugepage NumaNodeHugePages) Bar() string

func (NumaNodeHugePages) String

func (hugepage NumaNodeHugePages) String() string

type PageInfo

type PageInfo struct {
	PageSize int `json:"page_size"`
}

type QuotaSet

type QuotaSet struct {
	Instances                int `json:"instances"`
	Cores                    int `json:"cores"`
	Ram                      int `json:"ram"`
	MetadataItems            int `json:"metadata_items"`
	Keypairs                 int `json:"key_pairs"`
	FloatingIps              int `json:"floating_ips"`
	SecurityGroups           int `json:"server_groups"`
	SecurityGroupsMembers    int `json:"server_group_members"`
	FixedIps                 int `json:"fixed_ips"`
	InjectedFiles            int `json:"injected_files"`
	InjectedFileContentBytes int `json:"injected_file_content_bytes"`
	InjectedFilePathBytes    int `json:"injected_file_path_bytes"`
}

{"injected_file_content_bytes": -1, "metadata_items": -1, "server_group_members": -1,

"server_groups": -1, "ram": -1, "floating_ips": 10, "key_pairs": -1,

"id": "4f362d490e5848ab9f1be44b5479b084",

"instances": -1, "security_group_rules": 20, "injected_files": -1, "cores": -1,

"fixed_ips": -1, "injected_file_path_bytes": -1, "security_groups": 10}}

type RebuilOpt

type RebuilOpt struct {
	ImageId  string
	Password string
	Name     string
	UserData interface{}
}

type RegionMigrateResp

type RegionMigrateResp struct {
	AllowLiveMigrate bool   `json:"allow_live_migrate"`
	Reason           string `json:"reason"`
}

type Server

type Server struct {
	model.Resource
	TaskState          string                  `json:"OS-EXT-STS:task_state,omitempty"`
	PowerState         int                     `json:"OS-EXT-STS:power_state,omitempty"`
	VmState            string                  `json:"OS-EXT-STS:vm_state,omitempty"`
	Host               string                  `json:"OS-EXT-SRV-ATTR:host,omitempty"`
	HypervisorHostname string                  `json:"OS-EXT-SRV-ATTR:hypervisor_hostname,omitempty"`
	AZ                 string                  `json:"OS-EXT-AZ:availability_zone,omitempty"`
	Flavor             Flavor                  `json:"flavor,omitempty"`
	Image              interface{}             `json:"image,omitempty"`
	Fault              Fault                   `json:"fault,omitempty"`
	Addresses          map[string]AddressList  `json:"addresses,omitempty"`
	InstanceName       string                  `json:"OS-EXT-SRV-ATTR:instance_name,omitempty"`
	ConfigDriver       string                  `json:"config_drive,omitempty"`
	Created            string                  `json:"created,omitempty"`
	Updated            string                  `json:"updated,omitempty"`
	TerminatedAt       string                  `json:"OS-SRV-USG:terminated_at,omitempty"`
	LaunchedAt         string                  `json:"OS-SRV-USG:launched_at,omitempty"`
	UserId             string                  `json:"user_id,omitempty"`
	Description        string                  `json:"description,omitempty"`
	RootBdmType        string                  `json:"root_bdm_type,omitempty"`
	RootDeviceName     string                  `json:"OS-EXT-SRV-ATTR:root_device_name,omitempty"`
	KeyName            string                  `json:"key_name,omitempty"`
	SecurityGroups     []neutron.SecurityGroup `json:"security_groups,omitempty"`
	Progress           float32                 `json:"progress"`
}

func (Server) AllStatus

func (server Server) AllStatus() string

func (Server) GetFaultString

func (server Server) GetFaultString() string

func (Server) GetFlavorExtraSpecsString

func (server Server) GetFlavorExtraSpecsString() string

func (*Server) GetNetworks

func (server *Server) GetNetworks() []string

func (*Server) GetPowerState

func (server *Server) GetPowerState() string

func (*Server) GetTaskState

func (server *Server) GetTaskState() string

func (Server) GuestHostname

func (server Server) GuestHostname() string

func (Server) ImageId

func (s Server) ImageId() string

func (Server) ImageName

func (s Server) ImageName() string

func (Server) InResize

func (server Server) InResize() bool

func (Server) IsActive

func (server Server) IsActive() bool

func (Server) IsError

func (server Server) IsError() bool

func (Server) IsMigrating

func (server Server) IsMigrating() bool

func (Server) IsPaused

func (server Server) IsPaused() bool

func (Server) IsRunning

func (server Server) IsRunning() bool

func (Server) IsShelved

func (server Server) IsShelved() bool

func (Server) IsStopped

func (server Server) IsStopped() bool

func (Server) IsSuspended

func (server Server) IsSuspended() bool

func (*Server) SetImageName

func (s *Server) SetImageName(name string)

func (Server) StatusIs

func (server Server) StatusIs(status string) bool

type ServerGroup

type ServerGroup struct {
	Id        string                 `json:"id"`
	Name      string                 `json:"name"`
	Policies  []string               `json:"policies"`
	Custom    bool                   `json:"custom"`
	Members   []string               `json:"members"`
	Metadata  map[string]interface{} `json:"metadata"`
	ProjectId string                 `json:"project_id"`
	UserId    string                 `json:"user_id"`
}

{"policies": ["soft-anti-affinity"], "name": "soft-anti-affinity", "custom": false, "members": [], "id": "7357b2f7-d004-4c72-b38a-d3a156827c11", "metadata": {}}]

func (ServerGroup) GetMetadataList

func (serverGroup ServerGroup) GetMetadataList() []string

type ServerOpt

type ServerOpt struct {
	Flavor               string                  `json:"flavorRef,omitempty"`
	Image                string                  `json:"imageRef,omitempty"`
	Name                 string                  `json:"name,omitempty"`
	Networks             interface{}             `json:"networks,omitempty"`
	AvailabilityZone     string                  `json:"availability_zone,omitempty"`
	BlockDeviceMappingV2 []BlockDeviceMappingV2  `json:"block_device_mapping_v2,omitempty"`
	MinCount             uint16                  `json:"min_count"`
	MaxCount             uint16                  `json:"max_count"`
	UserData             string                  `json:"user_data,omitempty"`
	KeyName              string                  `json:"key_name,omitempty"`
	AdminPass            string                  `json:"adminPass,omitempty"`
	SecurityGroups       []neutron.SecurityGroup `json:"security_groups,omitempty"`
}

type ServerOptNetwork

type ServerOptNetwork struct {
	UUID string `json:"uuid,omitempty"`
	Port string `json:"port,omitempty"`
}

func ParseServerOptNetworks

func ParseServerOptNetworks(nics []string) []ServerOptNetwork

type Servers

type Servers []Server

type ServersResp

type ServersResp struct {
	model.RequestId
	Items []Server
}

type Service

type Service struct {
	model.Resource
	Zone           string `json:"zone,omitempty"`
	Host           string `json:"host,omitempty"`
	Binary         string `json:"binary,omitempty"`
	Status         string `json:"status,omitempty"`
	State          string `json:"state,omitempty"`
	DisabledReason string `json:"disabled_reason,omitempty"`
	ForcedDown     bool   `json:"forced_down,omitempty"`
}

type ServiceState

type ServiceState struct {
	Available bool   `json:"available"`
	Active    bool   `json:"active"`
	UpdatedAt string `json:"updated_at"`
}

type Services

type Services []Service

type VolumeAttachment

type VolumeAttachment struct {
	Id                  string `json:"id"`
	Device              string `json:"device"`
	ServerId            string `json:"serverId"`
	VolumeId            string `json:"volumeId"`
	DeleteOnTermination bool   `json:"delete_on_termination,omitempty"`
}

type ZoneState

type ZoneState struct {
	Available bool `json:"available"`
}

Jump to

Keyboard shortcuts

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