Class: Google::Cloud::Spanner::Backup::Restore::Job Deprecated
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Backup::Restore::Job
- Defined in:
- lib/google/cloud/spanner/backup/restore/job.rb
Overview
Use the long-running operation returned by
Job
A resource representing the long-running, asynchronous processing of a backup restore. The job can be refreshed to retrieve the restored database object once the operation has been completed.
See Google::Cloud::Spanner::Backup#restore
Client#restore_database instead.
Instance Method Summary collapse
-
#database ⇒ Database?
The database is the object of the operation.
-
#done? ⇒ boolean
Checks if the processing of the restore operation is complete.
-
#end_time ⇒ Time?
The operation end time.
-
#error ⇒ Google::Cloud::Spanner::Status?
The status if the operation associated with this job produced an error.
-
#error? ⇒ boolean
Checks if the processing of the restore operation has errored.
-
#progress_percent ⇒ Integer
The operation progress in percentage.
-
#reload! ⇒ Backup::Job
(also: #refresh!)
Reloads the job with current data from the long-running, asynchronous processing of a restore operation.
-
#start_time ⇒ Time?
The operation start time.
-
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete.
Instance Method Details
#database ⇒ Database?
The database is the object of the operation.
97 98 99 100 101 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 97 def database return nil unless done? return nil unless @grpc.grpc_op.result == :response Database.from_grpc @grpc.results, service end |
#done? ⇒ boolean
Checks if the processing of the restore operation is complete.
119 120 121 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 119 def done? @grpc.done? end |
#end_time ⇒ Time?
The operation end time.
235 236 237 238 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 235 def end_time return nil unless @grpc..progress.end_time Convert. @grpc..progress.end_time end |
#error ⇒ Google::Cloud::Spanner::Status?
The status if the operation associated with this job produced an error.
163 164 165 166 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 163 def error return nil unless error? Google::Cloud::Spanner::Status.from_grpc @grpc.error end |
#error? ⇒ boolean
Checks if the processing of the restore operation has errored.
139 140 141 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 139 def error? @grpc.error? end |
#progress_percent ⇒ Integer
The operation progress in percentage.
218 219 220 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 218 def progress_percent @grpc..progress.progress_percent end |
#reload! ⇒ Backup::Job Also known as: refresh!
Reloads the job with current data from the long-running, asynchronous processing of a restore operation.
187 188 189 190 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 187 def reload! @grpc.reload! self end |
#start_time ⇒ Time?
The operation start time.
226 227 228 229 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 226 def start_time return nil unless @grpc..progress.start_time Convert. @grpc..progress.start_time end |
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete. The delay between reloads will incrementally increase.
210 211 212 |
# File 'lib/google/cloud/spanner/backup/restore/job.rb', line 210 def wait_until_done! @grpc.wait_until_done! end |