Skip to content

Commit f9c7a8c

Browse files
[PrivateLink] Update StorageSync SDK with 2020-03-01 (Azure#12249)
* Private link Change + SSS Recording * SyncGroup tests * CloudEndpoint Recording * Serverendpoint and RegisterServer, MgmtInterop changes * set storagesyncservice * Update TestController.cs * Update Az.StorageSync.psd1
1 parent 030b6a2 commit f9c7a8c

File tree

65 files changed

+22318
-18572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+22318
-18572
lines changed

src/StorageSync/StorageSync.Test/ScenarioTests/StorageSyncServiceTests.ps1

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ function Test-StorageSyncService
3434
New-AzResourceGroup -Name $resourceGroupName -Location $resourceGroupLocation;
3535

3636
Write-Verbose "Resource: $storageSyncServiceName | Loc: $resourceLocation | Type : StorageSyncService"
37-
New-AzStorageSyncService -ResourceGroupName $resourceGroupName -Location $resourceLocation -StorageSyncServiceName $storageSyncServiceName
38-
37+
New-AzStorageSyncService -ResourceGroupName $resourceGroupName -Location $resourceLocation -StorageSyncServiceName $storageSyncServiceName -IncomingTrafficPolicy "AllowVirtualNetworksOnly"
38+
39+
$storageSyncService = Get-AzStorageSyncService -ResourceGroupName $resourceGroupName -StorageSyncServiceName $storageSyncServiceName -Verbose
40+
Write-Verbose "Validating StorageSyncService Properties"
41+
Assert-AreEqual $storageSyncServiceName $storageSyncService.StorageSyncServiceName
42+
Assert-AreEqual "AllowVirtualNetworksOnly" $storageSyncService.IncomingTrafficPolicy
43+
44+
Set-AzStorageSyncService -ResourceGroupName $resourceGroupName -StorageSyncServiceName $storageSyncServiceName -IncomingTrafficPolicy "AllowAllTraffic"
45+
3946
Write-Verbose "List StorageSyncServices by ResourceGroup"
4047
$storageSyncServices = Get-AzStorageSyncService -ResourceGroupName $resourceGroupName
4148

@@ -44,13 +51,20 @@ function Test-StorageSyncService
4451

4552
Write-Verbose "Validating StorageSyncService Properties"
4653
Assert-AreEqual $storageSyncServiceName $storageSyncService.StorageSyncServiceName
54+
Assert-AreEqual "AllowAllTraffic" $storageSyncService.IncomingTrafficPolicy
4755
Assert-AreEqual (Normalize-Location($resourceLocation)) (Normalize-Location($storageSyncService.Location))
4856

4957
Write-Verbose "Removing StorageSyncService: $storageSyncServiceName"
5058
Remove-AzStorageSyncService -Force -ResourceGroupName $resourceGroupName -Name $storageSyncServiceName -AsJob | Wait-Job
5159

60+
# TODO : Remove the new generation of sss, it should work
61+
$storageSyncServiceName = Get-ResourceName("sss")
62+
5263
New-AzStorageSyncService -ResourceGroupName $resourceGroupName -Location $resourceLocation -StorageSyncServiceName $storageSyncServiceName | Get-AzStorageSyncService | Remove-AzStorageSyncService -Force -AsJob | Wait-Job
5364

65+
# TODO : Remove the new generation of sss, it should work
66+
$storageSyncServiceName = Get-ResourceName("sss")
67+
5468
New-AzStorageSyncService -ResourceGroupName $resourceGroupName -Location $resourceLocation -StorageSyncServiceName $storageSyncServiceName | Remove-AzStorageSyncService -Force -AsJob | Wait-Job
5569
}
5670
finally

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestCloudEndpoint.json

Lines changed: 1017 additions & 1014 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestGetCloudEndpoint.json

Lines changed: 576 additions & 642 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestGetCloudEndpointParentObject.json

Lines changed: 550 additions & 1177 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestGetCloudEndpointParentResourceId.json

Lines changed: 545 additions & 1235 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestGetCloudEndpoints.json

Lines changed: 624 additions & 432 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestNewCloudEndpoint.json

Lines changed: 597 additions & 405 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestRemoveCloudEndpoint.json

Lines changed: 567 additions & 2202 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestRemoveCloudEndpointInputObject.json

Lines changed: 532 additions & 655 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.CloudEndpointTests/TestRemoveCloudEndpointResourceId.json

Lines changed: 560 additions & 3581 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestGetRegisteredServer.json

Lines changed: 560 additions & 287 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestGetRegisteredServerParentObject.json

Lines changed: 548 additions & 275 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestGetRegisteredServerParentResourceId.json

Lines changed: 548 additions & 275 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestGetRegisteredServers.json

Lines changed: 551 additions & 278 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestNewRegisteredServer.json

Lines changed: 547 additions & 274 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestNewRegisteredServerParentObject.json

Lines changed: 557 additions & 284 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestNewRegisteredServerParentResourceId.json

Lines changed: 547 additions & 274 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestRegisteredServer.json

Lines changed: 574 additions & 301 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestRegisteredServerPipeline1.json

Lines changed: 551 additions & 278 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestRegisteredServerPipeline2.json

Lines changed: 531 additions & 258 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestRemoveRegisteredServer.json

Lines changed: 538 additions & 265 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestRemoveRegisteredServerInputObject.json

Lines changed: 535 additions & 262 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.RegisteredServerTests/TestRemoveRegisteredServerResourceId.json

Lines changed: 533 additions & 260 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.ServerEndpointTests/TestServerEndpoint.json

Lines changed: 900 additions & 645 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestGetStorageSyncService.json

Lines changed: 408 additions & 144 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestGetStorageSyncServices.json

Lines changed: 427 additions & 154 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestNewStorageSyncService.json

Lines changed: 414 additions & 141 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestRemoveStorageSyncService.json

Lines changed: 361 additions & 202 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestRemoveStorageSyncServiceInputObject.json

Lines changed: 418 additions & 145 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestRemoveStorageSyncServiceResourceId.json

Lines changed: 361 additions & 202 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.StorageSyncServiceTests/TestStorageSyncService.json

Lines changed: 1443 additions & 364 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestGetSyncGroup.json

Lines changed: 451 additions & 178 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestGetSyncGroupParentObject.json

Lines changed: 449 additions & 176 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestGetSyncGroupParentResourceId.json

Lines changed: 457 additions & 184 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestGetSyncGroups.json

Lines changed: 429 additions & 165 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestNewSyncGroup.json

Lines changed: 441 additions & 168 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestRemoveSyncGroup.json

Lines changed: 444 additions & 171 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestRemoveSyncGroupInputObject.json

Lines changed: 439 additions & 166 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestRemoveSyncGroupResourceId.json

Lines changed: 445 additions & 172 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/SessionRecords/StorageSyncTests.SyncGroupTests/TestSyncGroup.json

Lines changed: 535 additions & 262 deletions
Large diffs are not rendered by default.

src/StorageSync/StorageSync.Test/StorageSync.Test.csproj

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

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="3.1.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="11.0.0" />
14+
<PackageReference Include="Microsoft.Azure.Management.StorageSync" Version="5.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="17.0.0" />
1616
<PackageReference Include="System.Management" Version="4.5.0" />
1717
</ItemGroup>
1818

src/StorageSync/StorageSync/Az.StorageSync.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ FunctionsToExport = @()
7474

7575
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7676
CmdletsToExport = 'Invoke-AzStorageSyncCompatibilityCheck',
77-
'New-AzStorageSyncService', 'Get-AzStorageSyncService',
77+
'New-AzStorageSyncService', 'Get-AzStorageSyncService', 'Set-AzStorageSyncService',
7878
'Remove-AzStorageSyncService', 'New-AzStorageSyncGroup',
7979
'Get-AzStorageSyncGroup', 'Remove-AzStorageSyncGroup',
8080
'New-AzStorageSyncCloudEndpoint', 'Get-AzStorageSyncCloudEndpoint',
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.StorageSync.Models;
16+
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
17+
18+
namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
19+
{
20+
21+
/// <summary>
22+
/// Class PrivateEndpointConnectionsConverter.
23+
/// Implements the <see cref="Microsoft.Azure.Commands.StorageSync.Common.Converters.ConverterBase{Microsoft.Azure.Commands.StorageSync.Models.PSPrivateEndpointConnection, Microsoft.Azure.Management.StorageSync.Models.PrivateEndpointConnection}" />
24+
/// </summary>
25+
/// <seealso cref="Microsoft.Azure.Commands.StorageSync.Common.Converters.ConverterBase{Microsoft.Azure.Commands.StorageSync.Models.PSPrivateEndpointConnection, Microsoft.Azure.Management.StorageSync.Models.PrivateEndpointConnection}" />
26+
public class PrivateEndpointConnectionConverter : ConverterBase<PSPrivateEndpointConnection, StorageSyncModels.PrivateEndpointConnection>
27+
{
28+
29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="PrivateEndpointConnectionConverter" /> class.
31+
/// </summary>
32+
public PrivateEndpointConnectionConverter()
33+
{
34+
}
35+
36+
/// <summary>
37+
/// Transforms the specified source.
38+
/// </summary>
39+
/// <param name="source">The source.</param>
40+
/// <returns>StorageSyncModels.PrivateEndpointConnection.</returns>
41+
protected override StorageSyncModels.PrivateEndpointConnection Transform(PSPrivateEndpointConnection source) => new StorageSyncModels.PrivateEndpointConnection(
42+
new PrivateLinkServiceConnectionStateConverter().Convert(source.PrivateLinkServiceConnectionState),
43+
source.ResourceId,
44+
source.PrivateEndpointConnectionName,
45+
source.Type,
46+
new PrivateEndpointConverter().Convert(source.PrivateEndpoint),
47+
source.ProvisioningState);
48+
49+
/// <summary>
50+
/// Transforms the specified source.
51+
/// </summary>
52+
/// <param name="source">The source.</param>
53+
/// <returns>PSPrivateEndpointConnection.</returns>
54+
protected override PSPrivateEndpointConnection Transform(StorageSyncModels.PrivateEndpointConnection source)
55+
{
56+
return new PSPrivateEndpointConnection()
57+
{
58+
ResourceId = source.Id,
59+
PrivateEndpointConnectionName = source.Name,
60+
PrivateEndpoint = new PrivateEndpointConverter().Convert(source.PrivateEndpoint),
61+
PrivateLinkServiceConnectionState = new PrivateLinkServiceConnectionStateConverter().Convert(source.PrivateLinkServiceConnectionState),
62+
ProvisioningState = source.ProvisioningState,
63+
Type = source.Type,
64+
};
65+
}
66+
}
67+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.StorageSync.Models;
16+
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
17+
18+
namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
19+
{
20+
/// <summary>
21+
/// Class PrivateEndpointConverter.
22+
/// Implements the <see cref="Microsoft.Azure.Commands.StorageSync.Common.Converters.ConverterBase{Microsoft.Azure.Commands.StorageSync.Models.PSPrivateEndpoint, Microsoft.Azure.Management.StorageSync.Models.PrivateEndpoint}" />
23+
/// </summary>
24+
/// <seealso cref="Microsoft.Azure.Commands.StorageSync.Common.Converters.ConverterBase{Microsoft.Azure.Commands.StorageSync.Models.PSPrivateEndpoint, Microsoft.Azure.Management.StorageSync.Models.PrivateEndpoint}" />
25+
public class PrivateEndpointConverter : ConverterBase<PSPrivateEndpoint, StorageSyncModels.PrivateEndpoint>
26+
{
27+
28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="PrivateEndpointConverter" /> class.
30+
/// </summary>
31+
public PrivateEndpointConverter()
32+
{
33+
}
34+
35+
/// <summary>
36+
/// Transforms the specified source.
37+
/// </summary>
38+
/// <param name="source">The source.</param>
39+
/// <returns>StorageSyncModels.PrivateEndpoint.</returns>
40+
protected override StorageSyncModels.PrivateEndpoint Transform(PSPrivateEndpoint source) => new StorageSyncModels.PrivateEndpoint(source.ResourceId);
41+
42+
/// <summary>
43+
/// Transforms the specified source.
44+
/// </summary>
45+
/// <param name="source">The source.</param>
46+
/// <returns>PSPrivateEndpoint.</returns>
47+
protected override PSPrivateEndpoint Transform(StorageSyncModels.PrivateEndpoint source)
48+
{
49+
return new PSPrivateEndpoint()
50+
{
51+
ResourceId = source.Id
52+
};
53+
}
54+
}
55+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.StorageSync.Models;
16+
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
17+
18+
namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
19+
{
20+
/// <summary>
21+
/// Class PrivateLinkServiceConnectionStateConverter.
22+
/// Implements the <see cref="Microsoft.Azure.Commands.StorageSync.Common.Converters.ConverterBase{Microsoft.Azure.Commands.StorageSync.Models.PSPrivateLinkServiceConnectionState, Microsoft.Azure.Management.StorageSync.Models.PrivateLinkServiceConnectionState}" />
23+
/// </summary>
24+
/// <seealso cref="Microsoft.Azure.Commands.StorageSync.Common.Converters.ConverterBase{Microsoft.Azure.Commands.StorageSync.Models.PSPrivateLinkServiceConnectionState, Microsoft.Azure.Management.StorageSync.Models.PrivateLinkServiceConnectionState}" />
25+
public class PrivateLinkServiceConnectionStateConverter : ConverterBase<PSPrivateLinkServiceConnectionState, StorageSyncModels.PrivateLinkServiceConnectionState>
26+
{
27+
28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="PrivateLinkServiceConnectionStateConverter" /> class.
30+
/// </summary>
31+
public PrivateLinkServiceConnectionStateConverter()
32+
{
33+
}
34+
35+
/// <summary>
36+
/// Transforms the specified source.
37+
/// </summary>
38+
/// <param name="source">The source.</param>
39+
/// <returns>StorageSyncModels.PrivateLinkServiceConnectionState.</returns>
40+
protected override StorageSyncModels.PrivateLinkServiceConnectionState Transform(PSPrivateLinkServiceConnectionState source) => new StorageSyncModels.PrivateLinkServiceConnectionState(
41+
source.Status,
42+
source.Description,
43+
source.ActionRequired);
44+
45+
/// <summary>
46+
/// Transforms the specified source.
47+
/// </summary>
48+
/// <param name="source">The source.</param>
49+
/// <returns>PSPrivateLinkServiceConnectionState.</returns>
50+
protected override PSPrivateLinkServiceConnectionState Transform(StorageSyncModels.PrivateLinkServiceConnectionState source)
51+
{
52+
return new PSPrivateLinkServiceConnectionState()
53+
{
54+
Status = source.Status,
55+
Description = source.Description,
56+
ActionRequired = source.ActionRequired,
57+
};
58+
}
59+
}
60+
}

src/StorageSync/StorageSync/Common/Converters/RegisteredServerConverter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ protected override StorageSyncModels.RegisteredServer Transform(PSRegisteredServ
6363
source.ServiceLocation,
6464
source.FriendlyName,
6565
source.ManagementEndpointUri,
66+
source.MonitoringEndpointUri,
6667
source.MonitoringConfiguration);
6768
}
6869

@@ -91,6 +92,7 @@ protected override PSRegisteredServer Transform(StorageSyncModels.RegisteredServ
9192
LastOperationName = source.LastOperationName,
9293
LastWorkflowId = source.LastWorkflowId?.Trim('"'),
9394
ManagementEndpointUri = source.ManagementEndpointUri?.Trim('"'),
95+
MonitoringEndpointUri = source.MonitoringEndpointUri,
9496
ResourceLocation = source.ResourceLocation,
9597
ServerCertificate = source.ServerCertificate?.Trim('"'),
9698
ServerId = source.ServerId?.Trim('"'),

src/StorageSync/StorageSync/Common/Converters/StorageSyncServiceConverter.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
using Microsoft.Azure.Commands.StorageSync.Models;
1616
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
17+
using Microsoft.Azure.Management.StorageSync.Models;
18+
using System.Collections.Generic;
1719
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
1820

1921
namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
@@ -39,7 +41,13 @@ public StorageSyncServiceConverter()
3941
/// </summary>
4042
/// <param name="source">The source.</param>
4143
/// <returns>StorageSyncModels.StorageSyncService.</returns>
42-
protected override StorageSyncModels.StorageSyncService Transform(PSStorageSyncService source) => new StorageSyncModels.StorageSyncService(source.Location, source.ResourceId, source.StorageSyncServiceName, StorageSyncConstants.StorageSyncServiceType, source.Tags);
44+
protected override StorageSyncModels.StorageSyncService Transform(PSStorageSyncService source) => new StorageSyncModels.StorageSyncService(
45+
source.Location,
46+
source.ResourceId,
47+
source.StorageSyncServiceName,
48+
StorageSyncConstants.StorageSyncServiceType,
49+
source.Tags,
50+
source.IncomingTrafficPolicy);
4351

4452
/// <summary>
4553
/// Transforms the specified source.
@@ -49,14 +57,27 @@ public StorageSyncServiceConverter()
4957
protected override PSStorageSyncService Transform(StorageSyncModels.StorageSyncService source)
5058
{
5159
var resourceIdentifier = new ResourceIdentifier(source.Id);
60+
61+
var psPrivateEndpointConnections = new List<PSPrivateEndpointConnection>();
62+
// Convert individual PrivateEndpointConnection objects
63+
if (source.PrivateEndpointConnections != null)
64+
{
65+
foreach(PrivateEndpointConnection privateEndpointConnection in source.PrivateEndpointConnections)
66+
{
67+
psPrivateEndpointConnections.Add(new PrivateEndpointConnectionConverter().Convert(privateEndpointConnection));
68+
}
69+
}
70+
5271
return new PSStorageSyncService()
5372
{
5473
ResourceId = source.Id,
5574
StorageSyncServiceName = source.Name,
5675
ResourceGroupName = resourceIdentifier.ResourceGroupName,
5776
Location = source.Location,
77+
IncomingTrafficPolicy = source.IncomingTrafficPolicy,
5878
Tags = source.Tags,
59-
Type = resourceIdentifier.ResourceType ?? StorageSyncConstants.StorageSyncServiceType
79+
Type = resourceIdentifier.ResourceType ?? StorageSyncConstants.StorageSyncServiceType,
80+
PrivateEndpointConnections = psPrivateEndpointConnections.Count > 0 ? psPrivateEndpointConnections : null
6081
};
6182
}
6283
}

src/StorageSync/StorageSync/Common/Converters/SyncActivityStatusConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
2222
/// Implements the <see cref="Converters.ConverterBase{PSSyncActivityStatus, StorageSyncModels.SyncProgressStatus}" />
2323
/// </summary>
2424
/// <seealso cref="Converters.ConverterBase{PSSyncActivityStatus, StorageSyncModels.SyncProgressStatus}" />
25-
public class SyncActivityStatusConverter : ConverterBase<PSSyncActivityStatus, StorageSyncModels.SyncActivityStatus>
25+
public class SyncActivityStatusConverter : ConverterBase<PSSyncActivityStatus, StorageSyncModels.ServerEndpointSyncActivityStatus>
2626
{
2727
/// <summary>
2828
/// Transforms the specified source.
2929
/// </summary>
3030
/// <param name="source">The source.</param>
3131
/// <returns>StorageSyncModels.SyncProgressStatus.</returns>
32-
protected override StorageSyncModels.SyncActivityStatus Transform(PSSyncActivityStatus source) => new StorageSyncModels.SyncActivityStatus(
32+
protected override StorageSyncModels.ServerEndpointSyncActivityStatus Transform(PSSyncActivityStatus source) => new StorageSyncModels.ServerEndpointSyncActivityStatus(
3333
source.Timestamp,
3434
source.PerItemErrorCount,
3535
source.AppliedItemCount,
@@ -41,7 +41,7 @@ public class SyncActivityStatusConverter : ConverterBase<PSSyncActivityStatus, S
4141
/// </summary>
4242
/// <param name="source">The source.</param>
4343
/// <returns>PSSyncProgressStatus.</returns>
44-
protected override PSSyncActivityStatus Transform(StorageSyncModels.SyncActivityStatus source)
44+
protected override PSSyncActivityStatus Transform(StorageSyncModels.ServerEndpointSyncActivityStatus source)
4545
{
4646
return new PSSyncActivityStatus()
4747
{

0 commit comments

Comments
 (0)