Class: Bunny::StorageZone

Inherits:
Object
  • Object
show all
Defined in:
lib/bunny/models/storage_zone.rb

Class Method Summary collapse

Methods inherited from Object

#camel_to_snake, #initialize, #to_ostruct

Constructor Details

This class inherits a constructor from Bunny::Object

Class Method Details

.create(name:, region:, tier:) ⇒ Object



9
10
11
12
# File 'lib/bunny/models/storage_zone.rb', line 9

def create(name:, region:, tier:)
  response = Client.post_request("storagezone", body: { Name: name, Region: region, ZoneTier: tier })
  StorageZone.new(response.body)
end

.delete(id:) ⇒ Object



23
24
25
# File 'lib/bunny/models/storage_zone.rb', line 23

def delete(id:)
  Client.delete_request("storagezone/#{id}")
end

.listObject



4
5
6
7
# File 'lib/bunny/models/storage_zone.rb', line 4

def list
  response = Client.get_request("storagezone")
  Collection.from_response(response, type: StorageZone)
end

.retrieve(id:) ⇒ Object



14
15
16
17
# File 'lib/bunny/models/storage_zone.rb', line 14

def retrieve(id:)
  response = Client.get_request("storagezone/#{id}")
  StorageZone.new(response.body)
end

.update(id:, **attributes) ⇒ Object



19
20
21
# File 'lib/bunny/models/storage_zone.rb', line 19

def update(id:, **attributes)
  Client.post_request("storagezone/#{id}", body: attributes)
end