Class: OCI::LustreFileStorage::Models::RootSquashConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/lustre_file_storage/models/root_squash_configuration.rb

Overview

An administrative feature that allows you to restrict root level access from clients that try to access your Lustre file system as root.

Constant Summary collapse

IDENTITY_SQUASH_ENUM =
[
  IDENTITY_SQUASH_NONE = 'NONE'.freeze,
  IDENTITY_SQUASH_ROOT = 'ROOT'.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 = {}) ⇒ RootSquashConfiguration

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :identity_squash (String)

    The value to assign to the #identity_squash property

  • :squash_uid (Integer)

    The value to assign to the #squash_uid property

  • :squash_gid (Integer)

    The value to assign to the #squash_gid property

  • :client_exceptions (Array<String>)

    The value to assign to the #client_exceptions property



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
108
109
110
111
112
113
114
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 79

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.identity_squash = attributes[:'identitySquash'] if attributes[:'identitySquash']
  self.identity_squash = "NONE" if identity_squash.nil? && !attributes.key?(:'identitySquash') # rubocop:disable Style/StringLiterals

  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.identity_squash = "NONE" if identity_squash.nil? && !attributes.key?(:'identitySquash') && !attributes.key?(:'identity_squash') # rubocop:disable Style/StringLiterals

  self.squash_uid = attributes[:'squashUid'] if attributes[:'squashUid']
  self.squash_uid = 65534 if squash_uid.nil? && !attributes.key?(:'squashUid') # rubocop:disable Style/StringLiterals

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

  self.squash_uid = attributes[:'squash_uid'] if attributes[:'squash_uid']
  self.squash_uid = 65534 if squash_uid.nil? && !attributes.key?(:'squashUid') && !attributes.key?(:'squash_uid') # rubocop:disable Style/StringLiterals

  self.squash_gid = attributes[:'squashGid'] if attributes[:'squashGid']
  self.squash_gid = 65534 if squash_gid.nil? && !attributes.key?(:'squashGid') # rubocop:disable Style/StringLiterals

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

  self.squash_gid = attributes[:'squash_gid'] if attributes[:'squash_gid']
  self.squash_gid = 65534 if squash_gid.nil? && !attributes.key?(:'squashGid') && !attributes.key?(:'squash_gid') # rubocop:disable Style/StringLiterals

  self.client_exceptions = attributes[:'clientExceptions'] if attributes[:'clientExceptions']

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

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

Instance Attribute Details

#client_exceptionsArray<String>

A list of NIDs allowed with this lustre file system not to be squashed. A maximum of 10 is allowed.

Returns:

  • (Array<String>)


43
44
45
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 43

def client_exceptions
  @client_exceptions
end

#identity_squashString

Used when clients accessing the Lustre file system have their UID and GID remapped to squashUid and squashGid. If ROOT, only the root user and group (UID/GID 0) are remapped; if NONE, no remapping is done. If unspecified, defaults to NONE.

Returns:

  • (String)


23
24
25
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 23

def identity_squash
  @identity_squash
end

#squash_gidInteger

The GID value to remap to when squashing a client GID. See identitySquash for more details. If unspecified, defaults to 65534.

Returns:

  • (Integer)


37
38
39
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 37

def squash_gid
  @squash_gid
end

#squash_uidInteger

The UID value to remap to when squashing a client UID. See identitySquash for more details. If unspecified, defaults to 65534.

Returns:

  • (Integer)


30
31
32
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 30

def squash_uid
  @squash_uid
end

Class Method Details

.attribute_mapObject

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



46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 46

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'identity_squash': :'identitySquash',
    'squash_uid': :'squashUid',
    'squash_gid': :'squashGid',
    'client_exceptions': :'clientExceptions'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 58

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'identity_squash': :'String',
    'squash_uid': :'Integer',
    'squash_gid': :'Integer',
    'client_exceptions': :'Array<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



136
137
138
139
140
141
142
143
144
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 136

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

  self.class == other.class &&
    identity_squash == other.identity_squash &&
    squash_uid == other.squash_uid &&
    squash_gid == other.squash_gid &&
    client_exceptions == other.client_exceptions
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



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 169

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


149
150
151
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 149

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



158
159
160
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 158

def hash
  [identity_squash, squash_uid, squash_gid, client_exceptions].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 202

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



196
197
198
# File 'lib/oci/lustre_file_storage/models/root_squash_configuration.rb', line 196

def to_s
  to_hash.to_s
end