Sha256: 893ab56cb3df2fe9b91c7cd53fc57362875fbf1d233e3e6b61aa88f3df841f54

Contents?: true

Size: 1 KB

Versions: 20

Compression:

Stored size: 1 KB

Contents

require 'fog/core/model'

module Fog
  module Brightbox
    class Compute

      class LoadBalancer < Fog::Model

        identity :id

        attribute :url
        attribute :name
        attribute :status
        attribute :resource_type

        attribute :nodes
        attribute :policy
        attribute :healthcheck
        attribute :listeners
        attribute :account

        def ready?
          status == 'active'
        end

        def save
          requires :nodes, :listeners, :healthcheck
          options = {
            :nodes => nodes,
            :listeners => listeners,
            :healthcheck => healthcheck,
            :policy => policy,
            :name => name
          }.delete_if {|k,v| v.nil? || v == "" }
          data = connection.create_load_balancer(options)
          merge_attributes(data)
          true
        end

        def destroy
          requires :identity
          connection.destroy_load_balancer(identity)
          true
        end

      end

    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
fog-0.8.2 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.8.1 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.8.0 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.7.2 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.7.1 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.7.0 lib/fog/compute/models/brightbox/load_balancer.rb
bbcloud-0.11.2 lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancer.rb
bbcloud-0.11.1 lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancer.rb
bbcloud-0.11.0 lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.6.0 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.5.3 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.5.2 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.5.1 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.5.0 lib/fog/compute/models/brightbox/load_balancer.rb
phpfog-fog-0.4.1.3 lib/fog/compute/models/brightbox/load_balancer.rb
phpfog-fog-0.4.1.2 lib/fog/compute/models/brightbox/load_balancer.rb
phpfog-fog-0.4.1.1 lib/fog/compute/models/brightbox/load_balancer.rb
phpfog-fog-0.4.1 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.4.1 lib/fog/compute/models/brightbox/load_balancer.rb
fog-0.4.0 lib/fog/brightbox/models/compute/load_balancer.rb