Class: OCI::CloudBridge::Models::AwsEbsProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_bridge/models/aws_ebs_properties.rb

Overview

AWS EBS volume related properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AwsEbsProperties

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 110

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.attachments = attributes[:'attachments'] if attributes[:'attachments']

  self.availability_zone = attributes[:'availabilityZone'] if attributes[:'availabilityZone']

  raise 'You cannot provide both :availabilityZone and :availability_zone' if attributes.key?(:'availabilityZone') && attributes.key?(:'availability_zone')

  self.availability_zone = attributes[:'availability_zone'] if attributes[:'availability_zone']

  self.is_encrypted = attributes[:'isEncrypted'] unless attributes[:'isEncrypted'].nil?

  raise 'You cannot provide both :isEncrypted and :is_encrypted' if attributes.key?(:'isEncrypted') && attributes.key?(:'is_encrypted')

  self.is_encrypted = attributes[:'is_encrypted'] unless attributes[:'is_encrypted'].nil?

  self.iops = attributes[:'iops'] if attributes[:'iops']

  self.is_multi_attach_enabled = attributes[:'isMultiAttachEnabled'] unless attributes[:'isMultiAttachEnabled'].nil?

  raise 'You cannot provide both :isMultiAttachEnabled and :is_multi_attach_enabled' if attributes.key?(:'isMultiAttachEnabled') && attributes.key?(:'is_multi_attach_enabled')

  self.is_multi_attach_enabled = attributes[:'is_multi_attach_enabled'] unless attributes[:'is_multi_attach_enabled'].nil?

  self.size_in_gi_bs = attributes[:'sizeInGiBs'] if attributes[:'sizeInGiBs']

  raise 'You cannot provide both :sizeInGiBs and :size_in_gi_bs' if attributes.key?(:'sizeInGiBs') && attributes.key?(:'size_in_gi_bs')

  self.size_in_gi_bs = attributes[:'size_in_gi_bs'] if attributes[:'size_in_gi_bs']

  self.status = attributes[:'status'] if attributes[:'status']

  self.tags = attributes[:'tags'] if attributes[:'tags']

  self.throughput = attributes[:'throughput'] if attributes[:'throughput']

  self.volume_key = attributes[:'volumeKey'] if attributes[:'volumeKey']

  raise 'You cannot provide both :volumeKey and :volume_key' if attributes.key?(:'volumeKey') && attributes.key?(:'volume_key')

  self.volume_key = attributes[:'volume_key'] if attributes[:'volume_key']

  self.volume_type = attributes[:'volumeType'] if attributes[:'volumeType']

  raise 'You cannot provide both :volumeType and :volume_type' if attributes.key?(:'volumeType') && attributes.key?(:'volume_type')

  self.volume_type = attributes[:'volume_type'] if attributes[:'volume_type']
end

Instance Attribute Details

#attachmentsArray<OCI::CloudBridge::Models::VolumeAttachment>

Information about the volume attachments.



13
14
15
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 13

def attachments
  @attachments
end

#availability_zoneString

The Availability Zone for the volume.

Returns:

  • (String)


17
18
19
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 17

def availability_zone
  @availability_zone
end

#iopsInteger

The number of I/O operations per second.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 25

def iops
  @iops
end

#is_encryptedBOOLEAN

[Required] Indicates whether the volume is encrypted.

Returns:

  • (BOOLEAN)


21
22
23
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 21

def is_encrypted
  @is_encrypted
end

#is_multi_attach_enabledBOOLEAN

[Required] Indicates whether Amazon EBS Multi-Attach is enabled.

Returns:

  • (BOOLEAN)


29
30
31
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 29

def is_multi_attach_enabled
  @is_multi_attach_enabled
end

#size_in_gi_bsInteger

[Required] The size of the volume, in GiBs.

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 33

def size_in_gi_bs
  @size_in_gi_bs
end

#statusString

The volume state.

Returns:

  • (String)


37
38
39
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 37

def status
  @status
end

#tagsArray<OCI::CloudBridge::Models::Tag>

Any tags assigned to the volume.

Returns:



41
42
43
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 41

def tags
  @tags
end

#throughputInteger

The throughput that the volume supports, in MiB/s.

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 45

def throughput
  @throughput
end

#volume_keyString

[Required] The ID of the volume.

Returns:

  • (String)


49
50
51
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 49

def volume_key
  @volume_key
end

#volume_typeString

[Required] The volume type.

Returns:

  • (String)


53
54
55
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 53

def volume_type
  @volume_type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'attachments': :'attachments',
    'availability_zone': :'availabilityZone',
    'is_encrypted': :'isEncrypted',
    'iops': :'iops',
    'is_multi_attach_enabled': :'isMultiAttachEnabled',
    'size_in_gi_bs': :'sizeInGiBs',
    'status': :'status',
    'tags': :'tags',
    'throughput': :'throughput',
    'volume_key': :'volumeKey',
    'volume_type': :'volumeType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'attachments': :'Array<OCI::CloudBridge::Models::VolumeAttachment>',
    'availability_zone': :'String',
    'is_encrypted': :'BOOLEAN',
    'iops': :'Integer',
    'is_multi_attach_enabled': :'BOOLEAN',
    'size_in_gi_bs': :'Integer',
    'status': :'String',
    'tags': :'Array<OCI::CloudBridge::Models::Tag>',
    'throughput': :'Integer',
    'volume_key': :'String',
    'volume_type': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 170

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    attachments == other.attachments &&
    availability_zone == other.availability_zone &&
    is_encrypted == other.is_encrypted &&
    iops == other.iops &&
    is_multi_attach_enabled == other.is_multi_attach_enabled &&
    size_in_gi_bs == other.size_in_gi_bs &&
    status == other.status &&
    tags == other.tags &&
    throughput == other.throughput &&
    volume_key == other.volume_key &&
    volume_type == other.volume_type
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 210

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


190
191
192
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 190

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



199
200
201
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 199

def hash
  [attachments, availability_zone, is_encrypted, iops, is_multi_attach_enabled, size_in_gi_bs, status, tags, throughput, volume_key, volume_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 243

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



237
238
239
# File 'lib/oci/cloud_bridge/models/aws_ebs_properties.rb', line 237

def to_s
  to_hash.to_s
end