-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - Added BlobDirectoryUploadOptions and StorageTransferStatus
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
sdk/storage/Azure.Storage.Blobs/src/Models/BlobDirectoryUploadOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Azure.Storage.Blobs.Models | ||
using Metadata = System.Collections.Generic.IDictionary<string, string>; | ||
using Tags = System.Collections.Generic.IDictionary<string, string>; | ||
{ | ||
/// <summary> | ||
/// BlobDirectoryUploadOptions for | ||
/// </summary> | ||
public class BlobDirectoryUploadOptions | ||
{ | ||
/// <summary> | ||
/// Optional standard HTTP header properties that can be set for the | ||
/// new append blob. | ||
/// </summary> | ||
public BlobHttpHeaders HttpHeaders { get; set; } | ||
|
||
/// <summary> | ||
/// Optional custom metadata to set for this append blob. | ||
/// </summary> | ||
#pragma warning disable CA2227 // Collection properties should be readonly | ||
public Metadata Metadata { get; set; } | ||
#pragma warning restore CA2227 // Collection properties should be readonly | ||
|
||
/// <summary> | ||
/// Options tags to set for this block blob. | ||
/// </summary> | ||
#pragma warning disable CA2227 // Collection properties should be readonly | ||
public Tags Tags { get; set; } | ||
#pragma warning restore CA2227 // Collection properties should be readonly | ||
|
||
/// <summary> | ||
/// Optional <see cref="BlobRequestConditions"/> to add | ||
/// conditions on the upload of this Block Blob. | ||
/// </summary> | ||
public BlobRequestConditions Conditions { get; set; } | ||
|
||
/// <summary> | ||
/// Optional <see cref="IProgress{Long}"/> to provide | ||
/// progress updates about data transfers. | ||
/// </summary> | ||
public IProgress<StorageTransferStatus> ProgressHandler { get; set; } | ||
|
||
/// <summary> | ||
/// Optional <see cref="AccessTier"/> to set on the | ||
/// Block Blob. | ||
/// </summary> | ||
public AccessTier? AccessTier { get; set; } | ||
|
||
/// <summary> | ||
/// Optional <see cref="StorageTransferOptions"/> to configure | ||
/// parallel transfer behavior. | ||
/// </summary> | ||
public StorageTransferOptions TransferOptions { get; set; } | ||
/// <summary> | ||
/// Optional. If set to false, the operation will terminate quickly on encountering user failures. If true, the operation will ignore | ||
/// user failures and proceed with the operation on other sub-entities of the directory. | ||
/// | ||
/// This is after retry attempts fail. | ||
/// </summary> | ||
public bool? ContinueOnFailure { get; set; } | ||
} |
24 changes: 24 additions & 0 deletions
24
sdk/storage/Azure.Storage.Common/src/StorageTransferStatus.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Azure.Storage | ||
{ | ||
/// <summary> | ||
/// StorageTransferStatus keeps track of the transfer results | ||
/// </summary> | ||
public class StorageTransferStatus | ||
{ | ||
/// <summary> | ||
/// Bytes transferred. | ||
/// </summary> | ||
public long bytesTransferred { get; set; } | ||
|
||
/// <summary> | ||
/// Number of Files or Blobs tranferred. | ||
/// </summary> | ||
public long successfulTransfers { get; internal set; } | ||
|
||
// TODO: failures and skips | ||
} | ||
} |