knife-elb 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.rdoc +1 -0
- data/lib/chef/knife/elb_instance_add.rb +1 -1
- data/lib/chef/knife/elb_instance_delete.rb +1 -0
- data/lib/chef/knife/elb_list.rb +17 -9
- data/lib/chef/knife/elb_show.rb +1 -2
- data/lib/knife-elb/version.rb +1 -1
- metadata +3 -4
- data/lib/chef/knife/elb_create.rb +0 -36
- data/lib/chef/knife/elb_delete.rb +0 -36
    
        data/.gitignore
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            pkg
         | 
    
        data/README.rdoc
    CHANGED
    
    
    
        data/lib/chef/knife/elb_list.rb
    CHANGED
    
    | @@ -35,7 +35,8 @@ class Chef | |
| 35 35 | 
             
                    elb_list = [
         | 
| 36 36 | 
             
                      ui.color('ELB Id', :bold),
         | 
| 37 37 | 
             
                      ui.color('DNS', :bold),
         | 
| 38 | 
            -
                      ui.color(' | 
| 38 | 
            +
                      ui.color('Total instances', :bold),
         | 
| 39 | 
            +
                      ui.color('Active instances', :bold),
         | 
| 39 40 | 
             
                      ui.color('Created At', :bold),
         | 
| 40 41 | 
             
                      ui.color('Zones', :bold)
         | 
| 41 42 | 
             
                    ].flatten.compact
         | 
| @@ -43,16 +44,23 @@ class Chef | |
| 43 44 | 
             
                    output_column_count = elb_list.length
         | 
| 44 45 |  | 
| 45 46 | 
             
                    connection.load_balancers.each do |elb|
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                      total_instances = elb.instances.size
         | 
| 49 | 
            +
                      instances_in_service = elb.instances_in_service.size
         | 
| 50 | 
            +
             | 
| 46 51 | 
             
                      elb_list << elb.id.to_s
         | 
| 47 52 | 
             
                      elb_list << elb.dns_name
         | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 53 | 
            +
             | 
| 54 | 
            +
                      elb_list << if total_instances == 0
         | 
| 55 | 
            +
                                    ui.color(total_instances.to_s, :red)
         | 
| 56 | 
            +
                                  else
         | 
| 57 | 
            +
                                    ui.color(total_instances.to_s, :green)
         | 
| 58 | 
            +
                                  end
         | 
| 59 | 
            +
                      elb_list << if (instances_in_service  != total_instances)
         | 
| 60 | 
            +
                                    ui.color(instances_in_service.to_s, :red)
         | 
| 61 | 
            +
                                  else
         | 
| 62 | 
            +
                                    ui.color(instances_in_service.to_s, :green)
         | 
| 63 | 
            +
                                  end
         | 
| 56 64 | 
             
                      elb_list << elb.created_at.to_s
         | 
| 57 65 | 
             
                      elb_list << elb.availability_zones.join(',')
         | 
| 58 66 | 
             
                    end
         | 
    
        data/lib/chef/knife/elb_show.rb
    CHANGED
    
    | @@ -19,7 +19,6 @@ | |
| 19 19 |  | 
| 20 20 | 
             
            require 'chef/knife'
         | 
| 21 21 | 
             
            require 'chef/knife/elb_base'
         | 
| 22 | 
            -
            require 'json'
         | 
| 23 22 |  | 
| 24 23 | 
             
            class Chef
         | 
| 25 24 | 
             
              class Knife
         | 
| @@ -39,7 +38,7 @@ class Chef | |
| 39 38 | 
             
                      ui.error("No load balancer with id  #{@name_args.first} found")
         | 
| 40 39 | 
             
                      exit 1
         | 
| 41 40 | 
             
                    end
         | 
| 42 | 
            -
                    ui.output( | 
| 41 | 
            +
                    ui.output(Chef::JSONCompat.from_json(elbs.first.to_json))
         | 
| 43 42 | 
             
                  end  
         | 
| 44 43 | 
             
                end
         | 
| 45 44 | 
             
              end
         | 
    
        data/lib/knife-elb/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: knife-elb
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2013-03- | 
| 12 | 
            +
            date: 2013-03-10 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: knife-ec2
         | 
| @@ -100,13 +100,12 @@ extra_rdoc_files: | |
| 100 100 | 
             
            - README.rdoc
         | 
| 101 101 | 
             
            - LICENSE
         | 
| 102 102 | 
             
            files:
         | 
| 103 | 
            +
            - .gitignore
         | 
| 103 104 | 
             
            - LICENSE
         | 
| 104 105 | 
             
            - README.rdoc
         | 
| 105 106 | 
             
            - Rakefile
         | 
| 106 107 | 
             
            - knife-elb.gemspec
         | 
| 107 108 | 
             
            - lib/chef/knife/elb_base.rb
         | 
| 108 | 
            -
            - lib/chef/knife/elb_create.rb
         | 
| 109 | 
            -
            - lib/chef/knife/elb_delete.rb
         | 
| 110 109 | 
             
            - lib/chef/knife/elb_instance_add.rb
         | 
| 111 110 | 
             
            - lib/chef/knife/elb_instance_delete.rb
         | 
| 112 111 | 
             
            - lib/chef/knife/elb_list.rb
         | 
| @@ -1,36 +0,0 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            #
         | 
| 3 | 
            -
            # Author:: Ranjib Dey (<dey.ranjib@gmail.com>)
         | 
| 4 | 
            -
            # Copyright:: Copyright (c) 2013 Ranjib Dey.
         | 
| 5 | 
            -
            # License:: Apache License, Version 2.0
         | 
| 6 | 
            -
            #
         | 
| 7 | 
            -
            # Licensed under the Apache License, Version 2.0 (the "License");
         | 
| 8 | 
            -
            # you may not use this file except in compliance with the License.
         | 
| 9 | 
            -
            # You may obtain a copy of the License at
         | 
| 10 | 
            -
            #
         | 
| 11 | 
            -
            #     http://www.apache.org/licenses/LICENSE-2.0
         | 
| 12 | 
            -
            #
         | 
| 13 | 
            -
            # Unless required by applicable law or agreed to in writing, software
         | 
| 14 | 
            -
            # distributed under the License is distributed on an "AS IS" BASIS,
         | 
| 15 | 
            -
            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         | 
| 16 | 
            -
            # See the License for the specific language governing permissions and
         | 
| 17 | 
            -
            # limitations under the License.
         | 
| 18 | 
            -
            #
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            require 'chef/knife'
         | 
| 21 | 
            -
            require 'chef/knife/elb_base'
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            class Chef
         | 
| 24 | 
            -
              class Knife
         | 
| 25 | 
            -
                class ElbCreate < Knife
         | 
| 26 | 
            -
                  
         | 
| 27 | 
            -
                  include  Knife::ElbBase
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                  banner "knife elb create"
         | 
| 30 | 
            -
             | 
| 31 | 
            -
                  def run
         | 
| 32 | 
            -
                  end  
         | 
| 33 | 
            -
                end
         | 
| 34 | 
            -
              end
         | 
| 35 | 
            -
            end
         | 
| 36 | 
            -
             | 
| @@ -1,36 +0,0 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            #
         | 
| 3 | 
            -
            # Author:: Ranjib Dey (<dey.ranjib@gmail.com>)
         | 
| 4 | 
            -
            # Copyright:: Copyright (c) 2013 Ranjib Dey.
         | 
| 5 | 
            -
            # License:: Apache License, Version 2.0
         | 
| 6 | 
            -
            #
         | 
| 7 | 
            -
            # Licensed under the Apache License, Version 2.0 (the "License");
         | 
| 8 | 
            -
            # you may not use this file except in compliance with the License.
         | 
| 9 | 
            -
            # You may obtain a copy of the License at
         | 
| 10 | 
            -
            #
         | 
| 11 | 
            -
            #     http://www.apache.org/licenses/LICENSE-2.0
         | 
| 12 | 
            -
            #
         | 
| 13 | 
            -
            # Unless required by applicable law or agreed to in writing, software
         | 
| 14 | 
            -
            # distributed under the License is distributed on an "AS IS" BASIS,
         | 
| 15 | 
            -
            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         | 
| 16 | 
            -
            # See the License for the specific language governing permissions and
         | 
| 17 | 
            -
            # limitations under the License.
         | 
| 18 | 
            -
            #
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            require 'chef/knife'
         | 
| 21 | 
            -
            require 'chef/knife/elb_base'
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            class Chef
         | 
| 24 | 
            -
              class Knife
         | 
| 25 | 
            -
                class ElbDelete < Knife
         | 
| 26 | 
            -
                  
         | 
| 27 | 
            -
                  include  Knife::ElbBase
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                  banner "knife elb delete"
         | 
| 30 | 
            -
             | 
| 31 | 
            -
                  def run
         | 
| 32 | 
            -
                  end  
         | 
| 33 | 
            -
                end
         | 
| 34 | 
            -
              end
         | 
| 35 | 
            -
            end
         | 
| 36 | 
            -
             |