Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
google::cloud::spanner::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 () &&
 

Friends

bool operator== (CreateInstanceRequestBuilder const &a, CreateInstanceRequestBuilder const &b) noexcept
 
bool operator!= (CreateInstanceRequestBuilder const &a, CreateInstanceRequestBuilder const &b) noexcept
 

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_id) {
namespace spanner = ::google::cloud::spanner;
spanner::Instance in(project_id, instance_id);
auto project = google::cloud::Project(project_id);
std::string config_name =
project.FullName() + "/instanceConfigs/" + config_id;
auto instance =
client
.SetDisplayName(display_name)
.SetLabels({{"cloud_spanner_samples", "true"}})
.Build())
.get();
if (!instance) throw std::move(instance).status();
std::cout << "Created instance [" << in << "]:\n" << instance->DebugString();
}
CreateInstanceRequestBuilder is a builder class for google::spanner::admin::instance::v1::CreateInsta...
Definition: create_instance_request_builder.h:40
CreateInstanceRequestBuilder & SetNodeCount(int node_count) &
Definition: create_instance_request_builder.h:82
CreateInstanceRequestBuilder & SetLabels(std::map< std::string, std::string > const &labels) &
Definition: create_instance_request_builder.h:102
google::spanner::admin::instance::v1::CreateInstanceRequest & Build() &
Definition: create_instance_request_builder.h:120
CreateInstanceRequestBuilder & SetDisplayName(std::string display_name) &
Definition: create_instance_request_builder.h:72
This class identifies a Cloud Spanner Instance.
Definition: instance.h:42
Cloud Spanner Instance Admin API.
Definition: instance_admin_client.h:84
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, Options opts={})
Creates an instance and begins preparing it to begin serving.

Constructor & Destructor Documentation

◆ CreateInstanceRequestBuilder() [1/3]

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

◆ CreateInstanceRequestBuilder() [2/3]

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

◆ CreateInstanceRequestBuilder() [3/3]

google::cloud::spanner::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().

Member Function Documentation

◆ Build() [1/2]

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

◆ Build() [2/2]

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ SetDisplayName() [1/2]

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

◆ SetDisplayName() [2/2]

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

◆ SetLabels() [1/2]

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

◆ SetLabels() [2/2]

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

◆ SetNodeCount() [1/2]

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

◆ SetNodeCount() [2/2]

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

◆ SetProcessingUnits() [1/2]

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

◆ SetProcessingUnits() [2/2]

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

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( CreateInstanceRequestBuilder const &  a,
CreateInstanceRequestBuilder const &  b 
)
friend

◆ operator==

bool operator== ( CreateInstanceRequestBuilder const &  a,
CreateInstanceRequestBuilder const &  b 
)
friend