Class: Cumulus::EC2::VolumeGroup

Inherits:
Struct
  • Object
show all
Defined in:
lib/ec2/models/EbsGroupConfig.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



9
10
11
# File 'lib/ec2/models/EbsGroupConfig.rb', line 9

def count
  @count
end

#encryptedObject

Returns the value of attribute encrypted

Returns:

  • (Object)

    the current value of encrypted



9
10
11
# File 'lib/ec2/models/EbsGroupConfig.rb', line 9

def encrypted
  @encrypted
end

#iopsObject

Returns the value of attribute iops

Returns:

  • (Object)

    the current value of iops



9
10
11
# File 'lib/ec2/models/EbsGroupConfig.rb', line 9

def iops
  @iops
end

#kms_keyObject

Returns the value of attribute kms_key

Returns:

  • (Object)

    the current value of kms_key



9
10
11
# File 'lib/ec2/models/EbsGroupConfig.rb', line 9

def kms_key
  @kms_key
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



9
10
11
# File 'lib/ec2/models/EbsGroupConfig.rb', line 9

def size
  @size
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



9
10
11
# File 'lib/ec2/models/EbsGroupConfig.rb', line 9

def type
  @type
end

Instance Method Details

#descriptionObject



21
22
23
24
25
26
27
28
29
# File 'lib/ec2/models/EbsGroupConfig.rb', line 21

def description
  [
    "#{self.size}GiB",
    "#{self.type}",
    if self.type == "io1" then "#{self.iops} IOPS" end,
    if self.encrypted then "encrypted" else "unencrypted" end,
    if self.kms_key then "KMS #{self.kms_key}" end,
  ].reject(&:nil?).join("/")
end

#hash_keyObject



31
32
33
# File 'lib/ec2/models/EbsGroupConfig.rb', line 31

def hash_key
  "#{self.size}|#{self.type}|#{self.iops}|#{self.encrypted}|#{self.kms_key}"
end

#to_hashObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/ec2/models/EbsGroupConfig.rb', line 10

def to_hash
  {
    "size" => self.size,
    "type" => self.type,
    "iops" => self.iops,
    "count" => self.count,
    "encrypted" => self.encrypted,
    "kms-key" => self.kms_key
  }.reject { |k, v| v.nil? }
end