Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,14 @@ public BlockBlobClient(System.Uri blobUri, Azure.Storage.StorageSharedKeyCredent
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>> StageBlockAsync(string base64BlockId, System.IO.Stream content, byte[] transactionalContentHash = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.IProgress<long> progressHandler = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlockInfo> StageBlockFromUri(System.Uri sourceUri, string base64BlockId, Azure.HttpRange sourceRange = default(Azure.HttpRange), byte[] sourceContentHash = null, Azure.RequestConditions sourceConditions = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlockInfo>> StageBlockFromUriAsync(System.Uri sourceUri, string base64BlockId, Azure.HttpRange sourceRange = default(Azure.HttpRange), byte[] sourceContentHash = null, Azure.RequestConditions sourceConditions = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> SyncUploadFromUri(System.Uri copySource, Azure.Storage.Blobs.Models.BlobUploadFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> SyncUploadFromUriAsync(System.Uri copySource, Azure.Storage.Blobs.Models.BlobUploadFromUriOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> SyncUploadFromUri(System.Uri copySource) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> SyncUploadFromUri(System.Uri copySource, Azure.Storage.Blobs.Models.BlobUploadFromUriOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> SyncUploadFromUri(System.Uri copySource, bool overwrite = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> SyncUploadFromUri(System.Uri copySource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> SyncUploadFromUriAsync(System.Uri copySource) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> SyncUploadFromUriAsync(System.Uri copySource, Azure.Storage.Blobs.Models.BlobUploadFromUriOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> SyncUploadFromUriAsync(System.Uri copySource, bool overwrite = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> SyncUploadFromUriAsync(System.Uri copySource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload(System.IO.Stream content, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string, string> metadata = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, Azure.Storage.Blobs.Models.AccessTier? accessTier = default(Azure.Storage.Blobs.Models.AccessTier?), System.IProgress<long> progressHandler = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload(System.IO.Stream content, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down
225 changes: 223 additions & 2 deletions sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,227 @@ private async Task<Stream> OpenWriteInternal(
#endregion OpenWrite

#region UploadFromUri
/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
///
/// Partial updates are not supported with Put Blob from URL; the content of an existing blob is
/// overwritten with the content of the new blob. To perform partial updates to a block blob’s
/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.
/// </summary>
/// <param name="copySource">
/// Required. Specifies the URL of the source blob. The source blob may be of any type,
/// including a block blob, append blob, or page blob. The value may be a URL of up to 2
/// KiB in length that specifies a blob. The value should be URL-encoded as it would appear
/// in a request URI. The source blob must either be public or must be authorized via a
/// shared access signature. If the source blob is public, no authorization is required
/// to perform the operation.
/// </param>
/// <returns>
/// A <see cref="Response{BlobContentInfo}"/> describing the
/// state of the updated block blob.
/// </returns>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual Response<BlobContentInfo> SyncUploadFromUri(Uri copySource)
=> SyncUploadFromUri(
copySource,
overwrite: false,
CancellationToken.None);

/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
///
/// Partial updates are not supported with Put Blob from URL; the content of an existing blob is
/// overwritten with the content of the new blob. To perform partial updates to a block blob’s
/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.
/// </summary>
/// <param name="copySource">
/// Required. Specifies the URL of the source blob. The source blob may be of any type,
/// including a block blob, append blob, or page blob. The value may be a URL of up to 2
/// KiB in length that specifies a blob. The value should be URL-encoded as it would appear
/// in a request URI. The source blob must either be public or must be authorized via a
/// shared access signature. If the source blob is public, no authorization is required
/// to perform the operation.
/// </param>
/// <returns>
/// A <see cref="Response{BlobContentInfo}"/> describing the
/// state of the updated block blob.
/// </returns>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual async Task<Response<BlobContentInfo>> SyncUploadFromUriAsync(Uri copySource)
=> await SyncUploadFromUriAsync(
copySource,
CancellationToken.None)
.ConfigureAwait(false);

/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
///
/// Partial updates are not supported with Put Blob from URL; the content of an existing blob is
/// overwritten with the content of the new blob. To perform partial updates to a block blob’s
/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.
/// </summary>
/// <param name="copySource">
/// Required. Specifies the URL of the source blob. The source blob may be of any type,
/// including a block blob, append blob, or page blob. The value may be a URL of up to 2
/// KiB in length that specifies a blob. The value should be URL-encoded as it would appear
/// in a request URI. The source blob must either be public or must be authorized via a
/// shared access signature. If the source blob is public, no authorization is required
/// to perform the operation.
/// </param>
/// <param name="cancellationToken">
/// Optional <see cref="CancellationToken"/> to propagate
/// notifications that the operation should be cancelled.
/// </param>
/// <returns>
/// A <see cref="Response{BlobContentInfo}"/> describing the
/// state of the updated block blob.
/// </returns>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual Response<BlobContentInfo> SyncUploadFromUri(
Uri copySource,
CancellationToken cancellationToken = default)
=> SyncUploadFromUri(
copySource,
overwrite: false,
cancellationToken);

/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
///
/// Partial updates are not supported with Put Blob from URL; the content of an existing blob is
/// overwritten with the content of the new blob. To perform partial updates to a block blob’s
/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.
/// </summary>
/// <param name="copySource">
/// Required. Specifies the URL of the source blob. The source blob may be of any type,
/// including a block blob, append blob, or page blob. The value may be a URL of up to 2
/// KiB in length that specifies a blob. The value should be URL-encoded as it would appear
/// in a request URI. The source blob must either be public or must be authorized via a
/// shared access signature. If the source blob is public, no authorization is required
/// to perform the operation.
/// </param>
/// <param name="cancellationToken">
/// Optional <see cref="CancellationToken"/> to propagate
/// notifications that the operation should be cancelled.
/// </param>
/// <returns>
/// A <see cref="Response{BlobContentInfo}"/> describing the
/// state of the updated block blob.
/// </returns>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual async Task<Response<BlobContentInfo>> SyncUploadFromUriAsync(
Uri copySource,
CancellationToken cancellationToken = default)
=> await SyncUploadFromUriAsync(
copySource,
overwrite: false,
cancellationToken)
.ConfigureAwait(false);

/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
///
/// Partial updates are not supported with Put Blob from URL; the content of an existing blob is
/// overwritten with the content of the new blob. To perform partial updates to a block blob’s
/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.
/// </summary>
/// <param name="copySource">
/// Required. Specifies the URL of the source blob. The source blob may be of any type,
/// including a block blob, append blob, or page blob. The value may be a URL of up to 2
/// KiB in length that specifies a blob. The value should be URL-encoded as it would appear
/// in a request URI. The source blob must either be public or must be authorized via a
/// shared access signature. If the source blob is public, no authorization is required
/// to perform the operation.
/// </param>
/// <param name="overwrite">
/// Whether the upload should overwrite the existing blob. The
/// default value is false.
/// </param>
/// <param name="cancellationToken">
/// Optional <see cref="CancellationToken"/> to propagate
/// notifications that the operation should be cancelled.
/// </param>
/// <returns>
/// A <see cref="Response{BlobContentInfo}"/> describing the
/// state of the updated block blob.
/// </returns>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual Response<BlobContentInfo> SyncUploadFromUri(
Uri copySource,
bool overwrite = false,
CancellationToken cancellationToken = default)
=> SyncUploadFromUriInternal(
copySource,
overwrite ? null : new BlobUploadFromUriOptions{ DestinationConditions = new BlobRequestConditions
{ IfNoneMatch = new ETag(Constants.Wildcard) } },
async: false,
cancellationToken)
.EnsureCompleted();

/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
///
/// Partial updates are not supported with Put Blob from URL; the content of an existing blob is
/// overwritten with the content of the new blob. To perform partial updates to a block blob’s
/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List.
/// </summary>
/// <param name="copySource">
/// Required. Specifies the URL of the source blob. The source blob may be of any type,
/// including a block blob, append blob, or page blob. The value may be a URL of up to 2
/// KiB in length that specifies a blob. The value should be URL-encoded as it would appear
/// in a request URI. The source blob must either be public or must be authorized via a
/// shared access signature. If the source blob is public, no authorization is required
/// to perform the operation.
/// </param>
/// <param name="overwrite">
/// Whether the upload should overwrite the existing blob. The
/// default value is false.
/// </param>
/// <param name="cancellationToken">
/// Optional <see cref="CancellationToken"/> to propagate
/// notifications that the operation should be cancelled.
/// </param>
/// <returns>
/// A <see cref="Response{BlobContentInfo}"/> describing the
/// state of the updated block blob.
/// </returns>
/// <remarks>
/// A <see cref="RequestFailedException"/> will be thrown if
/// a failure occurs.
/// </remarks>
public virtual async Task<Response<BlobContentInfo>> SyncUploadFromUriAsync(
Uri copySource,
bool overwrite = false,
CancellationToken cancellationToken = default)
=> await SyncUploadFromUriInternal(
copySource,
overwrite ? null : new BlobUploadFromUriOptions { DestinationConditions = new BlobRequestConditions
{ IfNoneMatch = new ETag(Constants.Wildcard) } },
async: true,
cancellationToken)
.ConfigureAwait(false);

/// <summary>
/// The Upload from Uri operation creates a new Block Blob where the contents of the
/// blob are read from a given URL. This API is supported beginning with the 2020-04-08 version.
Expand Down Expand Up @@ -2194,7 +2415,7 @@ private async Task<Stream> OpenWriteInternal(
/// </remarks>
public virtual Response<BlobContentInfo> SyncUploadFromUri(
Uri copySource,
BlobUploadFromUriOptions options = default,
BlobUploadFromUriOptions options,
CancellationToken cancellationToken = default)
=> SyncUploadFromUriInternal(
copySource,
Expand Down Expand Up @@ -2236,7 +2457,7 @@ public virtual Response<BlobContentInfo> SyncUploadFromUri(
/// </remarks>
public virtual async Task<Response<BlobContentInfo>> SyncUploadFromUriAsync(
Uri copySource,
BlobUploadFromUriOptions options = default,
BlobUploadFromUriOptions options,
CancellationToken cancellationToken = default)
=> await SyncUploadFromUriInternal(
copySource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Azure.Storage.Blobs.Models
{
/// <summary>
/// Optional parameters for <see cref="BlockBlobClient.SyncUploadFromUri"/>.
/// Optional parameters for <see cref="BlockBlobClient.SyncUploadFromUri(Uri)"/>.
/// </summary>
public class BlobUploadFromUriOptions
{
Expand Down
Loading