added cli command view containers and implementation also complete

This commit is contained in:
2021-06-09 23:59:46 +04:00
parent 8466e2d1ca
commit 14bceec3cc
4 changed files with 47 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ var CliAction = func(ctx *cli.Context) error {
p2p.PrintIpTable()
}
// Add provided IP to the IP table
if AddServer != "" {
res, err := p2p.ReadIpTable()
if err != nil {
@@ -52,6 +53,16 @@ var CliAction = func(ctx *cli.Context) error {
}
// Displays all images available on the server side
if ViewImages != "" {
imageRes, err := client.ViewContainers(ViewImages)
if err != nil {
fmt.Print(err)
}
client.PrettyPrint(imageRes)
}
// Function called to stop and remove server from Docker
if RemoveVM != "" && ID != "" {
err := client.RemoveContianer(RemoveVM,ID)