Parent

Included Modules

Class/Module Index [+]

Quicksearch

Instance

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.

Attributes

actions[RW]
authn_error[RW]
create_image[RW]
firewalls[RW]
image_id[RW]
instance_profile[RW]
keyname[RW]
launch_time[RW]
name[RW]
owner_id[RW]
password[RW]
private_addresses[RW]
public_addresses[RW]
realm_id[RW]
state[RW]
storage_volumes[RW]
username[RW]

Public Class Methods

convert_condor_state(state_id) click to toggle source
# File lib/deltacloud/drivers/condor/condor_driver.rb, line 21
def self.convert_condor_state(state_id)
  case state_id
    when 0,1,5 then 'PENDING'
    when 2     then 'RUNNING'
    when 3,4   then 'SHUTTING_DOWN'
    else raise "Unknown Condor state (#{state_id})"
  end
end
new(init=nil) click to toggle source
# File lib/deltacloud/models/instance.rb, line 55
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

Public Instance Methods

authn_feature_failed?() click to toggle source
# File lib/deltacloud/drivers/gogrid/gogrid_driver.rb, line 25
def authn_feature_failed?
  return true unless authn_error.nil?
end
can_create_image?() click to toggle source
# File lib/deltacloud/models/instance.rb, line 39
def can_create_image?
  self.create_image
end
hardware_profile() click to toggle source
# File lib/deltacloud/models/instance.rb, line 47
def hardware_profile
  instance_profile
end
hardware_profile=(profile) click to toggle source
# File lib/deltacloud/models/instance.rb, line 51
def hardware_profile=(profile)
  instance_profile = profile
end
method_missing(name, *args) click to toggle source
# File lib/deltacloud/models/instance.rb, line 62
def method_missing(name, *args)
  if name =~ /is_(\w+)\?/
    return true if self.state.downcase.eql?($1)
  else
    raise NoMethodError.new(name.to_s)
  end
end
to_hash() click to toggle source
# File lib/deltacloud/models/instance.rb, line 76
def to_hash
  h = self.to_hash_original
  h[:public_addresses] = h[:public_addresses].collect do |address|
    { :address => { :type => address.address_type, :value => address } }
  end
  h[:actions] = self.actions.collect do |action|
    { :"#{action}" => {
      :method => collections[:instances].operations[action.to_sym].method,
      :href => collections[:instances].operations[action.to_sym].path.gsub(':id', self.id)
    }}
  end
  h
end
Also aliased as: to_hash_original
to_hash_original() click to toggle source
Alias for: to_hash
to_s() click to toggle source
# File lib/deltacloud/models/instance.rb, line 43
def to_s
  name
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.