Documentation
¶
Index ¶
- Variables
- type AZHost
- type Address
- type AddressList
- type Aggregate
- type AvailabilityZone
- type BlockDeviceMappingV2
- type Capacity
- type Console
- type ConsoleLog
- type CpuInfo
- type ExtraSpecs
- type Fault
- type FixedIp
- type Flavor
- type FlavorCapacities
- type Flavors
- type Hypervisor
- type HypervisorServer
- type Hypervisors
- type Image
- type InstanceAction
- type InstanceActionEvent
- type InstanceActionEvents
- type InstanceActions
- type InterfaceAttachment
- type Keypair
- type KeypairOpt
- type Keypairs
- type Migration
- type NumaNode
- type NumaNodeCpuSet
- type NumaNodeHugePages
- type PageInfo
- type QuotaSet
- type RebuilOpt
- type RegionMigrateResp
- type Server
- func (server Server) AllStatus() string
- func (server Server) GetFaultString() string
- func (server Server) GetFlavorExtraSpecsString() string
- func (server *Server) GetNetworks() []string
- func (server *Server) GetPowerState() string
- func (server *Server) GetTaskState() string
- func (server Server) GuestHostname() string
- func (s Server) ImageId() string
- func (s Server) ImageName() string
- func (server Server) InResize() bool
- func (server Server) IsActive() bool
- func (server Server) IsError() bool
- func (server Server) IsMigrating() bool
- func (server Server) IsPaused() bool
- func (server Server) IsRunning() bool
- func (server Server) IsShelved() bool
- func (server Server) IsStopped() bool
- func (server Server) IsSuspended() bool
- func (s *Server) SetImageName(name string)
- func (server Server) StatusIs(status string) bool
- type ServerGroup
- type ServerOpt
- type ServerOptNetwork
- type Servers
- type ServersResp
- type Service
- type ServiceState
- type Services
- type VolumeAttachment
- type ZoneState
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 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 (Aggregate) MarshalMetadata ¶
type AvailabilityZone ¶
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 ConsoleLog ¶
type ConsoleLog struct {
Output string `json:"output"`
}
type ExtraSpecs ¶
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 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 any `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"`
}
type FlavorCapacities ¶
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]any `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 Hypervisors ¶
type Hypervisors []Hypervisor
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 KeypairOpt ¶
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 ¶
func (NumaNodeCpuSet) Bar ¶
func (cpuset NumaNodeCpuSet) Bar() string
func (NumaNodeCpuSet) String ¶
func (cpuset NumaNodeCpuSet) String() string
type NumaNodeHugePages ¶
func (NumaNodeHugePages) Bar ¶
func (hugepage NumaNodeHugePages) Bar() string
func (NumaNodeHugePages) String ¶
func (hugepage NumaNodeHugePages) String() string
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"`
}
type RegionMigrateResp ¶
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 any `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) GetFaultString ¶
func (Server) GetFlavorExtraSpecsString ¶
func (*Server) GetNetworks ¶
func (*Server) GetPowerState ¶
func (*Server) GetTaskState ¶
func (Server) GuestHostname ¶
func (Server) IsMigrating ¶
func (Server) IsSuspended ¶
func (*Server) SetImageName ¶
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]any `json:"metadata"`
ProjectId string `json:"project_id"`
UserId string `json:"user_id"`
}
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 any `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 ServersResp ¶
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 VolumeAttachment ¶
Click to show internal directories.
Click to hide internal directories.