Class: OCI::ContainerInstances::Models::CreateContainerOciFssVolumeDetails

Inherits:
CreateContainerVolumeDetails show all
Defined in:
lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb

Overview

An OCI File Storage Service (FSS) File System that can be mounted to Containers within a Container Instance. Check docs.oracle.com/en-us/iaas/api/#/en/filestorage/20171215/FileSystem for more details.

Constant Summary

Constants inherited from CreateContainerVolumeDetails

OCI::ContainerInstances::Models::CreateContainerVolumeDetails::VOLUME_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from CreateContainerVolumeDetails

#name, #volume_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateContainerVolumeDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateContainerOciFssVolumeDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 76

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

  attributes['volumeType'] = 'OCI_FSS_FILE_SYSTEM'

  super(attributes)

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

  self.mount_target = attributes[:'mountTarget'] if attributes[:'mountTarget']

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

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

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

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

  self.mount_command = attributes[:'mountCommand'] if attributes[:'mountCommand']

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

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

  self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']

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

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

Instance Attribute Details

#exportOCI::ContainerInstances::Models::CreateOciFssExportDetails

This attribute is required.



20
21
22
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 20

def export
  @export
end

#mount_commandOCI::ContainerInstances::Models::CreateOciFssMountCommandDetails



26
27
28
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 26

def mount_command
  @mount_command
end

#mount_targetOCI::ContainerInstances::Models::CreateOciFssMountTargetDetails

This attribute is required.



16
17
18
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 16

def mount_target
  @mount_target
end

#securityOCI::ContainerInstances::Models::CreateOciFssSecurityDetails



23
24
25
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 23

def security
  @security
end

#subnet_idString

Specifies the network interface to be used for the OCI File Storage Service (FSS) volume. This is a required parameter when a Container Instance is attached to more than one subnets.

Returns:

  • (String)


32
33
34
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 32

def subnet_id
  @subnet_id
end

Class Method Details

.attribute_mapObject

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



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 35

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'volume_type': :'volumeType',
    'mount_target': :'mountTarget',
    'export': :'export',
    'security': :'security',
    'mount_command': :'mountCommand',
    'subnet_id': :'subnetId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 50

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'volume_type': :'String',
    'mount_target': :'OCI::ContainerInstances::Models::CreateOciFssMountTargetDetails',
    'export': :'OCI::ContainerInstances::Models::CreateOciFssExportDetails',
    'security': :'OCI::ContainerInstances::Models::CreateOciFssSecurityDetails',
    'mount_command': :'OCI::ContainerInstances::Models::CreateOciFssMountCommandDetails',
    'subnet_id': :'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



116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 116

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

  self.class == other.class &&
    name == other.name &&
    volume_type == other.volume_type &&
    mount_target == other.mount_target &&
    export == other.export &&
    security == other.security &&
    mount_command == other.mount_command &&
    subnet_id == other.subnet_id
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



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 152

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


132
133
134
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 132

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



141
142
143
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 141

def hash
  [name, volume_type, mount_target, export, security, mount_command, subnet_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 185

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



179
180
181
# File 'lib/oci/container_instances/models/create_container_oci_fss_volume_details.rb', line 179

def to_s
  to_hash.to_s
end