- NAME
-
- gcloud spanner samples run - run the given Cloud Spanner sample app
- SYNOPSIS
-
-
gcloud spanner samples run
APPNAME
--instance-id
=INSTANCE_ID
[--no-cleanup
] [--database-id
=DATABASE_ID
] [--duration
=DURATION
; default="1h"] [--skip-init
] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
-
Each Cloud Spanner sample application includes a backend gRPC service backed by
a Cloud Spanner database and a workload script that generates service traffic.
This command creates and initializes the Cloud Spanner database and runs both
the backend service and workload script.
These sample apps are open source and available at https://github.com/GoogleCloudPlatform/cloud-spanner-samples.
To see a list of available sample apps, run:
gcloud spanner samples list
- EXAMPLES
-
To run the 'finance' sample app using instance 'my-instance', run:
gcloud spanner samples run finance --instance-id=my-instance
- POSITIONAL ARGUMENTS
-
APPNAME
- The sample app name, e.g. "finance".
- REQUIRED FLAGS
-
--instance-id
=INSTANCE_ID
- The Cloud Spanner instance ID for the sample app.
- OPTIONAL FLAGS
-
--cleanup
-
Delete the instance after running the sample app. Enabled by default, use
--no-cleanup
to disable. --database-id
=DATABASE_ID
- ID of the new Cloud Spanner database to create for the sample app.
--duration
=DURATION
; default="1h"- Duration of time allowed to run the sample app before stopping the service.
--skip-init
- Use an existing database instead of creating a new one.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file
,--account
,--billing-project
,--configuration
,--flags-file
,--flatten
,--format
,--help
,--impersonate-service-account
,--log-http
,--project
,--quiet
,--trace-token
,--user-output-enabled
,--verbosity
.Run
$ gcloud help
for details. - NOTES
-
These variants are also available:
gcloud alpha spanner samples run
gcloud beta spanner samples run
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-02-06 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"
}]
{
"lastModified": "Last updated 2024-02-06 UTC.",
"confidential": False
}