Class: Couchbase::Protostellar::ResponseConverter::Admin::Bucket Private

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/protostellar/response_converter/admin/bucket.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

BUCKET_TYPE_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RequestGenerator::Admin::Bucket::BUCKET_TYPE_MAP.invert.freeze
EVICTION_MODE_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RequestGenerator::Admin::Bucket::EVICTION_MODE_MAP.invert.freeze
COMPRESSION_MODE_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RequestGenerator::Admin::Bucket::COMPRESSION_MODE_MAP.invert.freeze
STORAGE_BACKEND_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RequestGenerator::Admin::Bucket::STORAGE_BACKEND_MAP.invert.freeze
CONFLICT_RESOLUTION_TYPE_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RequestGenerator::Admin::Bucket::CONFLICT_RESOLUTION_TYPE_MAP.invert.freeze
DURABILITY_LEVEL_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RequestGenerator::Admin::Bucket::DURABILITY_LEVEL_MAP.invert.freeze

Class Method Summary collapse

Class Method Details

.to_bucket_settings_array(resp) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/couchbase/protostellar/response_converter/admin/bucket.rb', line 33

def self.to_bucket_settings_array(resp)
  resp.buckets.map do |r|
    Couchbase::Management::BucketSettings.new do |b|
      b.name = r.bucket_name
      b.flush_enabled = r.flush_enabled
      b.ram_quota_mb = r.ram_quota_mb
      b.num_replicas = r.num_replicas
      b.replica_indexes = r.replica_indexes
      b.bucket_type = BUCKET_TYPE_MAP[r.bucket_type]
      b.max_expiry = r.max_expiry_secs
      b.eviction_policy = EVICTION_MODE_MAP[r.eviction_mode]
      b.minimum_durability_level = DURABILITY_LEVEL_MAP[r.minimum_durability_level]
      b.compression_mode = COMPRESSION_MODE_MAP[r.compression_mode]
      b.conflict_resolution_type = CONFLICT_RESOLUTION_TYPE_MAP[r.conflict_resolution_type]
      b.storage_backend = STORAGE_BACKEND_MAP[r.storage_backend]
    end
  end
end