Class CreateInstanceRequestBuilder (2.16.0)
Stay organized with collections
Save and categorize content based on your preferences.
This is useful when calling the InstanceAdminClient::CreateInstance()
function.
Example
void CreateInstance(google::cloud::spanner_admin::InstanceAdminClient client,
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
.CreateInstance(spanner::CreateInstanceRequestBuilder(in, config_name)
.SetDisplayName(display_name)
.SetNodeCount(1)
.SetLabels({{"cloud_spanner_samples", "true"}})
.Build())
.get();
if (!instance) throw std::move(instance).status();
std::cout << "Created instance [" << in << "]:\n" << instance->DebugString();
}
Constructors
CreateInstanceRequestBuilder(CreateInstanceRequestBuilder const &)
Parameter |
Name |
Description |
|
CreateInstanceRequestBuilder const &
|
CreateInstanceRequestBuilder(CreateInstanceRequestBuilder &&)
Parameter |
Name |
Description |
|
CreateInstanceRequestBuilder &&
|
CreateInstanceRequestBuilder(Instance const &, std::string)
Constructor requires Instance and Cloud Spanner instance config name.
The display_name is set to a default value of in.instance_id().
Parameters |
Name |
Description |
in |
Instance const &
|
config |
std::string
|
Operators
operator=(CreateInstanceRequestBuilder const &)
Parameter |
Name |
Description |
|
CreateInstanceRequestBuilder const &
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder & |
|
operator=(CreateInstanceRequestBuilder &&)
Parameter |
Name |
Description |
|
CreateInstanceRequestBuilder &&
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder & |
|
Functions
SetDisplayName(std::string) &
Parameter |
Name |
Description |
display_name |
std::string
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder & |
|
SetDisplayName(std::string) &&
Parameter |
Name |
Description |
display_name |
std::string
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder && |
|
SetNodeCount(int) &
Parameter |
Name |
Description |
node_count |
int
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder & |
|
SetNodeCount(int) &&
Parameter |
Name |
Description |
node_count |
int
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder && |
|
SetProcessingUnits(int) &
Parameter |
Name |
Description |
processing_units |
int
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder & |
|
SetProcessingUnits(int) &&
Parameter |
Name |
Description |
processing_units |
int
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder && |
|
SetLabels(std::map< std::string, std::string > const &) &
Parameter |
Name |
Description |
labels |
std::map< std::string, std::string > const &
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder & |
|
SetLabels(std::map< std::string, std::string > const &) &&
Parameter |
Name |
Description |
labels |
std::map< std::string, std::string > const &
|
Returns |
Type |
Description |
CreateInstanceRequestBuilder && |
|
Build() &
Returns |
Type |
Description |
google::spanner::admin::instance::v1::CreateInstanceRequest & |
|
Build() &&
Returns |
Type |
Description |
google::spanner::admin::instance::v1::CreateInstanceRequest && |
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-10 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"last_modified": "Last updated 2024-08-10 UTC.",
"state": ""
}