@@ -141,32 +141,24 @@ Delete an instance using its
141141
142142 .. _check-on-current-instance-operation :
143143
144- Check on Current Instance Operation
145- -----------------------------------
144+ Resolve Current Instance Operation
145+ ----------------------------------
146146
147147The :meth: `~google.cloud.spanner.instance.Instance.create ` and
148148:meth: `~google.cloud.spanner.instance.Instance.update ` methods of instance
149149object trigger long-running operations on the server, and return instances
150150of the :class: `~google.cloud.spanner.instance.Operation ` class.
151151
152- You can check if a long-running operation has finished
153- by using its :meth: `~google.cloud.spanner.instance.Operation.finished `
154- method:
152+ If you want to block on the completion of those operations, use the
153+ ``result `` method on the returned objects:
155154
156155.. code :: python
157156
158157 >> > operation = instance.create()
159- >> > operation.finished()
160- True
158+ >> > result = operation.result()
161159
162- .. note ::
160+ This method will raise an exception if the operation fails.
163161
164- Once an :class: `~google.cloud.spanner.instance.Operation ` object
165- has returned :data: `True ` from its
166- :meth: `~google.cloud.spanner.instance.Operation.finished ` method, the
167- object should not be re-used. Subsequent calls to
168- :meth: `~google.cloud.spanner.instance.Operation.finished `
169- will result in an :exc`ValueError` being raised.
170162
171163Next Step
172164---------
0 commit comments