Sha256: d5da012e31ef21bb479683525feadb089b38a37f506039efed73564c4f4e9236
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
module Hcloud class FloatingIP Attributes = { id: nil, description: nil, ip: nil, type: nil, dns_ptr: nil, server: nil, home_location: Location, blocked: nil, } include EntryLoader def update(description:) j = Oj.load(request("floating_ips/#{id.to_i}", j: {description: description}, method: :put).run.body) FloatingIP.new(j["floating_ip"], self, client) end def assign(server:) j = Oj.load(request("floating_ips/#{id.to_i}/actions/assign", j: {server: server}).run.body) Action.new(j["action"], self, client) end def unassign j = Oj.load(request("floating_ips/#{id.to_i}/actions/unassign", method: :post).run.body) Action.new(j["action"], self, client) end def actions ActionResource.new(client: client, parent: self, base_path: "floating_ips/#{id.to_i}") end def destroy request("floating_ips/#{id}", method: :delete).run.body true end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hcloud-0.1.1 | lib/hcloud/floating_ip.rb |