-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathVolumeExtensions.cs
More file actions
52 lines (45 loc) · 2.35 KB
/
Copy pathVolumeExtensions.cs
File metadata and controls
52 lines (45 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using OpenStack.BlockStorage.v2;
using OpenStack.Compute.v2_1;
using OpenStack.Synchronous.Extensions;
// ReSharper disable once CheckNamespace
namespace OpenStack.Synchronous
{
/// <summary>
/// Provides synchronous extention methods for a <see cref="Volume"/> instance.
/// </summary>
public static class VolumeExtensions_v2_1
{
/// <inheritdoc cref="Volume.SnapshotAsync"/>
public static VolumeSnapshot Snapshot(this Volume volume, VolumeSnapshotDefinition snapshot = null)
{
return volume.SnapshotAsync(snapshot).ForceSynchronous();
}
/// <inheritdoc cref="Volume.DeleteAsync"/>
public static void Delete(this Volume volume)
{
volume.DeleteAsync().ForceSynchronous();
}
/// <inheritdoc cref="Volume.WaitForStatusAsync(VolumeStatus,TimeSpan?,TimeSpan?,IProgress{bool},System.Threading.CancellationToken)"/>
public static void WaitForStatus(this Volume volume, VolumeStatus status, TimeSpan? refreshDelay = null, TimeSpan? timeout = null, IProgress<bool> progress = null)
{
volume.WaitForStatusAsync(status, refreshDelay, timeout, progress).ForceSynchronous();
}
/// <inheritdoc cref="Volume.WaitForStatusAsync(IEnumerable{VolumeStatus},TimeSpan?,TimeSpan?,IProgress{bool},System.Threading.CancellationToken)"/>
public static void WaitForStatus(this Volume volume, IEnumerable<VolumeStatus> status, TimeSpan? refreshDelay = null, TimeSpan? timeout = null, IProgress<bool> progress = null)
{
volume.WaitForStatusAsync(status, refreshDelay, timeout, progress).ForceSynchronous();
}
/// <inheritdoc cref="Volume.WaitUntilAvailableAsync"/>
public static void WaitUntilAvailable(this Volume volume, TimeSpan? refreshDelay = null, TimeSpan? timeout = null, IProgress<bool> progress = null)
{
volume.WaitUntilAvailableAsync(refreshDelay, timeout, progress).ForceSynchronous();
}
/// <inheritdoc cref="Volume.WaitUntilDeletedAsync"/>
public static void WaitUntilDeleted(this Volume volume, TimeSpan? refreshDelay = null, TimeSpan? timeout = null, IProgress<bool> progress = null)
{
volume.WaitUntilDeletedAsync(refreshDelay, timeout, progress).ForceSynchronous();
}
}
}