Project

General

Profile

Revision 3db6ac28

Added by Martin Bacovsky about 8 years ago

Fixed #9690 - filter tags by content views end envs

- dependency on hammer_cli_katello introduced for image and tag commands

View differences:

lib/hammer_cli_foreman_docker/docker_image.rb
1
module HammerCLIForemanDocker
2
  class DockerImageCommand < HammerCLIForeman::Command
3
    resource :docker_images
4
    command_name 'image'
5
    desc _('Manage docker images')
1
begin
2
  require 'hammer_cli_katello'
6 3

  
7
    class ListCommand < HammerCLIForeman::ListCommand
8
      output do
9
        field :id, _("ID")
10
        field :image_id, _("Image ID")
11
        field :size, _("Size")
12
      end
4
  module HammerCLIForemanDocker
5
    class DockerImageCommand < HammerCLIForeman::Command
6
      resource :docker_images
7
      command_name 'image'
8
      desc _('Manage docker images')
9

  
10
      class ListCommand < HammerCLIKatello::ListCommand
11
        include ::HammerCLIKatello::LifecycleEnvironmentNameResolvable
12
        output do
13
          field :id, _("ID")
14
          field :image_id, _("Image ID")
15
          field :size, _("Size")
16
        end
13 17

  
14
      build_options do |o|
15
        o.expand.including(:products, :organizations, :content_views)
18
        build_options do |o|
19
          o.expand.including(:products, :organizations, :content_views)
20
        end
16 21
      end
17
    end
18 22

  
19
    class InfoCommand < HammerCLIForeman::InfoCommand
20
      output do
21
        field :id, _("ID")
22
        field :image_id, _("Image ID")
23
        field :size, _("Size")
23
      class InfoCommand < HammerCLIKatello::InfoCommand
24
        output do
25
          field :id, _("ID")
26
          field :image_id, _("Image ID")
27
          field :size, _("Size")
24 28

  
25
        collection :tags, _("Tags") do
26
          field :repository_id, _("Repository ID")
27
          field :tag, _("Tag")
29
          collection :tags, _("Tags") do
30
            field :repository_id, _("Repository ID")
31
            field :tag, _("Tag")
32
          end
28 33
        end
34

  
35
        build_options
29 36
      end
30 37

  
31
      build_options
38
      autoload_subcommands
32 39
    end
33

  
34
    autoload_subcommands
35 40
  end
41
rescue LoadError
42
  warn _("'hammer_cli_katello' needs to be installed for %s command to work") % 'image'
36 43
end
lib/hammer_cli_foreman_docker/docker_tag.rb
1
module HammerCLIForemanDocker
2
  class DockerTagCommand < HammerCLIForeman::Command
3
    resource :docker_tags
4
    command_name 'tag'
5
    desc _('Manage docker tags')
1
begin
2
  require 'hammer_cli_katello'
6 3

  
7
    class ListCommand < HammerCLIForeman::ListCommand
8
      output do
9
        field :id, _("ID")
10
        field :tag, _("Tag")
11
        field :repository_id, _("Repository ID")
12
      end
4
  module HammerCLIForemanDocker
5
    class DockerTagCommand < HammerCLIForeman::Command
6
      resource :docker_tags
7
      command_name 'tag'
8
      desc _('Manage docker tags')
9

  
10
      class ListCommand < HammerCLIKatello::ListCommand
11
        include ::HammerCLIKatello::LifecycleEnvironmentNameResolvable
12
        output do
13
          field :id, _("ID")
14
          field :tag, _("Tag")
15
          field :repository_id, _("Repository ID")
16
        end
13 17

  
14
      build_options do |o|
15
        o.expand.including(:products, :organizations, :content_views)
18
        build_options do |o|
19
          o.expand.including(:products, :organizations, :content_views)
20
        end
16 21
      end
17
    end
18 22

  
19
    class InfoCommand < HammerCLIForeman::InfoCommand
20
      output do
21
        field :id, _("ID")
22
        field :tag, _("Tag")
23
        field :repository_id, _("Repository ID")
23
      class InfoCommand < HammerCLIKatello::InfoCommand
24
        output do
25
          field :id, _("ID")
26
          field :tag, _("Tag")
27
          field :repository_id, _("Repository ID")
24 28

  
25
        from :image do
26
          field :id, _("Docker Image ID")
29
          from :image do
30
            field :id, _("Docker Image ID")
31
          end
27 32
        end
33

  
34
        build_options
28 35
      end
29 36

  
30
      build_options
37
      autoload_subcommands
31 38
    end
32

  
33
    autoload_subcommands
34 39
  end
40
rescue LoadError
41
  warn _("'hammer_cli_katello' needs to be installed for %s command to work") % 'tag'
35 42
end

Also available in: Unified diff