Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
Public Member Functions | List of all members
google::cloud::spanner::v1::CreateInstanceRequestBuilder Class Reference

CreateInstanceRequestBuilder is a builder class for google::spanner::admin::instance::v1::CreateInstanceRequest More...

#include <google/cloud/spanner/create_instance_request_builder.h>

Public Member Functions

 CreateInstanceRequestBuilder (CreateInstanceRequestBuilder const &)=default
 
 CreateInstanceRequestBuilder (CreateInstanceRequestBuilder &&)=default
 
CreateInstanceRequestBuilderoperator= (CreateInstanceRequestBuilder const &)=default
 
CreateInstanceRequestBuilderoperator= (CreateInstanceRequestBuilder &&)=default
 
 CreateInstanceRequestBuilder (Instance const &in, std::string config)
 Constructor requires Instance and Cloud Spanner instance config name. More...
 
CreateInstanceRequestBuilderSetDisplayName (std::string display_name) &
 
CreateInstanceRequestBuilder && SetDisplayName (std::string display_name) &&
 
CreateInstanceRequestBuilderSetNodeCount (int node_count) &
 
CreateInstanceRequestBuilder && SetNodeCount (int node_count) &&
 
CreateInstanceRequestBuilderSetProcessingUnits (int processing_units) &
 
CreateInstanceRequestBuilder && SetProcessingUnits (int processing_units) &&
 
CreateInstanceRequestBuilderSetLabels (std::map< std::string, std::string > const &labels) &
 
CreateInstanceRequestBuilder && SetLabels (std::map< std::string, std::string > const &labels) &&
 
google::spanner::admin::instance::v1::CreateInstanceRequest & Build () &
 
google::spanner::admin::instance::v1::CreateInstanceRequest && Build () &&
 

Detailed Description

CreateInstanceRequestBuilder is a builder class for google::spanner::admin::instance::v1::CreateInstanceRequest

This is useful when calling the InstanceAdminClient::CreateInstance() function.

Example
std::string const& project_id,
std::string const& instance_id,
std::string const& display_name,
std::string const& config) {
namespace spanner = ::google::cloud::spanner;
spanner::Instance in(project_id, instance_id);
auto project = google::cloud::Project(project_id);
std::string instance_config =
project.FullName() + "/instanceConfigs/" + config;
auto instance =
client
.SetDisplayName(display_name)
.SetLabels({{"cloud_spanner_samples", "true"}})
.Build())
.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.
Definition: instance.h:42
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.
Definition: backup.cc:21

Definition at line 39 of file create_instance_request_builder.h.

Constructor & Destructor Documentation

◆ CreateInstanceRequestBuilder() [1/3]

google::cloud::spanner::v1::CreateInstanceRequestBuilder::CreateInstanceRequestBuilder ( CreateInstanceRequestBuilder const &  )
default

◆ CreateInstanceRequestBuilder() [2/3]

google::cloud::spanner::v1::CreateInstanceRequestBuilder::CreateInstanceRequestBuilder ( CreateInstanceRequestBuilder &&  )
default

◆ CreateInstanceRequestBuilder() [3/3]

google::cloud::spanner::v1::CreateInstanceRequestBuilder::CreateInstanceRequestBuilder ( Instance const &  in,
std::string  config 
)
inline

Constructor requires Instance and Cloud Spanner instance config name.

The display_name is set to a default value of in.instance_id().

Definition at line 53 of file create_instance_request_builder.h.

Member Function Documentation

◆ Build() [1/2]

google::spanner::admin::instance::v1::CreateInstanceRequest& google::cloud::spanner::v1::CreateInstanceRequestBuilder::Build ( ) &
inline

Definition at line 109 of file create_instance_request_builder.h.

◆ Build() [2/2]

google::spanner::admin::instance::v1::CreateInstanceRequest&& google::cloud::spanner::v1::CreateInstanceRequestBuilder::Build ( ) &&
inline

Definition at line 118 of file create_instance_request_builder.h.

◆ operator=() [1/2]

CreateInstanceRequestBuilder& google::cloud::spanner::v1::CreateInstanceRequestBuilder::operator= ( CreateInstanceRequestBuilder &&  )
default

◆ operator=() [2/2]

CreateInstanceRequestBuilder& google::cloud::spanner::v1::CreateInstanceRequestBuilder::operator= ( CreateInstanceRequestBuilder const &  )
default

◆ SetDisplayName() [1/2]

CreateInstanceRequestBuilder& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetDisplayName ( std::string  display_name) &
inline

Definition at line 61 of file create_instance_request_builder.h.

◆ SetDisplayName() [2/2]

CreateInstanceRequestBuilder&& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetDisplayName ( std::string  display_name) &&
inline

Definition at line 66 of file create_instance_request_builder.h.

◆ SetLabels() [1/2]

CreateInstanceRequestBuilder& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetLabels ( std::map< std::string, std::string > const &  labels) &
inline

Definition at line 91 of file create_instance_request_builder.h.

◆ SetLabels() [2/2]

CreateInstanceRequestBuilder&& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetLabels ( std::map< std::string, std::string > const &  labels) &&
inline

Definition at line 100 of file create_instance_request_builder.h.

◆ SetNodeCount() [1/2]

CreateInstanceRequestBuilder& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetNodeCount ( int  node_count) &
inline

Definition at line 71 of file create_instance_request_builder.h.

◆ SetNodeCount() [2/2]

CreateInstanceRequestBuilder&& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetNodeCount ( int  node_count) &&
inline

Definition at line 76 of file create_instance_request_builder.h.

◆ SetProcessingUnits() [1/2]

CreateInstanceRequestBuilder& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetProcessingUnits ( int  processing_units) &
inline

Definition at line 81 of file create_instance_request_builder.h.

◆ SetProcessingUnits() [2/2]

CreateInstanceRequestBuilder&& google::cloud::spanner::v1::CreateInstanceRequestBuilder::SetProcessingUnits ( int  processing_units) &&
inline

Definition at line 86 of file create_instance_request_builder.h.