Sha256: eeab006cfd3637cdb9260aca9df715c0719e0ac401109c3b3596deed04671686

Contents?: true

Size: 1.37 KB

Versions: 37

Compression:

Stored size: 1.37 KB

Contents

class Fastly
  # A logical collection of backends - for example all the asset servers in one data center
  class Director < BelongsToServiceAndVersion
    attr_accessor :service_id, :name, :type, :comment, :retries, :capacity, :quorum

    ##
    # :attr: service
    #
    # The id of the service this belongs to.
    #

    ##
    # :attr: version
    #
    # The number of the version this belongs to.
    #

    ##
    # :attr: name
    #
    # The domain name of this domain
    #

    ##
    # :attr: type
    #
    # what kind of Load Balancer group (currently always 1 meaning random)
    #

    ##
    # :attr: retries
    #
    # how many backends to search if it fails (default 5)
    #

    ##
    # :attr: quorum
    #
    # the percentage of capacity that needs to be up for a director to be considered up (default 75)
    #

    ##
    # :attr: comment
    #
    # a free form comment field

    # Add a Backend object to a Director
    #
    # Return true on success and false on failure
    def add_backend(backend)
      hash = fetcher.client.post("#{Director.put_path(self)}/backend/#{backend.name}")
      !hash.nil?
    end

    # Delete a Backend object from a Director
    #
    # Return true on success and false on failure
    def delete_backend(backend)
      hash = fetcher.client.delete("#{Director.put_path(self)}/backend/#{backend.name}")
      !hash.nil?
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
fastly-3.0.2 lib/fastly/director.rb
fastly-3.0.1 lib/fastly/director.rb
fastly-3.0.0 lib/fastly/director.rb
fastly-2.5.3 lib/fastly/director.rb
fastly-2.5.2 lib/fastly/director.rb
fastly-2.5.1 lib/fastly/director.rb
fastly-2.5.0 lib/fastly/director.rb
fastly-2.4.0 lib/fastly/director.rb
fastly-2.3.1 lib/fastly/director.rb
fastly-2.3.0 lib/fastly/director.rb
fastly-2.2.0 lib/fastly/director.rb
fastly-2.1.0 lib/fastly/director.rb
fastly-2.0.0 lib/fastly/director.rb
fastly-1.15.0 lib/fastly/director.rb
fastly-1.14.0 lib/fastly/director.rb
fastly-1.13.2 lib/fastly/director.rb
fastly-1.13.1 lib/fastly/director.rb
fastly-1.13.0 lib/fastly/director.rb
fastly-1.12.0 lib/fastly/director.rb
fastly-1.11.0 lib/fastly/director.rb