Wrap long-running operations returned from Google Cloud APIs.
Operation(name, client, pb_metadata=None, **kw)#
Representation of a Google API Long-Running Operation.
Has the operation already completed?
Return type: bool Returns: True if already completed, else false.
from_pb(op_pb, client, **kw)#
Factory: construct an instance from a protobuf.
- op_pb (
google.longrunning.operations_pb2.Operation) – Protobuf to be parsed.
- client (object: must provide
_operations_stubaccessor.) – The client used to poll for the status of the operation.
- kw (dict) – caller-assigned metadata about the operation
Return type: Returns:
new instance, with attributes based on the protobuf.
- op_pb (
Check if the operation has finished.
Return type: bool Returns: A boolean indicating if the current operation has completed. Raises:
ValueErrorif the operation has already completed.
Instance assocated with the operations: callers may set.