Methods
public instance
Public instance methods
authorize_networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 62 62: def authorize_networks; modify_group(:authorize); end
authorize_networks_valid?
()
[show source]
# File lib/rudy/cli/networks.rb, line 61 61: def authorize_networks_valid?; modify_group_valid?; end
create_networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 14 14: def create_networks 15: Rudy::Routines::Handlers::Group.create rescue nil 16: networks 17: end
destroy_networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 19 19: def destroy_networks 20: Rudy::Routines::Handlers::Group.destroy rescue nil 21: end
local_networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 28 28: def local_networks 29: ea = Rudy::Utils::external_ip_address || '' 30: ia = Rudy::Utils::internal_ip_address || '' 31: if @global.quiet 32: li ia unless @option.external && !@option.internal 33: li ea unless @option.internal && !@option.external 34: else 35: li "%10s: %s" % ['Internal', ia] unless @option.external && !@option.internal 36: li "%10s: %s" % ['External', ea] unless @option.internal && !@option.external 37: end 38: @global.quiet = true # don't print elapsed time 39: end
modify_group_valid?
()
[show source]
# File lib/rudy/cli/networks.rb, line 42 42: def modify_group_valid? 43: if @option.owner == 'self' 44: raise "AWS_ACCOUNT_NUMBER not set" unless @@global.accountnum 45: @option.owner = @@global.accountnum 46: end 47: 48: if (@option.addresses || @option.ports) && (@option.group || @option.owner) 49: raise Drydock::OptError.new('', @alias, "Cannot mix group and network authorization") 50: end 51: if @option.owner && !@option.group 52: raise Drydock::OptError.new('', @alias, "Must provide -g with -o") 53: end 54: 55: true 56: end
networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 7 7: def networks 8: name = current_group_name 9: Rudy::AWS::EC2::Groups.list(name).each do |group| 10: li @@global.verbose > 0 ? group.inspect : group.dump(@@global.format) 11: end 12: end
revoke_networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 59 59: def revoke_networks; modify_group(:revoke); end
revoke_networks_valid?
()
[show source]
# File lib/rudy/cli/networks.rb, line 58 58: def revoke_networks_valid?; modify_group_valid?; end
update_networks
()
[show source]
# File lib/rudy/cli/networks.rb, line 23 23: def update_networks 24: Rudy::Routines::Handlers::Group.authorize rescue nil 25: networks 26: end