Sha256: 749a7a59f1ab2645f5b571f2fa551c034752ae2dd2c05d9a65c181a8092c6c73
Contents?: true
Size: 1.49 KB
Versions: 6
Compression:
Stored size: 1.49 KB
Contents
module Brightbox class DetailedServer < Server def to_row row_attributes = attributes if server_type row_attributes[:type] = server_type['id'] row_attributes[:type_handle] = server_type['handle'] row_attributes[:type_name] = server_type['name'] row_attributes[:ram] = server_type['ram'] row_attributes[:cores] = server_type['cores'] row_attributes[:disk] = server_type['disk_size'].to_i end if image row_attributes[:image_name] = image.name row_attributes[:arch] = image.arch end row_attributes[:private_ips] = interfaces.collect { |i| i['ipv4_address'] }.join(", ") row_attributes[:ipv6_address] = interfaces.collect { |i| i['ipv6_address'] }.join(", ") row_attributes[:cloud_ip_ids] = cloud_ips.collect { |i| i['id'] }.join(", ") row_attributes[:cloud_ips] = cloud_ips.collect { |i| i['public_ip'] }.join(", ") row_attributes[:snapshots] = snapshots.collect { |i| i['id'] }.join(", ") if server_groups row_attributes[:server_groups] = server_groups.map { |sg| sg['id']}.join(", ") end row_attributes end def self.default_field_order [:id, :status, :name, :created_at, :deleted_at, :zone, :type, :type_name, :type_handle, :ram, :cores, :disk, :image, :image_name, :private_ips, :cloud_ips, :ipv6_address, :cloud_ip_ids, :hostname, :public_hostname, :ipv6_hostname, :snapshots, :server_groups ] end end end
Version data entries
6 entries across 6 versions & 1 rubygems