std::string const& project_id,
std::string const& instance_id,
std::string const& display_name,
std::string const& config) {
namespace spanner = ::google::cloud::spanner;
auto project = google::cloud::Project(project_id);
std::string instance_config =
project.FullName() + "/instanceConfigs/" + config;
auto instance =
client
.
SetLabels({{
"cloud_spanner_samples",
"true"}})
.get();
if (!instance) throw std::runtime_error(instance.status().message());
std::cout << "Created instance [" << in << "]:\n" << instance->DebugString();
}
CreateInstanceRequestBuilder is a builder class for google::spanner::admin::instance::v1::CreateInsta...
CreateInstanceRequestBuilder & SetLabels(std::map< std::string, std::string > const &labels) &
CreateInstanceRequestBuilder & SetDisplayName(std::string display_name) &
google::spanner::admin::instance::v1::CreateInstanceRequest & Build() &
CreateInstanceRequestBuilder & SetNodeCount(int node_count) &
This class identifies a Cloud Spanner Instance.
Cloud Spanner Instance Admin API.
future< StatusOr< google::spanner::admin::instance::v1::Instance > > CreateInstance(std::string const &parent, std::string const &instance_id, google::spanner::admin::instance::v1::Instance const &instance)
Creates an instance and begins preparing it to begin serving.
Contains all the Cloud Spanner C++ client types and functions.