Class: Instance
- Defined in:
- lib/deltacloud/models/instance.rb,
lib/deltacloud/drivers/ec2/ec2_driver.rb,
lib/deltacloud/drivers/gogrid/gogrid_driver.rb
Overview
Copyright © 2009, 2010 Red Hat, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#authn_error ⇒ Object
Returns the value of attribute authn_error.
-
#image_id ⇒ Object
Returns the value of attribute image_id.
-
#instance_profile ⇒ Object
Returns the value of attribute instance_profile.
-
#keyname ⇒ Object
Returns the value of attribute keyname.
-
#launch_time ⇒ Object
Returns the value of attribute launch_time.
-
#name ⇒ Object
Returns the value of attribute name.
-
#owner_id ⇒ Object
Returns the value of attribute owner_id.
-
#password ⇒ Object
Returns the value of attribute password.
-
#private_addresses ⇒ Object
Returns the value of attribute private_addresses.
-
#public_addresses ⇒ Object
Returns the value of attribute public_addresses.
-
#realm_id ⇒ Object
Returns the value of attribute realm_id.
-
#state ⇒ Object
Returns the value of attribute state.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #authn_feature_failed? ⇒ Boolean
-
#initialize(init = nil) ⇒ Instance
constructor
A new instance of Instance.
- #method_missing(name, *args) ⇒ Object
Methods inherited from BaseModel
attr_accessor, attributes, #attributes, #id, #to_hash, #to_json
Constructor Details
#initialize(init = nil) ⇒ Instance
Returns a new instance of Instance.
34 35 36 37 38 39 |
# File 'lib/deltacloud/models/instance.rb', line 34 def initialize(init=nil) super(init) self.actions = [] if self.actions.nil? self.public_addresses = [] if self.public_addresses.nil? self.private_addresses = [] if self.private_addresses.nil? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/deltacloud/models/instance.rb', line 41 def method_missing(name, *args) if name =~ /is_(\w+)\?/ return true if self.state.downcase.eql?($1) else raise NoMethodError end end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
26 27 28 |
# File 'lib/deltacloud/models/instance.rb', line 26 def actions @actions end |
#authn_error ⇒ Object
Returns the value of attribute authn_error.
32 33 34 |
# File 'lib/deltacloud/models/instance.rb', line 32 def authn_error @authn_error end |
#image_id ⇒ Object
Returns the value of attribute image_id.
22 23 24 |
# File 'lib/deltacloud/models/instance.rb', line 22 def image_id @image_id end |
#instance_profile ⇒ Object
Returns the value of attribute instance_profile.
29 30 31 |
# File 'lib/deltacloud/models/instance.rb', line 29 def instance_profile @instance_profile end |
#keyname ⇒ Object
Returns the value of attribute keyname.
31 32 33 |
# File 'lib/deltacloud/models/instance.rb', line 31 def keyname @keyname end |
#launch_time ⇒ Object
Returns the value of attribute launch_time.
30 31 32 |
# File 'lib/deltacloud/models/instance.rb', line 30 def launch_time @launch_time end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/deltacloud/models/instance.rb', line 23 def name @name end |
#owner_id ⇒ Object
Returns the value of attribute owner_id.
21 22 23 |
# File 'lib/deltacloud/models/instance.rb', line 21 def owner_id @owner_id end |
#password ⇒ Object
Returns the value of attribute password.
24 25 26 |
# File 'lib/deltacloud/drivers/gogrid/gogrid_driver.rb', line 24 def password @password end |
#private_addresses ⇒ Object
Returns the value of attribute private_addresses.
28 29 30 |
# File 'lib/deltacloud/models/instance.rb', line 28 def private_addresses @private_addresses end |
#public_addresses ⇒ Object
Returns the value of attribute public_addresses.
27 28 29 |
# File 'lib/deltacloud/models/instance.rb', line 27 def public_addresses @public_addresses end |
#realm_id ⇒ Object
Returns the value of attribute realm_id.
24 25 26 |
# File 'lib/deltacloud/models/instance.rb', line 24 def realm_id @realm_id end |
#state ⇒ Object
Returns the value of attribute state.
25 26 27 |
# File 'lib/deltacloud/models/instance.rb', line 25 def state @state end |
#username ⇒ Object
Returns the value of attribute username.
23 24 25 |
# File 'lib/deltacloud/drivers/gogrid/gogrid_driver.rb', line 23 def username @username end |
Instance Method Details
#authn_feature_failed? ⇒ Boolean
49 50 51 |
# File 'lib/deltacloud/models/instance.rb', line 49 def authn_feature_failed? return true unless authn_error.nil? end |