Class: IbmCloudPower::PVMInstanceUpdate

Inherits:
ApiModelBase show all
Defined in:
lib/ibm_cloud_power/models/pvm_instance_update.rb

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ PVMInstanceUpdate

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 144

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::PVMInstanceUpdate` 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 `IbmCloudPower::PVMInstanceUpdate`. 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?(:'allow_remote_restart')
    self.allow_remote_restart = attributes[:'allow_remote_restart']
  end

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

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

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

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

  if attributes.key?(:'migratable')
    self.migratable = attributes[:'migratable']
  else
    self.migratable = true
  end

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

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

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

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

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

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

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

  if attributes.key?(:'storage_pool_affinity')
    self.storage_pool_affinity = attributes[:'storage_pool_affinity']
  else
    self.storage_pool_affinity = true
  end

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

Instance Attribute Details

#allow_remote_restartObject

if set to false, automated remote restart is disabled for the VM



19
20
21
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 19

def allow_remote_restart
  @allow_remote_restart
end

#default_trusted_profileObject

default IAM trusted profile to use for this virtual server instance



22
23
24
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 22

def default_trusted_profile
  @default_trusted_profile
end

#license_repository_capacityObject

The VTL license repository capacity TiB value



25
26
27
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 25

def license_repository_capacity
  @license_repository_capacity
end

#memoryObject

Amount of memory allocated (in GiB)



28
29
30
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 28

def memory
  @memory
end

#metadata_serviceObject

The metadata service configuration



31
32
33
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 31

def 
  @metadata_service
end

#migratableObject

(deprecated - replaced by pinPolicy) Indicates if the server is allowed to migrate between hosts



34
35
36
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 34

def migratable
  @migratable
end

#pin_policyObject

Returns the value of attribute pin_policy.



36
37
38
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 36

def pin_policy
  @pin_policy
end

#preferred_processor_compatibility_modeObject

Preferred processor compatibility mode



39
40
41
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 39

def preferred_processor_compatibility_mode
  @preferred_processor_compatibility_mode
end

#proc_typeObject

Processor type (dedicated, shared, capped)



42
43
44
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 42

def proc_type
  @proc_type
end

#processorsObject

Number of processors allocated



45
46
47
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 45

def processors
  @processors
end

#sap_profile_idObject

If an SAP pvm-instance, the SAP profile ID to switch to (only while shutdown)



48
49
50
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 48

def sap_profile_id
  @sap_profile_id
end

#server_nameObject

Name of the server to create



51
52
53
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 51

def server_name
  @server_name
end

#software_licensesObject

The pvm instance Software Licenses



54
55
56
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 54

def software_licenses
  @software_licenses
end

#storage_pool_affinityObject

Indicates if all volumes attached to the server must reside in the same storage pool; If set to false then volumes from any storage type and pool can be attached to the PVMInstance; Impacts PVMInstance snapshot, capture, and clone, for capture and clone - only data volumes that are of the same storage type and in the same storage pool of the PVMInstance's boot volume can be included; for snapshot - all data volumes to be included in the snapshot must reside in the same storage type and pool. Once set to false, cannot be set back to true unless all volumes attached reside in the same storage type and pool.



57
58
59
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 57

def storage_pool_affinity
  @storage_pool_affinity
end

#virtual_coresObject

The pvm instance virtual CPU information



60
61
62
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 60

def virtual_cores
  @virtual_cores
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



106
107
108
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 106

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



111
112
113
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 111

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 85

def self.attribute_map
  {
    :'allow_remote_restart' => :'allowRemoteRestart',
    :'default_trusted_profile' => :'defaultTrustedProfile',
    :'license_repository_capacity' => :'licenseRepositoryCapacity',
    :'memory' => :'memory',
    :'metadata_service' => :'metadataService',
    :'migratable' => :'migratable',
    :'pin_policy' => :'pinPolicy',
    :'preferred_processor_compatibility_mode' => :'preferredProcessorCompatibilityMode',
    :'proc_type' => :'procType',
    :'processors' => :'processors',
    :'sap_profile_id' => :'sapProfileID',
    :'server_name' => :'serverName',
    :'software_licenses' => :'softwareLicenses',
    :'storage_pool_affinity' => :'storagePoolAffinity',
    :'virtual_cores' => :'virtualCores'
  }
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



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 287

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



137
138
139
140
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 137

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

.openapi_typesObject

Attribute type mapping.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 116

def self.openapi_types
  {
    :'allow_remote_restart' => :'Boolean',
    :'default_trusted_profile' => :'UpdateTrustedProfile',
    :'license_repository_capacity' => :'Integer',
    :'memory' => :'Float',
    :'metadata_service' => :'UpdateMetadataService',
    :'migratable' => :'Boolean',
    :'pin_policy' => :'PinPolicy',
    :'preferred_processor_compatibility_mode' => :'String',
    :'proc_type' => :'String',
    :'processors' => :'Float',
    :'sap_profile_id' => :'String',
    :'server_name' => :'String',
    :'software_licenses' => :'SoftwareLicenses',
    :'storage_pool_affinity' => :'Boolean',
    :'virtual_cores' => :'VirtualCores'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 252

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      allow_remote_restart == o.allow_remote_restart &&
      default_trusted_profile == o.default_trusted_profile &&
      license_repository_capacity == o.license_repository_capacity &&
      memory == o.memory &&
       == o. &&
      migratable == o.migratable &&
      pin_policy == o.pin_policy &&
      preferred_processor_compatibility_mode == o.preferred_processor_compatibility_mode &&
      proc_type == o.proc_type &&
      processors == o.processors &&
      sap_profile_id == o.sap_profile_id &&
      server_name == o.server_name &&
      software_licenses == o.software_licenses &&
      storage_pool_affinity == o.storage_pool_affinity &&
      virtual_cores == o.virtual_cores
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


274
275
276
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 274

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



280
281
282
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 280

def hash
  [allow_remote_restart, default_trusted_profile, license_repository_capacity, memory, , migratable, pin_policy, preferred_processor_compatibility_mode, proc_type, processors, sap_profile_id, server_name, software_licenses, storage_pool_affinity, virtual_cores].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



225
226
227
228
229
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 225

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



309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 309

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



233
234
235
236
237
238
# File 'lib/ibm_cloud_power/models/pvm_instance_update.rb', line 233

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  proc_type_validator = EnumAttributeValidator.new('String', ["dedicated", "shared", "capped"])
  return false unless proc_type_validator.valid?(@proc_type)
  true
end