Class: Google::Cloud::Spanner::Backup::Job Deprecated
- 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
Use the long-running operation returned by Admin::Database.database_admin.create_backup instead.
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.
100 101 102 103 104 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 100 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.
233 234 235 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 233 def cancel @grpc.cancel end |
#cancel_time ⇒ Time?
The operation canceled time.
267 268 269 270 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 267 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.
122 123 124 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 122 def done? @grpc.done? end |
#end_time ⇒ Time?
The operation end time.
258 259 260 261 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 258 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.
166 167 168 169 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 166 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.
142 143 144 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 142 def error? @grpc.error? end |
#progress_percent ⇒ Integer
The operation progress in percentage.
241 242 243 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 241 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.
191 192 193 194 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 191 def reload! @grpc.reload! self end |
#start_time ⇒ Time?
The operation start time.
249 250 251 252 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 249 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.
214 215 216 |
# File 'lib/google/cloud/spanner/backup/job.rb', line 214 def wait_until_done! @grpc.wait_until_done! end |