GetRestoreSnapshotState()
Retrieves the state and progress of a restore-snapshot job.
pub async fn get_restore_snapshot_state(&self, request: GetRestoreSnapshotStateRequest) -> Result<GetRestoreSnapshotStateResponse>
Request Syntax
let request = GetRestoreSnapshotStateRequest::builder()
.job_id(job_id)
.build()?;
REQUEST FIELDS:
job_id: i64Identifier of the restore job, as returned by RestoreSnapshot. Must be greater than zero.
RETURN TYPE:
Result
RETURNS:
A GetRestoreSnapshotStateResponse containing the restore job information. Returns an Error if the operation fails.
GetRestoreSnapshotStateResponse
job_info() // -> &RestoreSnapshotJobInfo
METHODS:
job_info()(&RestoreSnapshotJobInfo) -The restore job information.
get_job_id()(i64) -The ID of the restore job.
get_snapshot_name()(&str) -The name of the snapshot being restored.
get_database_name()(&str) -The database that holds the restored collection.
get_collection_name()(&str) -The collection being restored.
get_state()(RestoreSnapshotStateCode) -The state of the restore job.
get_progress()(i32) -The progress of the restore job.
get_reason()(&str) -The failure reason, when the job failed.
get_start_time()(u64) -
- `get_time_cost()` (*u64*) -
Example
let request = GetRestoreSnapshotStateRequest::builder()
.job_id(job_id)
.build()?;
let resp = client.get_restore_snapshot_state(request).await?;
println!("state: {:?}, progress: {}", resp.job_info().get_state(), resp.job_info().get_progress());