示例#1
0
        /// <inheritdoc cref="ComputeApi.SnapshotVolumeAsync{T}" />
        public Task <VolumeSnapshot> SnapshotAsync(VolumeSnapshotDefinition snapshot = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (snapshot == null)
            {
                snapshot = new VolumeSnapshotDefinition();
            }

            snapshot.VolumeId = Id;

            var owner = this.GetOwnerOrThrow <ComputeApi>();

            return(owner.SnapshotVolumeAsync <VolumeSnapshot>(snapshot, cancellationToken));
        }
示例#2
0
        /// <inheritdoc cref="ComputeApi.SnapshotVolumeAsync{T}" />
        public Task<VolumeSnapshot> SnapshotAsync(VolumeSnapshotDefinition snapshot = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if(snapshot == null)
                snapshot = new VolumeSnapshotDefinition();

            snapshot.VolumeId = Id;

            var owner = this.GetOwnerOrThrow<ComputeApi>();
            return owner.SnapshotVolumeAsync<VolumeSnapshot>(snapshot, cancellationToken);
        }
 /// <inheritdoc cref="Volume.SnapshotAsync"/>
 public static VolumeSnapshot Snapshot(this Volume volume, VolumeSnapshotDefinition snapshot = null)
 {
     return volume.SnapshotAsync(snapshot).ForceSynchronous();
 }
示例#4
0
 /// <inheritdoc cref="ComputeApi.SnapshotVolumeAsync{T}" />
 public Task <VolumeSnapshot> SnapshotVolumeAsync(VolumeSnapshotDefinition snapshot, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(_computeApi.SnapshotVolumeAsync <VolumeSnapshot>(snapshot, cancellationToken));
 }
 /// <inheritdoc cref="ComputeService.SnapshotVolumeAsync" />
 public static VolumeSnapshot SnapshotVolume(this ComputeService service, VolumeSnapshotDefinition snapshot)
 {
     return service.SnapshotVolumeAsync(snapshot).ForceSynchronous();
 }