Class: LinodeOpenapiClient::Linode7
- Inherits:
-
Object
- Object
- LinodeOpenapiClient::Linode7
- Defined in:
- lib/linode_openapi_client/models/linode7.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#alerts ⇒ Object
Returns the value of attribute alerts.
-
#backups ⇒ Object
Returns the value of attribute backups.
-
#created ⇒ Object
Read-only When this Linode was created.
-
#group ⇒ Object
__Filterable__ A deprecated property denoting a group label for this Linode.
-
#has_user_data ⇒ Object
Read-only Whether this compute instance was provisioned utilizing ‘user_data` provided via the Metadata service.
-
#host_uuid ⇒ Object
Read-only The Linode’s host machine, as a UUID.
-
#hypervisor ⇒ Object
Read-only The virtualization software powering this Linode.
-
#id ⇒ Object
__Filterable__, Read-only This Linode’s ID which must be provided for all operations impacting this Linode.
-
#image ⇒ Object
An Image ID to deploy the Linode Disk from.
-
#ipv4 ⇒ Object
__Filterable__, Read-only This Linode’s IPv4 Addresses.
-
#ipv6 ⇒ Object
Read-only This Linode’s IPv6 SLAAC address.
-
#label ⇒ Object
__Filterable__ The Linode’s label is for display purposes only.
-
#placement_group ⇒ Object
Returns the value of attribute placement_group.
-
#region ⇒ Object
__Filterable__, Read-only This is the [region](techdocs.akamai.com/linode-api/reference/get-regions) where the Linode was deployed.
-
#specs ⇒ Object
Returns the value of attribute specs.
-
#status ⇒ Object
Read-only A brief description of this Linode’s current state.
-
#tags ⇒ Object
__Filterable__ An array of tags applied to this object.
-
#type ⇒ Object
Read-only This is the [Linode type](techdocs.akamai.com/linode-api/reference/get-linode-types) that this Linode was deployed with.
-
#updated ⇒ Object
Read-only When this Linode was last updated.
-
#watchdog_enabled ⇒ Object
The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Linode7
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Linode7
Initializes the object
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 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 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 163 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::Linode7` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `LinodeOpenapiClient::Linode7`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'group') self.group = attributes[:'group'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'host_uuid') self.host_uuid = attributes[:'host_uuid'] end if attributes.key?(:'backups') self.backups = attributes[:'backups'] end if attributes.key?(:'alerts') self.alerts = attributes[:'alerts'] end if attributes.key?(:'created') self.created = attributes[:'created'] end if attributes.key?(:'ipv4') if (value = attributes[:'ipv4']).is_a?(Array) self.ipv4 = value end end if attributes.key?(:'region') self.region = attributes[:'region'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'specs') self.specs = attributes[:'specs'] end if attributes.key?(:'ipv6') self.ipv6 = attributes[:'ipv6'] end if attributes.key?(:'hypervisor') self.hypervisor = attributes[:'hypervisor'] end if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self. = value end end if attributes.key?(:'updated') self.updated = attributes[:'updated'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'label') self.label = attributes[:'label'] end if attributes.key?(:'watchdog_enabled') self.watchdog_enabled = attributes[:'watchdog_enabled'] end if attributes.key?(:'placement_group') self.placement_group = attributes[:'placement_group'] end if attributes.key?(:'image') self.image = attributes[:'image'] end if attributes.key?(:'has_user_data') self.has_user_data = attributes[:'has_user_data'] end end |
Instance Attribute Details
#alerts ⇒ Object
Returns the value of attribute alerts.
29 30 31 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 29 def alerts @alerts end |
#backups ⇒ Object
Returns the value of attribute backups.
27 28 29 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 27 def backups @backups end |
#created ⇒ Object
Read-only When this Linode was created.
32 33 34 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 32 def created @created end |
#group ⇒ Object
__Filterable__ A deprecated property denoting a group label for this Linode.
19 20 21 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 19 def group @group end |
#has_user_data ⇒ Object
Read-only Whether this compute instance was provisioned utilizing ‘user_data` provided via the Metadata service. See the [Create a Linode](techdocs.akamai.com/linode-api/reference/post-linode-instance) description for more information on Metadata.
72 73 74 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 72 def has_user_data @has_user_data end |
#host_uuid ⇒ Object
Read-only The Linode’s host machine, as a UUID.
25 26 27 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 25 def host_uuid @host_uuid end |
#hypervisor ⇒ Object
Read-only The virtualization software powering this Linode.
49 50 51 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 49 def hypervisor @hypervisor end |
#id ⇒ Object
__Filterable__, Read-only This Linode’s ID which must be provided for all operations impacting this Linode.
41 42 43 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 41 def id @id end |
#image ⇒ Object
An Image ID to deploy the Linode Disk from. Run the [List images](techdocs.akamai.com/linode-api/reference/get-images) operation with authentication to view all available Images. Official Linode Images start with ‘linode/`, while your Account’s Images start with ‘private/`. Creating a disk from a Private Image requires `read_only` or `read_write` permissions for that Image. Run the [Update a user’s grants](techdocs.akamai.com/linode-api/reference/put-user-grants) operation to adjust permissions for an Account Image.
69 70 71 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 69 def image @image end |
#ipv4 ⇒ Object
__Filterable__, Read-only This Linode’s IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to [Open a support ticket](techdocs.akamai.com/linode-api/reference/post-ticket) to get additional IPv4 addresses. IPv4 addresses may be reassigned between your Linodes, or shared with other Linodes. See the [networking](techdocs.akamai.com/linode-api/reference/post-firewalls) operations for details.
35 36 37 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 35 def ipv4 @ipv4 end |
#ipv6 ⇒ Object
Read-only This Linode’s IPv6 SLAAC address. This address is specific to a Linode, and may not be shared. If the Linode has not been assigned an IPv6 address, the return value will be ‘null`.
46 47 48 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 46 def ipv6 @ipv6 end |
#label ⇒ Object
__Filterable__ The Linode’s label is for display purposes only. If no label is provided for a Linode, a default will be assigned. Linode labels have the following constraints: - Must begin and end with an alphanumeric character. - May only consist of alphanumeric characters, hyphens (‘-`), underscores (`_`) or periods (`.`). - Cannot have two hyphens (`–`), underscores (`__`) or periods (`..`) in a row.
61 62 63 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 61 def label @label end |
#placement_group ⇒ Object
Returns the value of attribute placement_group.
66 67 68 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 66 def placement_group @placement_group end |
#region ⇒ Object
__Filterable__, Read-only This is the [region](techdocs.akamai.com/linode-api/reference/get-regions) where the Linode was deployed. A Linode’s region can only be changed by initiating a [cross data center migration](techdocs.akamai.com/linode-api/reference/post-migrate-linode-instance).
38 39 40 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 38 def region @region end |
#specs ⇒ Object
Returns the value of attribute specs.
43 44 45 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 43 def specs @specs end |
#status ⇒ Object
Read-only A brief description of this Linode’s current state. This field may change without direct action from you. For example, when a Linode goes into maintenance mode its status will display ‘stopped`.
22 23 24 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 22 def status @status end |
#tags ⇒ Object
__Filterable__ An array of tags applied to this object. Tags are for organizational purposes only.
52 53 54 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 52 def @tags end |
#type ⇒ Object
Read-only This is the [Linode type](techdocs.akamai.com/linode-api/reference/get-linode-types) that this Linode was deployed with. To change a Linode’s Type, use [Resize a Linode](techdocs.akamai.com/linode-api/reference/post-resize-linode-instance).
58 59 60 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 58 def type @type end |
#updated ⇒ Object
Read-only When this Linode was last updated.
55 56 57 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 55 def updated @updated end |
#watchdog_enabled ⇒ Object
The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
64 65 66 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 64 def watchdog_enabled @watchdog_enabled end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
405 406 407 408 409 410 411 412 413 414 415 416 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 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 405 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = LinodeOpenapiClient.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
123 124 125 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 123 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 97 def self.attribute_map { :'group' => :'group', :'status' => :'status', :'host_uuid' => :'host_uuid', :'backups' => :'backups', :'alerts' => :'alerts', :'created' => :'created', :'ipv4' => :'ipv4', :'region' => :'region', :'id' => :'id', :'specs' => :'specs', :'ipv6' => :'ipv6', :'hypervisor' => :'hypervisor', :'tags' => :'tags', :'updated' => :'updated', :'type' => :'type', :'label' => :'label', :'watchdog_enabled' => :'watchdog_enabled', :'placement_group' => :'placement_group', :'image' => :'image', :'has_user_data' => :'has_user_data' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 381 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
154 155 156 157 158 159 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 154 def self.openapi_nullable Set.new([ :'ipv6', :'placement_group', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 128 def self.openapi_types { :'group' => :'String', :'status' => :'String', :'host_uuid' => :'String', :'backups' => :'Linode7Backups', :'alerts' => :'Linode7Alerts', :'created' => :'Time', :'ipv4' => :'Array<String>', :'region' => :'String', :'id' => :'Integer', :'specs' => :'Linode2Specs', :'ipv6' => :'String', :'hypervisor' => :'String', :'tags' => :'Array<String>', :'updated' => :'Time', :'type' => :'String', :'label' => :'String', :'watchdog_enabled' => :'Boolean', :'placement_group' => :'Linode7PlacementGroup', :'image' => :'String', :'has_user_data' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 341 def ==(o) return true if self.equal?(o) self.class == o.class && group == o.group && status == o.status && host_uuid == o.host_uuid && backups == o.backups && alerts == o.alerts && created == o.created && ipv4 == o.ipv4 && region == o.region && id == o.id && specs == o.specs && ipv6 == o.ipv6 && hypervisor == o.hypervisor && == o. && updated == o.updated && type == o.type && label == o.label && watchdog_enabled == o.watchdog_enabled && placement_group == o.placement_group && image == o.image && has_user_data == o.has_user_data end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 476 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
368 369 370 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 368 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
374 375 376 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 374 def hash [group, status, host_uuid, backups, alerts, created, ipv4, region, id, specs, ipv6, hypervisor, , updated, type, label, watchdog_enabled, placement_group, image, has_user_data].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 263 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@label.nil? && @label.to_s.length > 64 invalid_properties.push('invalid value for "label", the character length must be smaller than or equal to 64.') end if !@label.nil? && @label.to_s.length < 3 invalid_properties.push('invalid value for "label", the character length must be great than or equal to 3.') end pattern = Regexp.new(/^[a-zA-Z]((?!--|__|..)[a-zA-Z0-9-_.])+$/) if !@label.nil? && @label !~ pattern invalid_properties.push("invalid value for \"label\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
452 453 454 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 452 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
458 459 460 461 462 463 464 465 466 467 468 469 470 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 458 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 |
#to_s ⇒ String
Returns the string representation of the object
446 447 448 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 446 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/linode_openapi_client/models/linode7.rb', line 284 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' status_validator = EnumAttributeValidator.new('String', ["running", "offline", "booting", "rebooting", "shutting_down", "provisioning", "deleting", "migrating", "rebuilding", "cloning", "restoring", "stopped", "billing_suspension"]) return false unless status_validator.valid?(@status) hypervisor_validator = EnumAttributeValidator.new('String', ["kvm"]) return false unless hypervisor_validator.valid?(@hypervisor) return false if !@label.nil? && @label.to_s.length > 64 return false if !@label.nil? && @label.to_s.length < 3 return false if !@label.nil? && @label !~ Regexp.new(/^[a-zA-Z]((?!--|__|..)[a-zA-Z0-9-_.])+$/) true end |