diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/backup.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/backup.rb index c537a3296ed9..4dd4f98c5b9c 100644 --- a/google-cloud-bigtable/lib/google/cloud/bigtable/backup.rb +++ b/google-cloud-bigtable/lib/google/cloud/bigtable/backup.rb @@ -45,6 +45,7 @@ module Bigtable # # # Delete # backup.delete + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # class Backup # @private @@ -159,6 +160,7 @@ def expire_time # delete the backup and free the resources used by the backup. # # @param [Time] new_expire_time The new expiration time of the backup. + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def expire_time= new_expire_time @grpc.expire_time = Convert.time_to_timestamp new_expire_time @@ -278,6 +280,7 @@ def encryption_info # backup.policy do |p| # p.add "roles/owner", "user:owner@example.com" # end # 2 API calls + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def policy ensure_service! @@ -316,6 +319,7 @@ def policy # updated_policy = backup.update_policy policy # # puts updated_policy.roles + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def update_policy new_policy ensure_service! @@ -353,6 +357,7 @@ def update_policy new_policy # ) # permissions.include? "bigtable.backups.delete" #=> false # permissions.include? "bigtable.backups.get" #=> true + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def test_iam_permissions *permissions ensure_service! @@ -413,6 +418,7 @@ def test_iam_permissions *permissions # table = job.table # optimized = job.optimize_table_operation_name # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def restore table_id, instance: nil table_instance_id = instance.respond_to?(:instance_id) ? instance.instance_id : instance @@ -468,6 +474,7 @@ def restore table_id, instance: nil # else # backup = job.backup # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def copy dest_project_id:, dest_instance_id:, dest_cluster_id:, new_backup_id:, expire_time: grpc = service.copy_backup project_id: dest_project_id, @@ -498,6 +505,7 @@ def copy dest_project_id:, dest_instance_id:, dest_cluster_id:, new_backup_id:, # # Update # backup.expire_time = Time.now + 60 * 60 * 7 # backup.save + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def save ensure_service! @@ -510,6 +518,7 @@ def save # Reloads backup data. # # @return [Google::Cloud::Bigtable::Backup] + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def reload! @grpc = service.get_backup instance_id, cluster_id, backup_id @@ -531,6 +540,7 @@ def reload! # backup = cluster.backup "my-backup" # # backup.delete + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def delete ensure_service! diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/column_family.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/column_family.rb index 03b0a8dcc766..e3693bd735ab 100644 --- a/google-cloud-bigtable/lib/google/cloud/bigtable/column_family.rb +++ b/google-cloud-bigtable/lib/google/cloud/bigtable/column_family.rb @@ -35,6 +35,7 @@ module Bigtable # # column_family = table.column_families["cf2"] # puts column_family.gc_rule + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # class ColumnFamily ## diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/column_family_map.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/column_family_map.rb index 428963002be5..71f58c68c02a 100644 --- a/google-cloud-bigtable/lib/google/cloud/bigtable/column_family_map.rb +++ b/google-cloud-bigtable/lib/google/cloud/bigtable/column_family_map.rb @@ -74,6 +74,7 @@ module Bigtable # end # # puts table.column_families["cf3"] #=> nil + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # class ColumnFamilyMap include Enumerable @@ -202,6 +203,7 @@ def empty? # column_families.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600) # column_families.add "cf5", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5) # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def add name, positional_gc_rule = nil, gc_rule: nil raise ArgumentError, "column family #{name.inspect} already exists" if @column_families.has_key? name @@ -246,6 +248,7 @@ def add name, positional_gc_rule = nil, gc_rule: nil # # column_families.update "cf2", gc_rule: rule_union # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def update name, gc_rule: nil raise ArgumentError, "column family #{name.inspect} does not exist" unless @column_families.has_key? name @@ -275,6 +278,7 @@ def update name, gc_rule: nil # table.column_families do |column_families| # column_families.delete "cf3" # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def delete name raise ArgumentError, "column family #{name.inspect} does not exist" unless @column_families.has_key? name diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/gc_rule.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/gc_rule.rb index ad0e4ec58d51..c9419a4b6f20 100644 --- a/google-cloud-bigtable/lib/google/cloud/bigtable/gc_rule.rb +++ b/google-cloud-bigtable/lib/google/cloud/bigtable/gc_rule.rb @@ -63,6 +63,7 @@ module Bigtable # puts table.column_families["cf1"].gc_rule.max_versions # puts table.column_families["cf2"].gc_rule.max_age # puts table.column_families["cf3"].gc_rule.union + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # class GcRule # @private @@ -234,6 +235,7 @@ def union # table = bigtable.create_table "my-instance", "my-table" do |cfm| # cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5) # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def self.max_versions versions new.tap do |gc_rule| @@ -255,6 +257,7 @@ def self.max_versions versions # table = bigtable.create_table "my-instance", "my-table" do |cfm| # cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600) # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def self.max_age age new.tap do |gc_rule| @@ -281,6 +284,7 @@ def self.max_age age # ) # cfm.add "cf1", gc_rule: gc_rule # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def self.union *rules new.tap do |gc_rule| @@ -307,6 +311,7 @@ def self.union *rules # ) # cfm.add "cf1", gc_rule: gc_rule # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def self.intersection *rules new.tap do |gc_rule| diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/table.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/table.rb index a94c88195868..35443ba5b956 100644 --- a/google-cloud-bigtable/lib/google/cloud/bigtable/table.rb +++ b/google-cloud-bigtable/lib/google/cloud/bigtable/table.rb @@ -133,6 +133,7 @@ def path # * `:FULL` - Populates all fields. # # @return [Google::Cloud::Bigtable::Table] + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def reload! view: nil view ||= :SCHEMA_VIEW @@ -167,6 +168,7 @@ def reload! view: nil # puts cs.replication_state # puts cs.encryption_infos.first.encryption_type # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def cluster_states check_view_and_load :FULL, skip_if: [:ENCRYPTION_VIEW, :REPLICATION_VIEW] @@ -239,6 +241,7 @@ def cluster_states # end # # puts table.column_families["cf3"] #=> nil + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def column_families check_view_and_load :SCHEMA_VIEW @@ -263,6 +266,7 @@ def column_families # or `FULL`. Previously loaded data is retained. # # @return [Symbol] + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def granularity check_view_and_load :SCHEMA_VIEW @@ -273,6 +277,7 @@ def granularity # The table keeps data versioned at a granularity of 1 ms. # # @return [Boolean] + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def granularity_millis? granularity == :MILLIS @@ -311,6 +316,7 @@ def granularity_millis? # table.policy do |p| # p.add "roles/owner", "user:owner@example.com" # end # 2 API calls + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def policy ensure_service! @@ -347,6 +353,7 @@ def policy # updated_policy = table.update_policy policy # # puts updated_policy.roles + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def update_policy new_policy ensure_service! @@ -382,6 +389,7 @@ def update_policy new_policy # ) # permissions.include? "bigtable.tables.delete" #=> false # permissions.include? "bigtable.tables.get" #=> true + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def test_iam_permissions *permissions ensure_service! @@ -401,6 +409,7 @@ def test_iam_permissions *permissions # # table = bigtable.table "my-instance", "my-table" # table.delete + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def delete ensure_service! @@ -439,6 +448,7 @@ def delete # else # p "Table does not exist" # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def exists? !service.get_table(instance_id, name, view: :NAME_ONLY).nil? @@ -495,6 +505,7 @@ def self.create service, instance_id, table_id, column_families: nil, granularit # table = instance.table "my-table" # # table.generate_consistency_token # "l947XelENinaxJQP0nnrZJjHnAF7YrwW8HCJLotwrF" + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def generate_consistency_token ensure_service! @@ -522,6 +533,7 @@ def generate_consistency_token # if table.check_consistency token # puts "Replication is consistent" # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def check_consistency token ensure_service! @@ -558,6 +570,7 @@ def check_consistency token # if table.wait_for_replication timeout: 300, check_interval: 10 # puts "Replication done" # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def wait_for_replication timeout: 600, check_interval: 5 raise InvalidArgumentError, "'check_interval' cannot be greater than timeout" if check_interval > timeout @@ -593,6 +606,7 @@ def wait_for_replication timeout: 600, check_interval: 5 # # # With timeout # table.delete_all_rows timeout: 120 # 120 seconds. + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def delete_all_rows timeout: nil drop_row_range delete_all_data: true, timeout: timeout @@ -615,6 +629,7 @@ def delete_all_rows timeout: nil # # # With timeout # table.delete_rows_by_prefix "user-1", timeout: 120 # 120 seconds. + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def delete_rows_by_prefix prefix, timeout: nil drop_row_range row_key_prefix: prefix, timeout: timeout @@ -640,6 +655,7 @@ def delete_rows_by_prefix prefix, timeout: nil # # # Delete all data With timeout # table.drop_row_range delete_all_data: true, timeout: 120 # 120 seconds. + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # def drop_row_range row_key_prefix: nil, delete_all_data: nil, timeout: nil ensure_service! diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/table/cluster_state.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/table/cluster_state.rb index 21973156e2d8..eb280819e33c 100644 --- a/google-cloud-bigtable/lib/google/cloud/bigtable/table/cluster_state.rb +++ b/google-cloud-bigtable/lib/google/cloud/bigtable/table/cluster_state.rb @@ -38,6 +38,7 @@ class Table # puts cs.replication_state # puts cs.encryption_infos.first.encryption_type # end + # @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead. # class ClusterState attr_reader :cluster_name