Sha256: a5cc124a1b6625a36747ccf70ee5b4eba2a95d6d25f6de316f1a62ecf51f0dea

Contents?: true

Size: 749 Bytes

Versions: 27

Compression:

Stored size: 749 Bytes

Contents

class AffinityGroup < CloudstackCli::Base

  desc 'list', 'list affinity groups'
  option :account
  option :name
  option :type
  option :listall
  option :keyword
  def list
    resolve_account
    affinity_groups = client.list_affinity_groups(options)
    if affinity_groups.size < 1
      say "No affinity groups found."
    else
      table = [%w(Domain Account Name, Description, VMs)]
      affinity_groups.each do |group|
        table << [
          group['domain'], group['account'],
        	group['name'], group['description'],
          group['virtualmachineIds'] ? group['virtualmachineIds'].size : nil
        ]
      end
      print_table table
      say "Total number of affinity groups: #{affinity_groups.size}"
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cloudstack-cli-1.4.1 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.4.0 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.3.3 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.3.2 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.3.1 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.3.0 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.7 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.6 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.5 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.4 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.3 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.1 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.2.0 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.1.0 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.0.8 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.0.7 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.0.6 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.0.5 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.0.4 lib/cloudstack-cli/commands/affinity_group.rb
cloudstack-cli-1.0.3 lib/cloudstack-cli/commands/affinity_group.rb