mirror of https://github.com/containers/podman.git
add additional fields to podman machine ls --json
[NO NEW TESTS NEEDED] Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
3404ad042d
commit
6e208c2226
|
@ -44,16 +44,19 @@ type listFlagType struct {
|
|||
}
|
||||
|
||||
type machineReporter struct {
|
||||
Name string
|
||||
Default bool
|
||||
Created string
|
||||
Running bool
|
||||
LastUp string
|
||||
Stream string
|
||||
VMType string
|
||||
CPUs uint64
|
||||
Memory string
|
||||
DiskSize string
|
||||
Name string
|
||||
Default bool
|
||||
Created string
|
||||
Running bool
|
||||
LastUp string
|
||||
Stream string
|
||||
VMType string
|
||||
CPUs uint64
|
||||
Memory string
|
||||
DiskSize string
|
||||
Port int
|
||||
RemoteUsername string
|
||||
IdentityPath string
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -190,6 +193,9 @@ func toMachineFormat(vms []*machine.ListResponse) ([]*machineReporter, error) {
|
|||
response.CPUs = vm.CPUs
|
||||
response.Memory = strUint(vm.Memory)
|
||||
response.DiskSize = strUint(vm.DiskSize)
|
||||
response.Port = vm.Port
|
||||
response.RemoteUsername = vm.RemoteUsername
|
||||
response.IdentityPath = vm.IdentityPath
|
||||
|
||||
machineResponses = append(machineResponses, response)
|
||||
}
|
||||
|
|
|
@ -37,6 +37,9 @@ Valid placeholders for the Go template are listed below:
|
|||
| .Running | Is machine running |
|
||||
| .Stream | Stream name |
|
||||
| .VMType | VM type |
|
||||
| .Port | SSH Port to use to connect to VM|
|
||||
| .RemoteUsername | VM Username for rootless Podman |
|
||||
| .IdentityPath | Path to ssh identify file |
|
||||
|
||||
#### **--help**
|
||||
|
||||
|
|
|
@ -66,15 +66,18 @@ type Download struct {
|
|||
type ListOptions struct{}
|
||||
|
||||
type ListResponse struct {
|
||||
Name string
|
||||
CreatedAt time.Time
|
||||
LastUp time.Time
|
||||
Running bool
|
||||
Stream string
|
||||
VMType string
|
||||
CPUs uint64
|
||||
Memory uint64
|
||||
DiskSize uint64
|
||||
Name string
|
||||
CreatedAt time.Time
|
||||
LastUp time.Time
|
||||
Running bool
|
||||
Stream string
|
||||
VMType string
|
||||
CPUs uint64
|
||||
Memory uint64
|
||||
DiskSize uint64
|
||||
Port int
|
||||
RemoteUsername string
|
||||
IdentityPath string
|
||||
}
|
||||
|
||||
type SSHOptions struct {
|
||||
|
|
|
@ -696,6 +696,9 @@ func GetVMInfos() ([]*machine.ListResponse, error) {
|
|||
listEntry.CPUs = vm.CPUs
|
||||
listEntry.Memory = vm.Memory * units.MiB
|
||||
listEntry.DiskSize = vm.DiskSize * units.GiB
|
||||
listEntry.Port = vm.Port
|
||||
listEntry.RemoteUsername = vm.RemoteUsername
|
||||
listEntry.IdentityPath = vm.IdentityPath
|
||||
fi, err := os.Stat(fullPath)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue