Skip to content

Commit

Permalink
Add documentation for SpannerDeployInstanceOperator (#8750)
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimbuddy committed May 7, 2020
1 parent 7c04604 commit 723c52c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions airflow/providers/google/cloud/operators/spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class SpannerDeployInstanceOperator(BaseOperator):
Creates a new Cloud Spanner instance, or if an instance with the same instance_id
exists in the specified project, updates the Cloud Spanner instance.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:SpannerDeployInstanceOperator`
:param instance_id: Cloud Spanner instance ID.
:type instance_id: str
:param configuration_name: The name of the Cloud Spanner instance configuration
Expand Down
38 changes: 38 additions & 0 deletions docs/howto/operator/gcp/spanner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,44 @@ Prerequisite Tasks

.. include:: _partials/prerequisite_tasks.rst

.. _howto/operator:SpannerDeployInstanceOperator:

SpannerDeployInstanceOperator
-----------------------------

Creates a new Cloud Spanner instance, or if an instance with the same instance id
exists in the specified project, updates the Cloud Spanner instance.

For parameter definition, take a look at
:class:`~airflow.providers.google.cloud.operators.spanner.SpannerDeployInstanceOperator`.

Using the operator
""""""""""""""""""
You can create the operator with or without project id. If project id is missing
it will be retrieved from the GCP connection used. Both variants are shown:

.. exampleinclude:: ../../../../airflow/providers/google/cloud/example_dags/example_spanner.py
:language: python
:dedent: 4
:start-after: [START howto_operator_spanner_deploy]
:end-before: [END howto_operator_spanner_deploy]

Templating
""""""""""

.. literalinclude:: ../../../../airflow/providers/google/cloud/operators/spanner.py
:language: python
:dedent: 4
:start-after: [START gcp_spanner_deploy_template_fields]
:end-before: [END gcp_spanner_deploy_template_fields]

More information
""""""""""""""""

See Google Cloud Spanner API documentation `to create a new instance
<https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instances/create>`_.


.. _howto/operator:SpannerDeleteDatabaseInstanceOperator:

SpannerDeleteDatabaseInstanceOperator
Expand Down

0 comments on commit 723c52c

Please sign in to comment.