Class: Google::Cloud::Spanner::Backup::Job
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Backup::Job
- Defined in:
- lib/google/cloud/spanner/backup/job.rb,
lib/google/cloud/spanner/backup/job/list.rb
Overview
Job
A resource representing the long-running, asynchronous processing of backup creation. The job can be refreshed to retrieve the backup object once the operation has been completed.
Defined Under Namespace
Classes: List
Instance Method Summary collapse
-
#backup ⇒ Backup?
The backup is the object of the operation.
-
#cancel ⇒ Object
Cancel the backup job.
-
#cancel_time ⇒ Time?
The operation canceled time.
-
#done? ⇒ boolean
Checks if the processing of the backup 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 backup operation has errored.
-
#progress_percent ⇒ Integer
The operation progress in percentage.
-
#reload! ⇒ Google::Cloud::Spanner::Backup::Job
(also: #refresh!)
Reloads the job with current data from the long-running, asynchronous processing of a backup operation.
-
#start_time ⇒ Time?
The operation start time.
-
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete.
Instance Method Details
#backup ⇒ Backup?
The backup is the object of the operation.
90 91 92 93 94 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 90 def backup return nil unless done? return nil unless @grpc.grpc_op.result == :response Backup.from_grpc @grpc.results, service end |
#cancel ⇒ Object
Cancel the backup job.
223 224 225 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 223 def cancel @grpc.cancel end |
#cancel_time ⇒ Time?
The operation canceled time.
257 258 259 260 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 257 def cancel_time return nil unless @grpc..cancel_time Convert. @grpc..cancel_time end |
#done? ⇒ boolean
Checks if the processing of the backup operation is complete.
112 113 114 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 112 def done? @grpc.done? end |
#end_time ⇒ Time?
The operation end time.
248 249 250 251 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 248 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.
156 157 158 159 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 156 def error return nil unless error? Google::Cloud::Spanner::Status.from_grpc @grpc.error end |
#error? ⇒ boolean
Checks if the processing of the backup operation has errored.
132 133 134 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 132 def error? @grpc.error? end |
#progress_percent ⇒ Integer
The operation progress in percentage.
231 232 233 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 231 def progress_percent @grpc..progress.progress_percent end |
#reload! ⇒ Google::Cloud::Spanner::Backup::Job Also known as: refresh!
Reloads the job with current data from the long-running, asynchronous processing of a backup operation.
181 182 183 184 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 181 def reload! @grpc.reload! self end |
#start_time ⇒ Time?
The operation start time.
239 240 241 242 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 239 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.
204 205 206 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 204 def wait_until_done! @grpc.wait_until_done! end |