Class: IbmCloudPower::SAPCreate
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- IbmCloudPower::SAPCreate
- Defined in:
- lib/ibm_cloud_power/models/sap_create.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#allow_remote_restart ⇒ Object
if set to false, automated remote restart is disabled for the VM.
-
#default_trusted_profile ⇒ Object
default IAM trusted profile to use for this virtual server instance.
-
#deployment_target ⇒ Object
The deployment of a dedicated host.
-
#deployment_type ⇒ Object
Custom SAP Deployment Type Information (For Internal Use Only).
-
#image_id ⇒ Object
Image ID of the sap image to use for the server.
-
#instances ⇒ Object
Returns the value of attribute instances.
-
#metadata_service ⇒ Object
The metadata service configuration.
-
#name ⇒ Object
Name of the sap pvm-instance.
-
#networks ⇒ Object
The pvm instance networks information.
-
#pin_policy ⇒ Object
Returns the value of attribute pin_policy.
-
#placement_group ⇒ Object
The placement group for the server.
-
#preferred_processor_compatibility_mode ⇒ Object
Preferred processor compatibility mode.
-
#profile_id ⇒ Object
SAP Profile ID for the amount of cores and memory.
-
#ssh_key_name ⇒ Object
The name of the SSH Key to provide to the server for authenticating.
-
#storage_affinity ⇒ Object
The storage affinity data; ignored if storagePool is provided; Only valid when you deploy one of the IBM supplied stock images.
-
#storage_pool ⇒ Object
Storage Pool for server deployment; if provided then storageAffinity and storageType will be ignored; Only valid when you deploy one of the IBM supplied stock images.
-
#storage_pool_affinity ⇒ Object
Indicates if all volumes attached to the server must reside in the same storage pool; Defaults to true when initially deploying a PVMInstance.
-
#storage_type ⇒ Object
Storage type for server deployment; if storageType is not provided the storage type will default to 'tier3'.
-
#sys_type ⇒ Object
System type used to host the instance.
-
#user_data ⇒ Object
Cloud init user defined data; For FLS, only cloud-config user-data is supported and data must not be compressed or exceed 63K.
-
#user_tags ⇒ Object
List of user tags.
-
#volume_ids ⇒ Object
List of Volume IDs to attach to the pvm-instance on creation.
-
#vpmem_volumes ⇒ Object
The vPMEM volumes information.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SAPCreate
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ SAPCreate
Initializes the object
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 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 183 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::SAPCreate` 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::SAPCreate`. 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'] else self.allow_remote_restart = true end if attributes.key?(:'default_trusted_profile') self.default_trusted_profile = attributes[:'default_trusted_profile'] end if attributes.key?(:'deployment_target') self.deployment_target = attributes[:'deployment_target'] end if attributes.key?(:'deployment_type') self.deployment_type = attributes[:'deployment_type'] end if attributes.key?(:'image_id') self.image_id = attributes[:'image_id'] else self.image_id = nil end if attributes.key?(:'instances') self.instances = attributes[:'instances'] end if attributes.key?(:'metadata_service') self. = attributes[:'metadata_service'] end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'networks') if (value = attributes[:'networks']).is_a?(Array) self.networks = value end else self.networks = nil end if attributes.key?(:'pin_policy') self.pin_policy = attributes[:'pin_policy'] end if attributes.key?(:'placement_group') self.placement_group = attributes[:'placement_group'] end if attributes.key?(:'preferred_processor_compatibility_mode') self.preferred_processor_compatibility_mode = attributes[:'preferred_processor_compatibility_mode'] end if attributes.key?(:'profile_id') self.profile_id = attributes[:'profile_id'] else self.profile_id = nil end if attributes.key?(:'ssh_key_name') self.ssh_key_name = attributes[:'ssh_key_name'] end if attributes.key?(:'storage_affinity') self.storage_affinity = attributes[:'storage_affinity'] end if attributes.key?(:'storage_pool') self.storage_pool = attributes[:'storage_pool'] 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?(:'storage_type') self.storage_type = attributes[:'storage_type'] end if attributes.key?(:'sys_type') self.sys_type = attributes[:'sys_type'] end if attributes.key?(:'user_data') self.user_data = attributes[:'user_data'] end if attributes.key?(:'user_tags') if (value = attributes[:'user_tags']).is_a?(Array) self. = value end end if attributes.key?(:'volume_ids') if (value = attributes[:'volume_ids']).is_a?(Array) self.volume_ids = value end end if attributes.key?(:'vpmem_volumes') if (value = attributes[:'vpmem_volumes']).is_a?(Array) self.vpmem_volumes = value end end end |
Instance Attribute Details
#allow_remote_restart ⇒ Object
if set to false, automated remote restart is disabled for the VM
19 20 21 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 19 def allow_remote_restart @allow_remote_restart end |
#default_trusted_profile ⇒ Object
default IAM trusted profile to use for this virtual server instance
22 23 24 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 22 def default_trusted_profile @default_trusted_profile end |
#deployment_target ⇒ Object
The deployment of a dedicated host
25 26 27 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 25 def deployment_target @deployment_target end |
#deployment_type ⇒ Object
Custom SAP Deployment Type Information (For Internal Use Only)
28 29 30 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 28 def deployment_type @deployment_type end |
#image_id ⇒ Object
Image ID of the sap image to use for the server
31 32 33 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 31 def image_id @image_id end |
#instances ⇒ Object
Returns the value of attribute instances.
33 34 35 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 33 def instances @instances end |
#metadata_service ⇒ Object
The metadata service configuration
36 37 38 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 36 def @metadata_service end |
#name ⇒ Object
Name of the sap pvm-instance
39 40 41 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 39 def name @name end |
#networks ⇒ Object
The pvm instance networks information
42 43 44 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 42 def networks @networks end |
#pin_policy ⇒ Object
Returns the value of attribute pin_policy.
44 45 46 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 44 def pin_policy @pin_policy end |
#placement_group ⇒ Object
The placement group for the server
47 48 49 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 47 def placement_group @placement_group end |
#preferred_processor_compatibility_mode ⇒ Object
Preferred processor compatibility mode
50 51 52 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 50 def preferred_processor_compatibility_mode @preferred_processor_compatibility_mode end |
#profile_id ⇒ Object
SAP Profile ID for the amount of cores and memory
53 54 55 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 53 def profile_id @profile_id end |
#ssh_key_name ⇒ Object
The name of the SSH Key to provide to the server for authenticating
56 57 58 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 56 def ssh_key_name @ssh_key_name end |
#storage_affinity ⇒ Object
The storage affinity data; ignored if storagePool is provided; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in
59 60 61 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 59 def storage_affinity @storage_affinity end |
#storage_pool ⇒ Object
Storage Pool for server deployment; if provided then storageAffinity and storageType will be ignored; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in
62 63 64 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 62 def storage_pool @storage_pool end |
#storage_pool_affinity ⇒ Object
Indicates if all volumes attached to the server must reside in the same storage pool; Defaults to true when initially deploying a PVMInstance
65 66 67 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 65 def storage_pool_affinity @storage_pool_affinity end |
#storage_type ⇒ Object
Storage type for server deployment; if storageType is not provided the storage type will default to 'tier3'.
68 69 70 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 68 def storage_type @storage_type end |
#sys_type ⇒ Object
System type used to host the instance. Only e980, s1022, e1050, e1080, s1122, e1150, and e1180 are supported
71 72 73 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 71 def sys_type @sys_type end |
#user_data ⇒ Object
Cloud init user defined data; For FLS, only cloud-config user-data is supported and data must not be compressed or exceed 63K
74 75 76 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 74 def user_data @user_data end |
#user_tags ⇒ Object
List of user tags
77 78 79 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 77 def @user_tags end |
#volume_ids ⇒ Object
List of Volume IDs to attach to the pvm-instance on creation
80 81 82 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 80 def volume_ids @volume_ids end |
#vpmem_volumes ⇒ Object
The vPMEM volumes information. Only one volume is supported at this time.
83 84 85 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 83 def vpmem_volumes @vpmem_volumes end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
137 138 139 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 137 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
142 143 144 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 142 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
108 109 110 111 112 113 114 115 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/sap_create.rb', line 108 def self.attribute_map { :'allow_remote_restart' => :'allowRemoteRestart', :'default_trusted_profile' => :'defaultTrustedProfile', :'deployment_target' => :'deploymentTarget', :'deployment_type' => :'deploymentType', :'image_id' => :'imageID', :'instances' => :'instances', :'metadata_service' => :'metadataService', :'name' => :'name', :'networks' => :'networks', :'pin_policy' => :'pinPolicy', :'placement_group' => :'placementGroup', :'preferred_processor_compatibility_mode' => :'preferredProcessorCompatibilityMode', :'profile_id' => :'profileID', :'ssh_key_name' => :'sshKeyName', :'storage_affinity' => :'storageAffinity', :'storage_pool' => :'storagePool', :'storage_pool_affinity' => :'storagePoolAffinity', :'storage_type' => :'storageType', :'sys_type' => :'sysType', :'user_data' => :'userData', :'user_tags' => :'userTags', :'volume_ids' => :'volumeIDs', :'vpmem_volumes' => :'vpmemVolumes' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 460 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_nullable ⇒ Object
List of attributes with nullable: true
176 177 178 179 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 176 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 147 def self.openapi_types { :'allow_remote_restart' => :'Boolean', :'default_trusted_profile' => :'TrustedProfile', :'deployment_target' => :'DeploymentTarget', :'deployment_type' => :'String', :'image_id' => :'String', :'instances' => :'PVMInstanceMultiCreate', :'metadata_service' => :'MetadataService', :'name' => :'String', :'networks' => :'Array<PVMInstanceAddNetwork>', :'pin_policy' => :'PinPolicy', :'placement_group' => :'String', :'preferred_processor_compatibility_mode' => :'String', :'profile_id' => :'String', :'ssh_key_name' => :'String', :'storage_affinity' => :'StorageAffinity', :'storage_pool' => :'String', :'storage_pool_affinity' => :'Boolean', :'storage_type' => :'String', :'sys_type' => :'String', :'user_data' => :'String', :'user_tags' => :'Array<String>', :'volume_ids' => :'Array<String>', :'vpmem_volumes' => :'Array<VPMemVolumeCreate>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 417 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 && deployment_target == o.deployment_target && deployment_type == o.deployment_type && image_id == o.image_id && instances == o.instances && == o. && name == o.name && networks == o.networks && pin_policy == o.pin_policy && placement_group == o.placement_group && preferred_processor_compatibility_mode == o.preferred_processor_compatibility_mode && profile_id == o.profile_id && ssh_key_name == o.ssh_key_name && storage_affinity == o.storage_affinity && storage_pool == o.storage_pool && storage_pool_affinity == o.storage_pool_affinity && storage_type == o.storage_type && sys_type == o.sys_type && user_data == o.user_data && == o. && volume_ids == o.volume_ids && vpmem_volumes == o.vpmem_volumes end |
#eql?(o) ⇒ Boolean
447 448 449 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 447 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
453 454 455 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 453 def hash [allow_remote_restart, default_trusted_profile, deployment_target, deployment_type, image_id, instances, , name, networks, pin_policy, placement_group, preferred_processor_compatibility_mode, profile_id, ssh_key_name, storage_affinity, storage_pool, storage_pool_affinity, storage_type, sys_type, user_data, , volume_ids, vpmem_volumes].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 312 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @image_id.nil? invalid_properties.push('invalid value for "image_id", image_id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @networks.nil? invalid_properties.push('invalid value for "networks", networks cannot be nil.') end if @profile_id.nil? invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.') end pattern = Regexp.new(/^[\s]*[A-Za-z][A-Za-z0-9\-]{3,}$/) if @profile_id !~ pattern invalid_properties.push("invalid value for \"profile_id\", must conform to the pattern #{pattern}.") end if !@user_tags.nil? && @user_tags.length > 100 invalid_properties.push('invalid value for "user_tags", number of items must be less than or equal to 100.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 482 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
345 346 347 348 349 350 351 352 353 354 |
# File 'lib/ibm_cloud_power/models/sap_create.rb', line 345 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @image_id.nil? return false if @name.nil? return false if @networks.nil? return false if @profile_id.nil? return false if @profile_id !~ Regexp.new(/^[\s]*[A-Za-z][A-Za-z0-9\-]{3,}$/) return false if !@user_tags.nil? && @user_tags.length > 100 true end |