Class: NutanixClustermgmt::ClustermgmtV40ConfigDiskAdvanceConfig

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb

Overview

A model that represents Disk advance configuration properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ ClustermgmtV40ConfigDiskAdvanceConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 129

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `NutanixClustermgmt::ClustermgmtV40ConfigDiskAdvanceConfig` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `NutanixClustermgmt::ClustermgmtV40ConfigDiskAdvanceConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'is_self_encrypting_drive')
    self.is_self_encrypting_drive = attributes[:'is_self_encrypting_drive']
  end

  if attributes.key?(:'is_self_managed_nvme')
    self.is_self_managed_nvme = attributes[:'is_self_managed_nvme']
  end

  if attributes.key?(:'is_password_protected')
    self.is_password_protected = attributes[:'is_password_protected']
  end

  if attributes.key?(:'is_boot_disk')
    self.is_boot_disk = attributes[:'is_boot_disk']
  end

  if attributes.key?(:'has_boot_partitions_only')
    self.has_boot_partitions_only = attributes[:'has_boot_partitions_only']
  end

  if attributes.key?(:'is_spdk_managed')
    self.is_spdk_managed = attributes[:'is_spdk_managed']
  end

  if attributes.key?(:'is_online')
    self.is_online = attributes[:'is_online']
  end

  if attributes.key?(:'is_marked_for_removal')
    self.is_marked_for_removal = attributes[:'is_marked_for_removal']
  end

  if attributes.key?(:'is_data_migrated')
    self.is_data_migrated = attributes[:'is_data_migrated']
  end

  if attributes.key?(:'is_unhealthy')
    self.is_unhealthy = attributes[:'is_unhealthy']
  end

  if attributes.key?(:'is_suspected_unhealthy')
    self.is_suspected_unhealthy = attributes[:'is_suspected_unhealthy']
  end

  if attributes.key?(:'is_mounted')
    self.is_mounted = attributes[:'is_mounted']
  end

  if attributes.key?(:'is_under_diagnosis')
    self.is_under_diagnosis = attributes[:'is_under_diagnosis']
  end

  if attributes.key?(:'is_diagnostic_info_available')
    self.is_diagnostic_info_available = attributes[:'is_diagnostic_info_available']
  end

  if attributes.key?(:'is_error_found_in_log')
    self.is_error_found_in_log = attributes[:'is_error_found_in_log']
  end

  if attributes.key?(:'is_planned_outage')
    self.is_planned_outage = attributes[:'is_planned_outage']
  end
end

Instance Attribute Details

#has_boot_partitions_onlyObject

Indicates if the Disk is for boot only and no Disk operations will be performed on it.



32
33
34
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 32

def has_boot_partitions_only
  @has_boot_partitions_only
end

#is_boot_diskObject

Indicates if the Disk is a boot Disk.



29
30
31
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 29

def is_boot_disk
  @is_boot_disk
end

#is_data_migratedObject

Indicates if data migration is completed for the Disk.



44
45
46
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 44

def is_data_migrated
  @is_data_migrated
end

#is_diagnostic_info_availableObject

Indicates the Disk diagnostic information along with the device-related statistics are present.



59
60
61
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 59

def is_diagnostic_info_available
  @is_diagnostic_info_available
end

#is_error_found_in_logObject

Indicates whether or not the Disk error is seen in the kernel logs.



62
63
64
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 62

def is_error_found_in_log
  @is_error_found_in_log
end

#is_marked_for_removalObject

Indicates if the Disk is marked for removal.



41
42
43
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 41

def is_marked_for_removal
  @is_marked_for_removal
end

#is_mountedObject

Indicates if the Disk is mounted.



53
54
55
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 53

def is_mounted
  @is_mounted
end

#is_onlineObject

Indicates whether the Disk is online or offline.



38
39
40
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 38

def is_online
  @is_online
end

#is_password_protectedObject

Indicates whether the Disk is password protected.



26
27
28
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 26

def is_password_protected
  @is_password_protected
end

#is_planned_outageObject

Indicates if diagnostics are running on the Disk.



65
66
67
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 65

def is_planned_outage
  @is_planned_outage
end

#is_self_encrypting_driveObject

Indicates whether the Disk has self-encryption enabled.



20
21
22
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 20

def is_self_encrypting_drive
  @is_self_encrypting_drive
end

#is_self_managed_nvmeObject

Indicates if the NVMe Disk is self-managed and does not require a host/CVM reboot.



23
24
25
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 23

def is_self_managed_nvme
  @is_self_managed_nvme
end

#is_spdk_managedObject

Indicates if NVMe device is managed by storage performance development kit(SPDK).



35
36
37
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 35

def is_spdk_managed
  @is_spdk_managed
end

#is_suspected_unhealthyObject

Indicates if the Disk is suspected to be unhealthy.



50
51
52
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 50

def is_suspected_unhealthy
  @is_suspected_unhealthy
end

#is_under_diagnosisObject

Indicates if the Disk is under diagnosis.



56
57
58
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 56

def is_under_diagnosis
  @is_under_diagnosis
end

#is_unhealthyObject

Indicates if the Disk is unhealthy.



47
48
49
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 47

def is_unhealthy
  @is_unhealthy
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



90
91
92
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 90

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



95
96
97
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 95

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 68

def self.attribute_map
  {
    :'is_self_encrypting_drive' => :'isSelfEncryptingDrive',
    :'is_self_managed_nvme' => :'isSelfManagedNvme',
    :'is_password_protected' => :'isPasswordProtected',
    :'is_boot_disk' => :'isBootDisk',
    :'has_boot_partitions_only' => :'hasBootPartitionsOnly',
    :'is_spdk_managed' => :'isSpdkManaged',
    :'is_online' => :'isOnline',
    :'is_marked_for_removal' => :'isMarkedForRemoval',
    :'is_data_migrated' => :'isDataMigrated',
    :'is_unhealthy' => :'isUnhealthy',
    :'is_suspected_unhealthy' => :'isSuspectedUnhealthy',
    :'is_mounted' => :'isMounted',
    :'is_under_diagnosis' => :'isUnderDiagnosis',
    :'is_diagnostic_info_available' => :'isDiagnosticInfoAvailable',
    :'is_error_found_in_log' => :'isErrorFoundInLog',
    :'is_planned_outage' => :'isPlannedOutage'
  }
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



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 261

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



122
123
124
125
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 122

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 100

def self.openapi_types
  {
    :'is_self_encrypting_drive' => :'Boolean',
    :'is_self_managed_nvme' => :'Boolean',
    :'is_password_protected' => :'Boolean',
    :'is_boot_disk' => :'Boolean',
    :'has_boot_partitions_only' => :'Boolean',
    :'is_spdk_managed' => :'Boolean',
    :'is_online' => :'Boolean',
    :'is_marked_for_removal' => :'Boolean',
    :'is_data_migrated' => :'Boolean',
    :'is_unhealthy' => :'Boolean',
    :'is_suspected_unhealthy' => :'Boolean',
    :'is_mounted' => :'Boolean',
    :'is_under_diagnosis' => :'Boolean',
    :'is_diagnostic_info_available' => :'Boolean',
    :'is_error_found_in_log' => :'Boolean',
    :'is_planned_outage' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 225

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      is_self_encrypting_drive == o.is_self_encrypting_drive &&
      is_self_managed_nvme == o.is_self_managed_nvme &&
      is_password_protected == o.is_password_protected &&
      is_boot_disk == o.is_boot_disk &&
      has_boot_partitions_only == o.has_boot_partitions_only &&
      is_spdk_managed == o.is_spdk_managed &&
      is_online == o.is_online &&
      is_marked_for_removal == o.is_marked_for_removal &&
      is_data_migrated == o.is_data_migrated &&
      is_unhealthy == o.is_unhealthy &&
      is_suspected_unhealthy == o.is_suspected_unhealthy &&
      is_mounted == o.is_mounted &&
      is_under_diagnosis == o.is_under_diagnosis &&
      is_diagnostic_info_available == o.is_diagnostic_info_available &&
      is_error_found_in_log == o.is_error_found_in_log &&
      is_planned_outage == o.is_planned_outage
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


248
249
250
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 248

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



254
255
256
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 254

def hash
  [is_self_encrypting_drive, is_self_managed_nvme, is_password_protected, is_boot_disk, has_boot_partitions_only, is_spdk_managed, is_online, is_marked_for_removal, is_data_migrated, is_unhealthy, is_suspected_unhealthy, is_mounted, is_under_diagnosis, is_diagnostic_info_available, is_error_found_in_log, is_planned_outage].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



210
211
212
213
214
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 210

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 283

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

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

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



218
219
220
221
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_disk_advance_config.rb', line 218

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end