Skip to content

Commit 723c52c

Browse files
authored
Add documentation for SpannerDeployInstanceOperator (#8750)
1 parent 7c04604 commit 723c52c

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

β€Žairflow/providers/google/cloud/operators/spanner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class SpannerDeployInstanceOperator(BaseOperator):
3131
Creates a new Cloud Spanner instance, or if an instance with the same instance_id
3232
exists in the specified project, updates the Cloud Spanner instance.
3333
34+
.. seealso::
35+
For more information on how to use this operator, take a look at the guide:
36+
:ref:`howto/operator:SpannerDeployInstanceOperator`
37+
3438
:param instance_id: Cloud Spanner instance ID.
3539
:type instance_id: str
3640
:param configuration_name: The name of the Cloud Spanner instance configuration

β€Ždocs/howto/operator/gcp/spanner.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,44 @@ Prerequisite Tasks
2929

3030
.. include:: _partials/prerequisite_tasks.rst
3131

32+
.. _howto/operator:SpannerDeployInstanceOperator:
33+
34+
SpannerDeployInstanceOperator
35+
-----------------------------
36+
37+
Creates a new Cloud Spanner instance, or if an instance with the same instance id
38+
exists in the specified project, updates the Cloud Spanner instance.
39+
40+
For parameter definition, take a look at
41+
:class:`~airflow.providers.google.cloud.operators.spanner.SpannerDeployInstanceOperator`.
42+
43+
Using the operator
44+
""""""""""""""""""
45+
You can create the operator with or without project id. If project id is missing
46+
it will be retrieved from the GCP connection used. Both variants are shown:
47+
48+
.. exampleinclude:: ../../../../airflow/providers/google/cloud/example_dags/example_spanner.py
49+
:language: python
50+
:dedent: 4
51+
:start-after: [START howto_operator_spanner_deploy]
52+
:end-before: [END howto_operator_spanner_deploy]
53+
54+
Templating
55+
""""""""""
56+
57+
.. literalinclude:: ../../../../airflow/providers/google/cloud/operators/spanner.py
58+
:language: python
59+
:dedent: 4
60+
:start-after: [START gcp_spanner_deploy_template_fields]
61+
:end-before: [END gcp_spanner_deploy_template_fields]
62+
63+
More information
64+
""""""""""""""""
65+
66+
See Google Cloud Spanner API documentation `to create a new instance
67+
<https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances/create>`_.
68+
69+
3270
.. _howto/operator:SpannerDeleteDatabaseInstanceOperator:
3371

3472
SpannerDeleteDatabaseInstanceOperator

0 commit comments

Comments
 (0)