Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::Ninefold::Address

Public Class Methods

new(attributes={}) click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 32
def initialize(attributes={})
  super
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 36
def destroy
  requires :identity
  self.jobid = extract_job_id(service.disassociate_ip_address(:id => identity))
  true
end
disable_static_nat() click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 49
def disable_static_nat()
  self.jobid = extract_job_id(service.disable_static_nat(:ipaddressid => identity))
  true
end
enable_static_nat(server) click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 42
def enable_static_nat(server)
  server.kind_of?(Integer) ? serverid = server : serverid = server.identity
  res = service.enable_static_nat(:virtualmachineid => serverid, :ipaddressid => identity)
  reload
  to_boolean(res['success'])
end
ready?() click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 61
def ready?
  if jobid && service.query_async_job_result(:jobid => jobid)['jobstatus'] == 0
    false
  else # No running job, we are ready. Refresh data.
    reload
    true
  end
end
reload() click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 54
def reload
  self.virtualmachinedisplayname = nil
  self.virtualmachineid = nil
  self.virtualmachinename = nil
  super
end
save() click to toggle source
# File lib/fog/ninefold/models/compute/address.rb, line 70
def save
  raise "Operation not supported" if self.identity
  requires :zoneid

  options = {
    :zoneid => zoneid,
    :networkid => networkid,
    :account => account,
    :domainid => domainid
  }.delete_if {|k,v| v.nil? || v == "" }
  data = service.associate_ip_address(options)
  merge_attributes(data)
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.