Skip to content

Commit 28d2c89

Browse files
authored
[Storage] [DataMovement] NFS over REST Azure SDK Feedback (Azure#50369)
* initial commit * Delete sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net6.0.cs * fixed changelog wording
1 parent d683f9f commit 28d2c89

File tree

8 files changed

+16
-27
lines changed

8 files changed

+16
-27
lines changed

sdk/storage/Azure.Storage.DataMovement.Files.Shares/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
## 12.2.0-beta.1 (Unreleased)
44

55
### Features Added
6+
- Added support for preserving NFS properties and permissions in Share Files and Share Directories for Share-to-Share copy transfers.
7+
- Added support for preserving SMB properties and permissions in Share Directories for Share-to-Share copy transfers.
8+
- Added basic support for handling hard links and soft links in NFS Share-to-Share copy and Share-to-local download transfers.
69

710
### Breaking Changes
11+
- Added protocol validation for Share-to-Share copy transfers. Validation is enabled by default and will fail the transfer if there are no share-level permissions. To bypass this, please enable `SkipProtocolValidation`.
812

913
### Bugs Fixed
1014

sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/DataMovementSharesExtensions.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,7 @@ internal static StorageResourceContainerProperties ToStorageResourceContainerPro
550550
{
551551
rawProperties.WriteKeyValue(DataMovementConstants.ResourceProperties.FileMode, directoryProperties.PosixProperties.FileMode);
552552
}
553-
return new StorageResourceContainerProperties()
554-
{
555-
RawProperties = rawProperties
556-
};
553+
return new StorageResourceContainerProperties(rawProperties);
557554
}
558555

559556
internal static void AddToStorageResourceContainerProperties(
@@ -702,10 +699,7 @@ internal static StorageResourceContainerProperties ToResourceContainerProperties
702699
{
703700
properties.Add(DataMovementConstants.ResourceProperties.DestinationFilePermissionKey, destinationPermissionKey);
704701
}
705-
return new StorageResourceContainerProperties()
706-
{
707-
RawProperties = properties
708-
};
702+
return new StorageResourceContainerProperties(properties);
709703
}
710704

711705
private static string[] ConvertContentPropertyObjectToStringArray(string contentPropertyName, object contentPropertyValue)

sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFileStorageResourceOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class ShareFileStorageResourceOptions
5858
/// Optional. Specifies whether the Share uses NFS or SMB protocol.
5959
/// By default this value is set to SMB.
6060
/// This is intended to be set on the source and destination Share.
61-
/// Applies to copy, upload, and download transfers. Protocol validation only applies to Share-to-Share copy transfers.
61+
/// For Share-to-Share copy transfers, the protocol is validated and must be correctly set to process the transfer and preserve the proper properties and permissions.
6262
///
6363
/// Note: Only NFS -> NFS and SMB -> SMB transfers are currently supported.
6464
/// For NFS Share-to-Share Copy and Download transfers, Hard links will be copied as regular files and Symbolic links are skipped.

sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/SharesPathScanner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public virtual async IAsyncEnumerable<StorageResource> ScanAsync(
4141
options: new() { Traits = traits },
4242
cancellationToken: cancellationToken).ConfigureAwait(false))
4343
{
44-
string destinationPermissionKey = string.Empty;
44+
string destinationPermissionKey = default;
4545
if (destinationShare != default && item.PermissionKey != default)
4646
{
4747
// Check if the permission key is already created.

sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.net8.0.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ protected StorageResourceContainer() { }
6767
public partial class StorageResourceContainerProperties
6868
{
6969
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
70-
public StorageResourceContainerProperties() { }
70+
public StorageResourceContainerProperties(System.Collections.Generic.IDictionary<string, object> properties = null) { }
7171
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
72-
public System.Collections.Generic.IDictionary<string, object> RawProperties { get { throw null; } set { } }
72+
public System.Collections.Generic.IDictionary<string, object> RawProperties { get { throw null; } }
7373
}
7474
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
7575
public partial class StorageResourceCopyFromUriOptions

sdk/storage/Azure.Storage.DataMovement/api/Azure.Storage.DataMovement.netstandard2.0.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ protected StorageResourceContainer() { }
6767
public partial class StorageResourceContainerProperties
6868
{
6969
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
70-
public StorageResourceContainerProperties() { }
70+
public StorageResourceContainerProperties(System.Collections.Generic.IDictionary<string, object> properties = null) { }
7171
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
72-
public System.Collections.Generic.IDictionary<string, object> RawProperties { get { throw null; } set { } }
72+
public System.Collections.Generic.IDictionary<string, object> RawProperties { get { throw null; } }
7373
}
7474
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
7575
public partial class StorageResourceCopyFromUriOptions

sdk/storage/Azure.Storage.DataMovement/src/Shared/DataMovementExtensions.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ internal static StorageResourceItemProperties ToStorageResourceProperties(this F
2222
};
2323
}
2424

25-
internal static StorageResourceContainerProperties ToStorageResourceContainerProperties(
26-
this StorageResourceItemProperties properties)
27-
{
28-
return new StorageResourceContainerProperties()
29-
{
30-
RawProperties = properties.RawProperties
31-
};
32-
}
33-
3425
public static StreamToUriJobPart ToStreamToUriJobPartAsync(
3526
this TransferJobInternal baseJob,
3627
JobPartPlanHeader header,

sdk/storage/Azure.Storage.DataMovement/src/StorageResourceContainerProperties.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public class StorageResourceContainerProperties
1717
/// Dictionary of the properties associated with this resource container.
1818
/// </summary>
1919
[EditorBrowsable(EditorBrowsableState.Never)]
20-
public IDictionary<string, object> RawProperties { get; set; }
20+
public IDictionary<string, object> RawProperties { get; }
2121

2222
/// <summary>
23-
/// Base constructor for mocking.
23+
/// Base constructor.
2424
/// </summary>
2525
[EditorBrowsable(EditorBrowsableState.Never)]
26-
public StorageResourceContainerProperties()
26+
public StorageResourceContainerProperties(IDictionary<string, object> properties = default)
2727
{
28-
RawProperties = new Dictionary<string, object>();
28+
RawProperties = properties ?? new Dictionary<string, object>();
2929
}
3030
}
3131
}

0 commit comments

Comments
 (0)