Skip to content

Commit 7768323

Browse files
VeryEarlyyifanz7
andauthored
[Storage] Support ClientName when listing file handles; Upgrade SDK t… (Azure#26819)
* [Storage] Support ClientName when listing file handles; Upgrade SDK to latest version (Azure#26789) * Update SDK to latest version * Update SDK to latest version * add ClientName for listing file handles --------- Co-authored-by: Yabo Hu <[email protected]> * fix changelog --------- Co-authored-by: yifanz7 <[email protected]>
1 parent 433046f commit 7768323

File tree

8 files changed

+50
-28
lines changed

8 files changed

+50
-28
lines changed

src/Storage/Storage.Management.Test/Storage.Management.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Azure.Storage.Blobs" Version="12.18.0" />
15-
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.16.0" />
16-
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.16.0" />
17-
<PackageReference Include="Azure.Storage.Queues" Version="12.16.0" />
14+
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
15+
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.21.0" />
16+
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.21.0" />
17+
<PackageReference Include="Azure.Storage.Queues" Version="12.21.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Upgraded Azure.Storage.Blobs to 12.23.0
22+
* Upgraded Azure.Storage.Files.Shares to 12.21.0
23+
* Upgraded Azure.Storage.Files.DataLake to 12.21.0
24+
* Upgraded Azure.Storage.Queues to 12.21.0
25+
* Supported ClientName property when listing file handles
26+
- `Get-AzStorageFileHandle`
2127
* Upgraded Azure.Core to 1.44.1.
2228

2329
## Version 8.0.0

src/Storage/Storage.Management/help/Get-AzStorageFileHandle.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ Get-AzStorageFileHandle -ShareName "mysharename" -Recursive | Sort-Object Client
5555
```
5656

5757
```output
58-
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId
59-
-------- ---- -------- ---------- -------- ----------------- ------ -------- ---------
60-
28506980357 104.46.105.229 49805 2019-07-29 08:37:36Z 0 0 9297571480349046273
61-
28506980537 dir1 104.46.105.229 49805 2019-07-30 09:28:48Z 10376363910205800448 0 9297571480349046273
62-
28506980538 dir1 104.46.105.229 49805 2019-07-30 09:28:48Z 10376363910205800448 0 9297571480349046273
63-
28582543365 104.46.119.170 51675 2019-07-30 09:29:32Z 0 0 9477733061320772929
64-
28582543375 dir1 104.46.119.170 51675 2019-07-30 09:29:38Z 10376363910205800448 0 9477733061320772929
65-
28582543376 dir1 104.46.119.170 51675 2019-07-30 09:29:38Z 10376363910205800448 0 9477733061320772929
58+
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId ClientName
59+
-------- ---- -------- ---------- -------- ----------------- ------ -------- --------- ----------
60+
28506980357 104.46.105.229 49805 2019-07-29 08:37:36Z 0 0 9297571480349046273 myclientvm
61+
28506980537 dir1 104.46.105.229 49805 2019-07-30 09:28:48Z 10376363910205800448 0 9297571480349046273 myclientvm
62+
28506980538 dir1 104.46.105.229 49805 2019-07-30 09:28:48Z 10376363910205800448 0 9297571480349046273 myclientvm
63+
28582543365 104.46.119.170 51675 2019-07-30 09:29:32Z 0 0 9477733061320772929 myclientvm
64+
28582543375 dir1 104.46.119.170 51675 2019-07-30 09:29:38Z 10376363910205800448 0 9477733061320772929 myclientvm
65+
28582543376 dir1 104.46.119.170 51675 2019-07-30 09:29:38Z 10376363910205800448 0 9477733061320772929 myclientvm
6666
```
6767

6868
This command lists file handles on a file share, and sort the output by ClientIp, then by OpenTime.
@@ -73,10 +73,10 @@ Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2' -Recursive -
7373
```
7474

7575
```output
76-
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId
77-
-------- ---- -------- ---------- -------- ----------------- ------ -------- ---------
78-
24057151779 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049
79-
24057151780 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049
76+
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId ClientName
77+
-------- ---- -------- ---------- -------- ----------------- ------ -------- --------- ----------
78+
24057151779 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049 myclientvm
79+
24057151780 dir1/dir2 104.46.105.229 50861 2019-06-18 07:39:23Z 16140971433240035328 11529285414812647424 9549812641162070049 myclientvm
8080
```
8181

8282
This command lists first 2 file handles on a file directory recursively .
@@ -87,12 +87,12 @@ Get-AzStorageFileHandle -ShareName "mysharename" -Path 'dir1/dir2/test.txt' -ski
8787
```
8888

8989
```output
90-
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId
91-
-------- ---- -------- ---------- -------- ----------------- ------ -------- ---------
92-
24055513248 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321
93-
24055513249 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321
94-
24055513252 dir1/dir2/test.txt 104.46.105.229 49964 2019-06-18 08:22:54Z 9223407221226864640 16140971433240035328 9338416138431762125
95-
24055513253 dir1/dir2/test.txt 104.46.105.229 49964 2019-06-18 08:22:54Z 9223407221226864640 16140971433240035328 9338416138431762125
90+
HandleId Path ClientIp ClientPort OpenTime LastReconnectTime FileId ParentId SessionId ClientName
91+
-------- ---- -------- ---------- -------- ----------------- ------ -------- --------- ----------
92+
24055513248 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321 myclientvm
93+
24055513249 dir1/dir2/test.txt 104.46.105.229 49817 2019-06-18 08:21:59Z 9223407221226864640 16140971433240035328 9338416139169958321 myclientvm
94+
24055513252 dir1/dir2/test.txt 104.46.105.229 49964 2019-06-18 08:22:54Z 9223407221226864640 16140971433240035328 9338416138431762125 myclientvm
95+
24055513253 dir1/dir2/test.txt 104.46.105.229 49964 2019-06-18 08:22:54Z 9223407221226864640 16140971433240035328 9338416138431762125 myclientvm
9696
```
9797

9898
This command lists the 3rd to the 6th file handles on a file.

src/Storage/Storage.common/Storage.common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.16.0" />
20+
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.21.0" />
2121
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
2222
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.2.3" />
2323
</ItemGroup>

src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,12 @@ await DataMovementTransferHelper.DoTransfer(() =>
284284
}
285285

286286
// set file header and attributes to the file
287-
fileClient.SetHttpHeaders(httpHeaders: header, smbProperties: smbProperties);
287+
ShareFileSetHttpHeadersOptions httpHeadersOptions = new ShareFileSetHttpHeadersOptions
288+
{
289+
HttpHeaders = header,
290+
SmbProperties = smbProperties
291+
};
292+
fileClient.SetHttpHeaders(httpHeadersOptions);
288293
}
289294

290295
if (this.PassThru)

src/Storage/Storage/Model/ResourceModel/PSFileHandle.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ public class PSFileHandle
4848
[Ps1Xml(Label = "SessionId", Target = ViewControl.Table, Position = 8)]
4949
public ulong SessionId { get; set; }
5050

51+
[Ps1Xml(Label = "ClientName", Target = ViewControl.Table, Position = 9)]
52+
public string ClientName { get; set; }
53+
5154
public PSFileHandle(ShareFileHandle handle)
5255
{
5356
if (!String.IsNullOrEmpty(handle.HandleId))
5457
{
5558
this.HandleId = Convert.ToUInt64(handle.HandleId);
5659
}
5760
this.Path = handle.Path;
61+
this.ClientName = handle.ClientName;
5862
if (!String.IsNullOrEmpty(handle.ClientIp))
5963
{
6064
string[] clientIPs = handle.ClientIp.Split(new char[] { ':'}, StringSplitOptions.RemoveEmptyEntries);

src/Storage/Storage/Storage.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Azure.Data.Tables" Version="12.8.0" />
16-
<PackageReference Include="Azure.Storage.Blobs" Version="12.18.0" />
17-
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.16.0" />
18-
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.16.0" />
19-
<PackageReference Include="Azure.Storage.Queues" Version="12.16.0" />
16+
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
17+
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.21.0" />
18+
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.21.0" />
19+
<PackageReference Include="Azure.Storage.Queues" Version="12.21.0" />
2020
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
2121
<PackageReference Include="System.Security.Permissions" Version="4.7.0" />
2222
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.2.3" />

src/Storage/Storage/Storage.generated.format.ps1xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@
557557
<Label>SessionId</Label>
558558
<Alignment>Left</Alignment>
559559
</TableColumnHeader>
560+
<TableColumnHeader>
561+
<Label>ClientName</Label>
562+
<Alignment>Left</Alignment>
563+
</TableColumnHeader>
560564
</TableHeaders>
561565
<TableRowEntries>
562566
<TableRowEntry>
@@ -588,6 +592,9 @@
588592
<TableColumnItem>
589593
<PropertyName>SessionId</PropertyName>
590594
</TableColumnItem>
595+
<TableColumnItem>
596+
<PropertyName>ClientName</PropertyName>
597+
</TableColumnItem>
591598
</TableColumnItems>
592599
</TableRowEntry>
593600
</TableRowEntries>

0 commit comments

Comments
 (0)