machine

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegistryBuilder tableconverter.RegistryBuilder
	AddToRegistry   = RegistryBuilder.AddToRegistry
)
View Source
var Machine, MachineSlice = tableconverter.ForType[*ori.Machine](
	func() ([]table.Header, error) {
		return machineHeaders, nil
	},
	func(machine *ori.Machine) ([]table.Row, error) {
		return []table.Row{
			{
				machine.Metadata.Id,
				machine.Spec.Class,
				machine.Spec.GetImage().GetImage(),
				machine.Status.State.String(),
				duration.HumanDuration(time.Since(time.Unix(0, machine.Metadata.CreatedAt))),
			},
		}, nil
	},
)
View Source
var MachineClass, MachineClassSlice = tableconverter.ForType[*ori.MachineClass](
	func() ([]table.Header, error) {
		return machineClassHeaders, nil
	},
	func(class *ori.MachineClass) ([]table.Row, error) {
		return []table.Row{
			{
				class.Name,
				resource.NewMilliQuantity(class.Capabilities.CpuMillis, resource.DecimalSI).String(),
				resource.NewQuantity(int64(class.Capabilities.MemoryBytes), resource.DecimalSI).String(),
			},
		}, nil
	},
)
View Source
var NetworkInterface, NetworkInterfaceSlice = tableconverter.ForType[*ori.NetworkInterface](
	func() ([]table.Header, error) {
		return networkInterfaceHeaders, nil
	},
	func(networkInterface *ori.NetworkInterface) ([]table.Row, error) {
		return []table.Row{
			{
				networkInterface.Metadata.Id,
				networkInterface.Spec.Network.Handle,
				strings.Join(networkInterface.Spec.Ips, ","),
				networkInterface.Spec.GetVirtualIp().GetIp(),
				duration.HumanDuration(time.Since(time.Unix(0, networkInterface.Metadata.CreatedAt))),
			},
		}, nil
	},
)
View Source
var Volume, VolumeSlice = tableconverter.ForType[*ori.Volume](
	func() ([]table.Header, error) {
		return volumeHeaders, nil
	},
	func(volume *ori.Volume) ([]table.Row, error) {
		return []table.Row{
			{
				volume.Metadata.Id,
				volume.Spec.Driver,
				volume.Spec.Handle,
				duration.HumanDuration(time.Since(time.Unix(0, volume.Metadata.CreatedAt))),
			},
		}, nil
	},
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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