Class: OCI::FileStorage::Models::ClientOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/file_storage/models/client_options.rb

Overview

NFS export options applied to a specified set of clients. Only governs access through the associated export. Access to the same file system through a different export (on the same or different mount target) will be governed by that export’s export options.

Constant Summary collapse

ACCESS_ENUM =

rubocop:disable Metrics/LineLength

[
  ACCESS_READ_WRITE = 'READ_WRITE'.freeze,
  ACCESS_READ_ONLY = 'READ_ONLY'.freeze,
  ACCESS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
IDENTITY_SQUASH_ENUM =
[
  IDENTITY_SQUASH_NONE = 'NONE'.freeze,
  IDENTITY_SQUASH_ROOT = 'ROOT'.freeze,
  IDENTITY_SQUASH_ALL = 'ALL'.freeze,
  IDENTITY_SQUASH_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ClientOptions

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :source (String)

    The value to assign to the #source property

  • :require_privileged_source_port (BOOLEAN)

    The value to assign to the #require_privileged_source_port property

  • :access (String)

    The value to assign to the #access property

  • :identity_squash (String)

    The value to assign to the #identity_squash property

  • :anonymous_uid (Integer)

    The value to assign to the #anonymous_uid property

  • :anonymous_gid (Integer)

    The value to assign to the #anonymous_gid property



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
# File 'lib/oci/file_storage/models/client_options.rb', line 115

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.source = attributes[:'source'] if attributes[:'source']

  self.require_privileged_source_port = attributes[:'requirePrivilegedSourcePort'] unless attributes[:'requirePrivilegedSourcePort'].nil?

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

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

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

  self.identity_squash = attributes[:'identitySquash'] if attributes[:'identitySquash']

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

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

  self.anonymous_uid = attributes[:'anonymousUid'] if attributes[:'anonymousUid']

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

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

  self.anonymous_gid = attributes[:'anonymousGid'] if attributes[:'anonymousGid']

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

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

Instance Attribute Details

#accessString

Type of access to grant clients using the file system through this export. If unspecified defaults to ‘READ_ONLY`.

Returns:

  • (String)


49
50
51
# File 'lib/oci/file_storage/models/client_options.rb', line 49

def access
  @access
end

#anonymous_gidInteger

GID value to remap to when squashing a client GID (see identitySquash for more details.) If unspecified defaults to ‘65534`.

Returns:

  • (Integer)


73
74
75
# File 'lib/oci/file_storage/models/client_options.rb', line 73

def anonymous_gid
  @anonymous_gid
end

#anonymous_uidInteger

UID value to remap to when squashing a client UID (see identitySquash for more details.) If unspecified, defaults to ‘65534`.

Returns:

  • (Integer)


66
67
68
# File 'lib/oci/file_storage/models/client_options.rb', line 66

def anonymous_uid
  @anonymous_uid
end

#identity_squashString

Used when clients accessing the file system through this export have their UID and GID remapped to ‘anonymousUid’ and ‘anonymousGid’. If ‘ALL`, all users and groups are remapped; if `ROOT`, only the root user and group (UID/GID 0) are remapped; if `NONE`, no remapping is done. If unspecified, defaults to `ROOT`.

Returns:

  • (String)


59
60
61
# File 'lib/oci/file_storage/models/client_options.rb', line 59

def identity_squash
  @identity_squash
end

#require_privileged_source_portBOOLEAN

If ‘true`, clients accessing the file system through this export must connect from a privileged source port. If unspecified, defaults to `true`.

Returns:

  • (BOOLEAN)


43
44
45
# File 'lib/oci/file_storage/models/client_options.rb', line 43

def require_privileged_source_port
  @require_privileged_source_port
end

#sourceString

[Required] Clients these options should apply to. Must be a either single IPv4 address or single IPv4 CIDR block.

Note: Access will also be limited by any applicable VCN security rules and the ability to route IP packets to the mount target. Mount targets do not have Internet-routable IP addresses.

Returns:

  • (String)


36
37
38
# File 'lib/oci/file_storage/models/client_options.rb', line 36

def source
  @source
end

Class Method Details

.attribute_mapObject

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



76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/file_storage/models/client_options.rb', line 76

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'source': :'source',
    'require_privileged_source_port': :'requirePrivilegedSourcePort',
    'access': :'access',
    'identity_squash': :'identitySquash',
    'anonymous_uid': :'anonymousUid',
    'anonymous_gid': :'anonymousGid'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/file_storage/models/client_options.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'source': :'String',
    'require_privileged_source_port': :'BOOLEAN',
    'access': :'String',
    'identity_squash': :'String',
    'anonymous_uid': :'Integer',
    'anonymous_gid': :'Integer'
    # 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



187
188
189
190
191
192
193
194
195
196
197
# File 'lib/oci/file_storage/models/client_options.rb', line 187

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

  self.class == other.class &&
    source == other.source &&
    require_privileged_source_port == other.require_privileged_source_port &&
    access == other.access &&
    identity_squash == other.identity_squash &&
    anonymous_uid == other.anonymous_uid &&
    anonymous_gid == other.anonymous_gid
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



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/oci/file_storage/models/client_options.rb', line 222

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


202
203
204
# File 'lib/oci/file_storage/models/client_options.rb', line 202

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



211
212
213
# File 'lib/oci/file_storage/models/client_options.rb', line 211

def hash
  [source, require_privileged_source_port, access, identity_squash, anonymous_uid, anonymous_gid].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



255
256
257
258
259
260
261
262
263
264
# File 'lib/oci/file_storage/models/client_options.rb', line 255

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



249
250
251
# File 'lib/oci/file_storage/models/client_options.rb', line 249

def to_s
  to_hash.to_s
end