Class: QC::Eip
Instance Attribute Summary
Attributes inherited from DataType
Class Method Summary collapse
- .allocate(p = {bandwidth: 1, eip_name: nil, count: 1, need_icp: nil, zone: nil}) ⇒ Object
- .load(eip_id) ⇒ Object
- .release(eips: [], zone: nil) ⇒ Object
Instance Method Summary collapse
Methods inherited from DataType
describe, #initialize, #method_missing, #to_s
Constructor Details
This class inherits a constructor from QC::DataType
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class QC::DataType
Class Method Details
.allocate(p = {bandwidth: 1, eip_name: nil, count: 1, need_icp: nil, zone: nil}) ⇒ Object
136 137 138 139 140 141 142 143 |
# File 'lib/qc.rb', line 136 def Eip.allocate p = {bandwidth: 1, eip_name: nil, count: 1, need_icp: nil, zone: nil} ret = API::Request.execute! 'AllocateEips', p if ret.respond_to? :has_key? ret['eips'] else false end end |
.load(eip_id) ⇒ Object
156 157 158 |
# File 'lib/qc.rb', line 156 def Eip.load eip_id Eip.describe('eips.1' => eip_id)[0] end |
.release(eips: [], zone: nil) ⇒ Object
145 146 147 148 149 150 151 152 153 154 |
# File 'lib/qc.rb', line 145 def Eip.release eips: [], zone: nil if eips.size > 0 p = {} 1.upto(eips.size).each { |i| p["eips.#{i}"] = eips[i-1] } p[:zone] = zone API::Request.execute!('ReleaseEips', p) else false end end |