Class: ScalrApiV2::Farms
- Inherits:
-
Object
- Object
- ScalrApiV2::Farms
- Defined in:
- lib/scalr_api_v2/farms.rb
Overview
connection and request methods for interacting with the Scalr API
Instance Method Summary collapse
-
#get_farm(farm_id) ⇒ Object
List farm details.
-
#initialize ⇒ Farms
constructor
A new instance of Farms.
-
#list ⇒ Object
List all scripts.
-
#list_farm_servers(farm_id) ⇒ Object
List farm details.
Constructor Details
#initialize ⇒ Farms
Returns a new instance of Farms.
7 8 9 10 |
# File 'lib/scalr_api_v2/farms.rb', line 7 def initialize @config = ScalrApiV2::Config.new.config @scalr = ScalrApiV2::Request.new end |
Instance Method Details
#get_farm(farm_id) ⇒ Object
List farm details
19 20 21 22 |
# File 'lib/scalr_api_v2/farms.rb', line 19 def get_farm(farm_id) list = @scalr.list(format('/api/v1beta0/%s/farms/%s', @config['mode_path'], farm_id)) return list end |
#list ⇒ Object
List all scripts
13 14 15 16 |
# File 'lib/scalr_api_v2/farms.rb', line 13 def list list = @scalr.list(format('/api/v1beta0/%s/farms/', @config['mode_path'])) return list end |
#list_farm_servers(farm_id) ⇒ Object
List farm details
25 26 27 28 |
# File 'lib/scalr_api_v2/farms.rb', line 25 def list_farm_servers(farm_id) list = @scalr.list(format('/api/v1beta0/%s/farms/%s/servers/', @config['mode_path'], farm_id)) return list end |