Sha256: 648531ccf6e1bf21b85513245694335dcea65f734c57e284e350022b6793f9f4

Contents?: true

Size: 725 Bytes

Versions: 4

Compression:

Stored size: 725 Bytes

Contents

require 'fog/compute/gridscale/models/paging_collection'
require 'fog/compute/gridscale/models/server_relation_network'

module Fog
  module Compute
    class Gridscale
      class ServerRelationIps < Fog::Compute::Gridscale::PagingCollection
        model Fog::Compute::Gridscale::ServerRelationIp

        def all(server_uuid)
          data = service.server_relation_ips_get(server_uuid)
          relations = data.body['ip_relations']
          load(relations)
        end


        def get(payload)
          ips_relation = service.server_relation_ip_get(payload).body['ip_relation']
          new(ips_relation) if ips_relation
        rescue Fog::Errors::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-gridscale-0.1.5 lib/fog/compute/gridscale/models/server_relation_ips.rb
fog-gridscale-0.1.4 lib/fog/compute/gridscale/models/server_relation_ips.rb
fog-gridscale-0.1.3 lib/fog/compute/gridscale/models/server_relation_ips.rb
fog-gridscale-0.1.2 lib/fog/compute/gridscale/models/server_relation_ips.rb