Esempio n. 1
0
func fetch(cmd *cobra.Command, specs []string) {
	c := cli.NewClient(getServerURL())
	if len(specs) == 0 {
		specs = cli.Read(os.Stdin)
	}
	for _, spec := range specs {
		cli.AssertSpec(spec)
		image, _ := c.Post("image", "images", spec)
		cli.JMap(image).Print(jsonout)
	}
}
Esempio n. 2
0
func del(cmd *cobra.Command, ids []string) {
	c := cli.NewClient(getServerURL())
	if len(ids) == 0 {
		ids = cli.Read(os.Stdin)
	}

	for _, id := range ids {
		cli.AssertID(id)
		image, _ := c.Delete("image", "images/"+id)
		cli.JMap(image).Print(jsonout)
	}
}