Class: Squall::DataStoreZone
Overview
OnApp DataStoreZone
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(options = {}) ⇒ Object
Public: Creates a new DataStoreZone.
-
#delete(id) ⇒ Object
Public: Deletes an existing DataStoreZone.
-
#edit(id, options = {}) ⇒ Object
Public: Updates an existing data store zone.
-
#list ⇒ Object
Public: List data store zones.
-
#show(id) ⇒ Object
Public: Get the details for a data store zone.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
#create(options = {}) ⇒ Object
Public: Creates a new DataStoreZone.
options - Params for the data store zone:
:label - Label for the data store zone
Returns a Hash.
39 40 41 |
# File 'lib/squall/data_store_zone.rb', line 39 def create( = {}) request(:post, "/data_store_zones.json", query: { pack: }) end |
#delete(id) ⇒ Object
Public: Deletes an existing DataStoreZone.
id - ID of the data store zone
Returns an empty Hash.
48 49 50 |
# File 'lib/squall/data_store_zone.rb', line 48 def delete(id) request(:delete, "/data_store_zones/#{id}.json") end |
#edit(id, options = {}) ⇒ Object
Public: Updates an existing data store zone.
id - ID of the data store zone options - Params for the data store zone:
:label - Label for the data store zone
Returns an empty Hash.
29 30 31 |
# File 'lib/squall/data_store_zone.rb', line 29 def edit(id, = {}) request(:put, "/data_store_zones/#{id}.json", query: { pack: }) end |
#list ⇒ Object
Public: List data store zones.
Returns an Array.
7 8 9 10 |
# File 'lib/squall/data_store_zone.rb', line 7 def list response = request(:get, "/data_store_zones.json") response.collect { |i| i['data_store_group'] } end |
#show(id) ⇒ Object
Public: Get the details for a data store zone.
id - ID of the data store zone
Returns a Hash.
17 18 19 20 |
# File 'lib/squall/data_store_zone.rb', line 17 def show(id) response = request(:get, "/data_store_zones/#{id}.json") response['data_store_group'] end |