Class: Google::Cloud::Bigtable::Instance::ClusterMap
- Inherits:
-
Hash
- Object
- Hash
- Google::Cloud::Bigtable::Instance::ClusterMap
- Defined in:
- lib/google/cloud/bigtable/instance/cluster_map.rb
Overview
Instance::ClusterMap is a hash with cluster ID keys and cluster configuration values. It is used to create a cluster.
Instance Method Summary collapse
-
#add(name, location, nodes: nil, storage_type: nil, kms_key: nil) ⇒ Object
Adds a cluster to the cluster map.
Instance Method Details
#add(name, location, nodes: nil, storage_type: nil, kms_key: nil) ⇒ Object
Adds a cluster to the cluster map.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/google/cloud/bigtable/instance/cluster_map.rb', line 95 def add name, location, nodes: nil, storage_type: nil, kms_key: nil if kms_key encryption_config = Google::Cloud::Bigtable::Admin::V2::Cluster::EncryptionConfig.new( kms_key_name: kms_key ) end attrs = { serve_nodes: nodes, location: location, default_storage_type: storage_type, encryption_config: encryption_config }.compact self[name] = Google::Cloud::Bigtable::Admin::V2::Cluster.new attrs end |