Class: Fog::Glesys::Compute::Ip

Inherits:
Model
  • Object
show all
Extended by:
Deprecation
Defined in:
lib/rackspace-fog/glesys/models/compute/ip.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods included from Deprecation

deprecate, self_deprecate

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#addObject



54
55
56
57
58
59
60
61
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 54

def add
  requires :serverid, :version, :ip
  connection.ip_add(
    :serverid  => serverid,
    :ipversion => version,
    :ipaddress => ip
  )
end

#detailsObject



30
31
32
33
34
35
36
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 30

def details
  requires :version, :ip
  connection.ip_details(
    :ipversion => version,
    :ipaddress => ip
  )
end

#list_freeObject



21
22
23
24
25
26
27
28
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 21

def list_free
  requires :version, :datacenter, :platform
  connection.ip_list_free(
    :ipversion => version,
    :platform => platform,
    :datacenter => datacenter
  ).body['response']['iplist']
end

#list_ownObject



17
18
19
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 17

def list_own
  connection.list_own
end

#releaseObject



46
47
48
49
50
51
52
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 46

def release
  requires :version, :ip
  connection.ip_release(
    :ipversion => version,
    :ipaddress => ip
  )
end

#removeObject



63
64
65
66
67
68
69
70
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 63

def remove
  requires :serverid, :version, :ip
  connection.ip_remove(
    :serverid  => serverid,
    :ipversion => version,
    :ipaddress => ip
  )
end

#takeObject



38
39
40
41
42
43
44
# File 'lib/rackspace-fog/glesys/models/compute/ip.rb', line 38

def take
  requires :version, :ip
  connection.ip_take(
    :ipversion => version,
    :ipaddress => ip
  )
end