Class: Squall::DataStoreZone

Inherits:
Base
  • Object
show all
Defined in:
lib/squall/data_store_zone.rb

Overview

OnApp DataStoreZone

Instance Attribute Summary

Attributes inherited from Base

#result, #success

Instance Method Summary (collapse)

Methods inherited from Base

#check_config, #default_params, #key_for_class, #request

Instance Method Details

- (Object) create(options = {})

Creates a new DataStoreZone.

Parameters:

  • options (defaults to: {})

    Params for the data store zone:

Options Hash (options):

  • :label (Object)

    Label for the data store zone

Returns:

  • a Hash.



39
40
41
# File 'lib/squall/data_store_zone.rb', line 39

def create(options = {})
  request(:post, "/data_store_zones.json", query: { pack: options })
end

- (Object) delete(id)

Deletes an existing DataStoreZone.

Parameters:

  • 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

- (Object) edit(id, options = {})

Updates an existing data store zone.

Parameters:

  • id

    ID of the data store zone

  • options (defaults to: {})

    Params for the data store zone:

Options Hash (options):

  • :label (Object)

    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, options = {})
  request(:put, "/data_store_zones/#{id}.json", query: { pack: options })
end

- (Object) list

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

- (Object) show(id)

Get the details for a data store zone.

Parameters:

  • 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