Class: Fastly::Director
- Inherits:
-
BelongsToServiceAndVersion
- Object
- Base
- BelongsToServiceAndVersion
- Fastly::Director
- Defined in:
- lib/fastly/director.rb
Overview
A logical collection of backends - for example all the asset servers in one data center
Instance Attribute Summary collapse
-
#capacity ⇒ Object
Returns the value of attribute capacity.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#name ⇒ Object
Returns the value of attribute name.
-
#quorom ⇒ Object
Returns the value of attribute quorom.
-
#retries ⇒ Object
Returns the value of attribute retries.
-
#service_id ⇒ Object
Returns the value of attribute service_id.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
-
#add_backend(backend) ⇒ Object
Add a Backend object to a Director.
-
#delete_backend(backend) ⇒ Object
Delete a Backend object from a Director.
Methods inherited from BelongsToServiceAndVersion
#service, #version, #version=, #version_number
Methods inherited from Base
#as_hash, #delete!, delete_path, get_path, #initialize, list_path, path, post_path, put_path, #save!
Constructor Details
This class inherits a constructor from Fastly::Base
Instance Attribute Details
#capacity ⇒ Object
Returns the value of attribute capacity.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def capacity @capacity end |
#comment ⇒ Object
Returns the value of attribute comment.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def comment @comment end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def name @name end |
#quorom ⇒ Object
Returns the value of attribute quorom.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def quorom @quorom end |
#retries ⇒ Object
Returns the value of attribute retries.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def retries @retries end |
#service_id ⇒ Object
Returns the value of attribute service_id.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def service_id @service_id end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/fastly/director.rb', line 4 def type @type end |
Instance Method Details
#add_backend(backend) ⇒ Object
Add a Backend object to a Director
Return true on success and false on failure
50 51 52 53 |
# File 'lib/fastly/director.rb', line 50 def add_backend(backend) hash = fetcher.client.post(Fastly::Director.put_path(self)+"/backend/#{backend.name}") return !hash.nil? end |
#delete_backend(backend) ⇒ Object
Delete a Backend object from a Director
Return true on success and false on failure
58 59 60 61 |
# File 'lib/fastly/director.rb', line 58 def delete_backend(backend) hash = fetcher.client.delete(Fastly::Director.put_path(self)+"/backend/#{backend.name}") return !hash.nil? end |