Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

output copyid in verbose stream

  • Loading branch information...
commit 4ae8149f6fa93e4693f183e570bae2f83c15c3c7 1 parent 75de9d7
Yao xmbms authored
24 WindowsAzurePowershell/src/Management.Storage/Blob/Cmdlet/StartCopyAzureStorageBlob.cs
View
@@ -331,15 +331,17 @@ private ICloudBlob StartCopyInTransferManager(ICloudBlob blob, CloudBlobContaine
ValidateContainerName(destContainer.Name);
ValidateBlobName(destBlobName);
- ICloudBlob destBlob = GetDestinationBlobWithCopyId(destContainer, destBlobName, false);
+ ICloudBlob destBlob = GetDestinationBlobWithCopyId(destContainer, destBlobName);
if (destBlob != null && !overwrite && !ConfirmOverwrite(destBlob.Name))
{
return null;
}
- Action<BlobTransferManager> taskAction = (transferManager) => transferManager.QueueBlobStartCopy(blob, destContainer, destBlobName, null, OnTaskFinish, null);
+ currentCopyId = string.Empty;
+ Action<BlobTransferManager> taskAction = (transferManager) => transferManager.QueueBlobStartCopy(blob, destContainer, destBlobName, null, OnCopyTaskFinish, null);
StartSyncTaskInTransferManager(taskAction);
+ WriteVerboseWithTimestamp(String.Format(Resources.CopyDestinationBlobPending, destBlobName, destContainer.Name, currentCopyId));
return GetDestinationBlobWithCopyId(destContainer, destBlobName);
}
@@ -355,15 +357,18 @@ private ICloudBlob StartCopyInTransferManager(Uri uri, CloudBlobContainer destCo
ValidateContainerName(destContainer.Name);
ValidateBlobName(destBlobName);
- ICloudBlob destBlob = GetDestinationBlobWithCopyId(destContainer, destBlobName, false);
+ ICloudBlob destBlob = GetDestinationBlobWithCopyId(destContainer, destBlobName);
if (destBlob != null && !ConfirmOverwrite(destBlob.Name))
{
return null;
}
- Action<BlobTransferManager> taskAction = (transferManager) => transferManager.QueueBlobStartCopy(uri, destContainer, destBlobName, null, OnTaskFinish, null);
+ currentCopyId = string.Empty;
+
+ Action<BlobTransferManager> taskAction = (transferManager) => transferManager.QueueBlobStartCopy(uri, destContainer, destBlobName, null, OnCopyTaskFinish, null);
StartSyncTaskInTransferManager(taskAction);
+ WriteVerboseWithTimestamp(String.Format(Resources.CopyDestinationBlobPending, destBlobName, destContainer.Name, currentCopyId));
return GetDestinationBlobWithCopyId(destContainer, destBlobName);
}
@@ -374,22 +379,15 @@ private ICloudBlob StartCopyInTransferManager(Uri uri, CloudBlobContainer destCo
/// <param name="blobName">Blob name</param>
/// <param name="copyId">Current CopyId</param>
/// <returns>Destination ICloudBlob object</returns>
- private ICloudBlob GetDestinationBlobWithCopyId(CloudBlobContainer container, string blobName, bool output = true)
+ private ICloudBlob GetDestinationBlobWithCopyId(CloudBlobContainer container, string blobName)
{
AccessCondition accessCondition = null;
BlobRequestOptions options = null;
ICloudBlob blob = destChannel.GetBlobReferenceFromServer(container, blobName, accessCondition, options, OperationContext);
-
- if (blob == null && output)
- {
- //output copy id here.
- WriteObject(String.Format(Resources.CopyDestinationBlobPending, blobName, container.Name));
- }
-
return blob;
}
- private void OnCopyTaskFinish(object userData, Exception e, string copyId)
+ private void OnCopyTaskFinish(object userData, string copyId, Exception e)
{
currentCopyId = copyId; //Make sure set the copy id before task finish
OnTaskFinish(userData, e);
2  WindowsAzurePowershell/src/Management.Storage/Blob/Cmdlet/StopCopyAzureStorageBlob.cs
View
@@ -217,7 +217,7 @@ private void StopCopyBlob(ICloudBlob blob, string copyId)
if (!ConfirmAbort(confirmation))
{
string cancelMessage = String.Format(Resources.StopCopyOperationCancelled, blob.Name, blob.Container.Name);
- WriteObject(cancelMessage);
+ WriteVerboseWithTimestamp(cancelMessage);
return;
}
}
1  WindowsAzurePowershell/src/Management.Storage/Blob/StorageDataMovementCmdletBase.cs
View
@@ -140,7 +140,6 @@ protected override void BeginProcessing()
}
BlobTransferOptions opts = new BlobTransferOptions();
- opts.OverwritePromptCallback = ConfirmOverwrite;
opts.Concurrency = concurrentTaskCount;
transferManager = new BlobTransferManager(opts);
21 WindowsAzurePowershell/src/Management.Storage/Microsoft.WindowsAzure.Management.Storage.format.ps1xml
View
@@ -212,9 +212,9 @@
</TableControl>
</View>
<View>
- <Name>Microsoft.WindowsAzure.ServiceManagement.Storage.Blob.ResourceModel.AzureStorageContainer</Name>
+ <Name>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageContainer</Name>
<ViewSelectedBy>
- <TypeName>Microsoft.WindowsAzure.ServiceManagement.Storage.Blob.ResourceModel.AzureStorageContainer</TypeName>
+ <TypeName>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageContainer</TypeName>
</ViewSelectedBy>
<GroupBy>
<ScriptBlock>$_.CloudBlobContainer.ServiceClient.BaseUri</ScriptBlock>
@@ -229,6 +229,7 @@
<TableColumnHeader>
<Label>PublicAccess</Label>
<Alignment>Left</Alignment>
+ <Width>20</Width>
</TableColumnHeader>
<TableColumnHeader>
<Label>LastModified</Label>
@@ -253,9 +254,9 @@
</TableControl>
</View>
<View>
- <Name>Microsoft.WindowsAzure.ServiceManagement.Storage.Blob.ResourceModel.AzureStorageBlob</Name>
+ <Name>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageBlob</Name>
<ViewSelectedBy>
- <TypeName>Microsoft.WindowsAzure.ServiceManagement.Storage.Blob.ResourceModel.AzureStorageBlob</TypeName>
+ <TypeName>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageBlob</TypeName>
</ViewSelectedBy>
<GroupBy>
<ScriptBlock>$_.ICloudBlob.ServiceClient.BaseUri</ScriptBlock>
@@ -315,9 +316,9 @@
</TableControl>
</View>
<View>
- <Name>Microsoft.WindowsAzure.ServiceManagement.Storage.Queue.ResourceModel.AzureStorageQueue</Name>
+ <Name>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageQueue</Name>
<ViewSelectedBy>
- <TypeName>Microsoft.WindowsAzure.ServiceManagement.Storage.Queue.ResourceModel.AzureStorageQueue</TypeName>
+ <TypeName>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageQueue</TypeName>
</ViewSelectedBy>
<GroupBy>
<ScriptBlock>$_.CloudQueue.ServiceClient.BaseUri</ScriptBlock>
@@ -363,9 +364,9 @@
</TableControl>
</View>
<View>
- <Name>Microsoft.WindowsAzure.ServiceManagement.Storage.Table.ResourceModel.AzureStorageTable</Name>
+ <Name>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageTable</Name>
<ViewSelectedBy>
- <TypeName>Microsoft.WindowsAzure.ServiceManagement.Storage.Table.ResourceModel.AzureStorageTable</TypeName>
+ <TypeName>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageTable</TypeName>
</ViewSelectedBy>
<GroupBy>
<ScriptBlock>$_.CloudTable.ServiceClient.BaseUri</ScriptBlock>
@@ -397,9 +398,9 @@
</TableControl>
</View>
<View>
- <Name>Microsoft.WindowsAzure.ServiceManagement.Storage.Common.ResourceModel.AzureStorageContext</Name>
+ <Name>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageContext</Name>
<ViewSelectedBy>
- <TypeName>Microsoft.WindowsAzure.ServiceManagement.Storage.Common.ResourceModel.AzureStorageContext</TypeName>
+ <TypeName>Microsoft.WindowsAzure.Management.Storage.Model.ResourceModel.AzureStorageContext</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
2  WindowsAzurePowershell/src/Management.Storage/Resources.Designer.cs
View
@@ -286,7 +286,7 @@ internal class Resources {
}
/// <summary>
- /// Looks up a localized string similar to Your copy request to blob &apos;{0}&apos; in container &apos;{1}&apos; has been scheduled. However the destination blob still was not created yet. Please try to monitor it later..
+ /// Looks up a localized string similar to Copy request to blob &apos;{0}&apos; in container &apos;{1}&apos; has been scheduled with copyId {2}..
/// </summary>
internal static string CopyDestinationBlobPending {
get {
4 WindowsAzurePowershell/src/Management.Storage/Resources.resx
View
@@ -472,8 +472,8 @@
<value>Transmit successfully.</value>
</data>
<data name="CopyDestinationBlobPending" xml:space="preserve">
- <value>Your copy request to blob '{0}' in container '{1}' has been scheduled. However the destination blob still was not created yet. Please try to monitor it later.</value>
- <comment>0 for blob name, 1 for container name.</comment>
+ <value>Copy request to blob '{0}' in container '{1}' has been scheduled with copyId {2}.</value>
+ <comment>0 for blob name, 1 for container name. 2 for copyid.</comment>
</data>
<data name="ConfirmAbortCopyOperation" xml:space="preserve">
<value>Are you sure to abort the copy operation on blob '{0}' in container '{1}' with CopyId {2}.</value>
BIN  WindowsAzurePowershell/src/lib/Microsoft.WindowsAzure.Storage.DataMovement.dll
View
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.