spanner/database_leader_placement_samples.rb
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing software distributed under the License is distributed on an " AS IS " BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied . See the License for the specific language governing permissions and limitations under the License .
def instance_config project_id:, instance_config_id:
  require "google/cloud/spanner"
  instance_admin_client = \
    Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new
  instance_config_path = instance_admin_client.instance_config_path \
    project: project_id, instance_config: instance_config_id
  config = instance_admin_client.get_instance_config name: instance_config_path
  puts "Available leader options for instance config #{config.name} : #{config.leader_options}"
end
def instance_config project_id : , instance_config_id : require "google/cloud/spanner" instance_admin_client = Google :: Cloud :: Spanner :: Admin :: Instance :: V1 :: InstanceAdmin :: Client . new instance_config_path = instance_admin_client . instance_config_path project : project_id , instance_config : instance_config_id config = instance_admin_client . get_instance_config name : instance_config_path puts "Available leader options for instance config #{config.name} : #{config.leader_options}" end
Copyright 2021 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Copyright 2021 Google LLC Licensed under the Apache License Version 2 . 0 ( the " License " ) ; you may not use this file except in compliance with the License .
# [START spanner_get_instance_config] # project_id  = "Your Google Cloud project ID" # instance_config_id = "Spanner instance config ID" # [END spanner_get_instance_config]
project_id
<not_specific>
instance_config_id
<not_specific>