Sha256: 8769d814ce8fd20916dff6eaba765f5296d8cb293e1ca29019c24d32a8ea874d
Contents?: true
Size: 900 Bytes
Versions: 8
Compression:
Stored size: 900 Bytes
Contents
module Brightbox class CloudIP < Api def self.get id conn.cloud_ips.get id end def self.all conn.cloud_ips end def self.create r = conn.create_cloud_ip new(r["id"]) rescue Excon::Errors::Forbidden => e response = JSON.parse(e.response.body) rescue {} response = response.fetch("error", {}) raise Forbidden, "#{response["details"]}: #{response["summary"]}" end def attributes a = fog_model.attributes if a["load_balancer"] a[:destination] = a["load_balancer"]["id"] else a[:destination] = a[:server_id] end a end def to_row attributes end def mapped? status == 'mapped' end def self.default_field_order [:id, :status, :public_ip, :destination, :reverse_dns] end def <=>(b) self.status <=> b.status end end end
Version data entries
8 entries across 8 versions & 2 rubygems