1
// Copyright 2015 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
9
"github.com/juju/juju/api/imagemanager"
10
"github.com/juju/juju/cmd/envcmd"
13
const cachedimagesCommandDoc = `
14
"juju cached-images" is used to manage the cached os images in
18
const cachedImagesCommandPurpose = "manage cached os images"
20
// NewSuperCommand creates the user supercommand and registers the subcommands
22
func NewSuperCommand() cmd.Command {
23
usercmd := cmd.NewSuperCommand(cmd.SuperCommandParams{
24
Name: "cached-images",
25
Doc: cachedimagesCommandDoc,
27
Purpose: cachedImagesCommandPurpose,
29
usercmd.Register(envcmd.Wrap(&DeleteCommand{}))
30
usercmd.Register(envcmd.Wrap(&ListCommand{}))
34
// CachedImagesCommandBase is a helper base structure that has a method to get the
35
// image manager client.
36
type CachedImagesCommandBase struct {
40
// NewImagesManagerClient returns a imagemanager client for the root api endpoint
41
// that the environment command returns.
42
func (c *CachedImagesCommandBase) NewImagesManagerClient() (*imagemanager.Client, error) {
43
root, err := c.NewAPIRoot()
47
return imagemanager.NewClient(root), nil