Module: DeltacloudVM::Client::Methods::Bucket
- Included in:
- Blob, Bucket, Connection
- Defined in:
- lib/deltacloud_vm/client/methods/bucket.rb
Instance Method Summary collapse
-
#bucket(bucket_id) ⇒ Object
Retrieve the single bucket entity.
-
#buckets(filter_opts = {}) ⇒ Object
Retrieve list of all bucket entities.
-
#create_bucket(name) ⇒ Object
Create a new bucket.
-
#destroy_bucket(bucket_id) ⇒ Object
Destroy given bucket.
Instance Method Details
#bucket(bucket_id) ⇒ Object
Retrieve the single bucket entity
-
bucket_id -> Bucket entity to retrieve
34 35 36 37 |
# File 'lib/deltacloud_vm/client/methods/bucket.rb', line 34 def bucket(bucket_id) from_resource :bucket, connection.get(api_uri("buckets/#{bucket_id}")) end |
#buckets(filter_opts = {}) ⇒ Object
Retrieve list of all bucket entities
-
filter_opts:
-
:id -> Filter entities using ‘id’ attribute
-
25 26 27 28 |
# File 'lib/deltacloud_vm/client/methods/bucket.rb', line 25 def buckets(filter_opts={}) from_collection :buckets, connection.get(api_uri('buckets'), filter_opts) end |
#create_bucket(name) ⇒ Object
Create a new bucket
-
name: Bucket name
43 44 45 |
# File 'lib/deltacloud_vm/client/methods/bucket.rb', line 43 def create_bucket(name) create_resource :bucket, :name => name end |
#destroy_bucket(bucket_id) ⇒ Object
Destroy given bucket
49 50 51 |
# File 'lib/deltacloud_vm/client/methods/bucket.rb', line 49 def destroy_bucket(bucket_id) destroy_resource :bucket, bucket_id end |