diff --git a/src/StorageSync/StorageSync.Test/StorageSync.Test.csproj b/src/StorageSync/StorageSync.Test/StorageSync.Test.csproj
index 86b4f8d28aea..598b34bf689a 100644
--- a/src/StorageSync/StorageSync.Test/StorageSync.Test.csproj
+++ b/src/StorageSync/StorageSync.Test/StorageSync.Test.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/StorageSync/StorageSync/Common/Converters/PrivateEndpointConnectionConverter.cs b/src/StorageSync/StorageSync/Common/Converters/PrivateEndpointConnectionConverter.cs
new file mode 100644
index 000000000000..05a738ed9f98
--- /dev/null
+++ b/src/StorageSync/StorageSync/Common/Converters/PrivateEndpointConnectionConverter.cs
@@ -0,0 +1,67 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using Microsoft.Azure.Commands.StorageSync.Models;
+using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
+
+namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
+{
+
+ ///
+ /// Class PrivateEndpointConnectionsConverter.
+ /// Implements the
+ ///
+ ///
+ public class PrivateEndpointConnectionConverter : ConverterBase
+ {
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PrivateEndpointConnectionConverter()
+ {
+ }
+
+ ///
+ /// Transforms the specified source.
+ ///
+ /// The source.
+ /// StorageSyncModels.PrivateEndpointConnection.
+ protected override StorageSyncModels.PrivateEndpointConnection Transform(PSPrivateEndpointConnection source) => new StorageSyncModels.PrivateEndpointConnection(
+ new PrivateLinkServiceConnectionStateConverter().Convert(source.PrivateLinkServiceConnectionState),
+ source.ResourceId,
+ source.PrivateEndpointConnectionName,
+ source.Type,
+ new PrivateEndpointConverter().Convert(source.PrivateEndpoint),
+ source.ProvisioningState);
+
+ ///
+ /// Transforms the specified source.
+ ///
+ /// The source.
+ /// PSPrivateEndpointConnection.
+ protected override PSPrivateEndpointConnection Transform(StorageSyncModels.PrivateEndpointConnection source)
+ {
+ return new PSPrivateEndpointConnection()
+ {
+ ResourceId = source.Id,
+ PrivateEndpointConnectionName = source.Name,
+ PrivateEndpoint = new PrivateEndpointConverter().Convert(source.PrivateEndpoint),
+ PrivateLinkServiceConnectionState = new PrivateLinkServiceConnectionStateConverter().Convert(source.PrivateLinkServiceConnectionState),
+ ProvisioningState = source.ProvisioningState,
+ Type = source.Type,
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/StorageSync/StorageSync/Common/Converters/PrivateEndpointConverter.cs b/src/StorageSync/StorageSync/Common/Converters/PrivateEndpointConverter.cs
new file mode 100644
index 000000000000..6c1ac430f3b6
--- /dev/null
+++ b/src/StorageSync/StorageSync/Common/Converters/PrivateEndpointConverter.cs
@@ -0,0 +1,55 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using Microsoft.Azure.Commands.StorageSync.Models;
+using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
+
+namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
+{
+ ///
+ /// Class PrivateEndpointConverter.
+ /// Implements the
+ ///
+ ///
+ public class PrivateEndpointConverter : ConverterBase
+ {
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PrivateEndpointConverter()
+ {
+ }
+
+ ///
+ /// Transforms the specified source.
+ ///
+ /// The source.
+ /// StorageSyncModels.PrivateEndpoint.
+ protected override StorageSyncModels.PrivateEndpoint Transform(PSPrivateEndpoint source) => new StorageSyncModels.PrivateEndpoint(source.ResourceId);
+
+ ///
+ /// Transforms the specified source.
+ ///
+ /// The source.
+ /// PSPrivateEndpoint.
+ protected override PSPrivateEndpoint Transform(StorageSyncModels.PrivateEndpoint source)
+ {
+ return new PSPrivateEndpoint()
+ {
+ ResourceId = source.Id
+ };
+ }
+ }
+}
diff --git a/src/StorageSync/StorageSync/Common/Converters/PrivateLinkServiceConnectionStateConverter.cs b/src/StorageSync/StorageSync/Common/Converters/PrivateLinkServiceConnectionStateConverter.cs
new file mode 100644
index 000000000000..3c22ee8213b1
--- /dev/null
+++ b/src/StorageSync/StorageSync/Common/Converters/PrivateLinkServiceConnectionStateConverter.cs
@@ -0,0 +1,60 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using Microsoft.Azure.Commands.StorageSync.Models;
+using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
+
+namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
+{
+ ///
+ /// Class PrivateLinkServiceConnectionStateConverter.
+ /// Implements the
+ ///
+ ///
+ public class PrivateLinkServiceConnectionStateConverter : ConverterBase
+ {
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PrivateLinkServiceConnectionStateConverter()
+ {
+ }
+
+ ///
+ /// Transforms the specified source.
+ ///
+ /// The source.
+ /// StorageSyncModels.PrivateLinkServiceConnectionState.
+ protected override StorageSyncModels.PrivateLinkServiceConnectionState Transform(PSPrivateLinkServiceConnectionState source) => new StorageSyncModels.PrivateLinkServiceConnectionState(
+ source.Status,
+ source.Description,
+ source.ActionRequired);
+
+ ///
+ /// Transforms the specified source.
+ ///
+ /// The source.
+ /// PSPrivateLinkServiceConnectionState.
+ protected override PSPrivateLinkServiceConnectionState Transform(StorageSyncModels.PrivateLinkServiceConnectionState source)
+ {
+ return new PSPrivateLinkServiceConnectionState()
+ {
+ Status = source.Status,
+ Description = source.Description,
+ ActionRequired = source.ActionRequired,
+ };
+ }
+ }
+}
diff --git a/src/StorageSync/StorageSync/Common/Converters/RegisteredServerConverter.cs b/src/StorageSync/StorageSync/Common/Converters/RegisteredServerConverter.cs
index 87e5cee09b52..b708ec29c348 100644
--- a/src/StorageSync/StorageSync/Common/Converters/RegisteredServerConverter.cs
+++ b/src/StorageSync/StorageSync/Common/Converters/RegisteredServerConverter.cs
@@ -63,6 +63,7 @@ protected override StorageSyncModels.RegisteredServer Transform(PSRegisteredServ
source.ServiceLocation,
source.FriendlyName,
source.ManagementEndpointUri,
+ source.MonitoringEndpointUri,
source.MonitoringConfiguration);
}
@@ -91,6 +92,7 @@ protected override PSRegisteredServer Transform(StorageSyncModels.RegisteredServ
LastOperationName = source.LastOperationName,
LastWorkflowId = source.LastWorkflowId?.Trim('"'),
ManagementEndpointUri = source.ManagementEndpointUri?.Trim('"'),
+ MonitoringEndpointUri = source.MonitoringEndpointUri,
ResourceLocation = source.ResourceLocation,
ServerCertificate = source.ServerCertificate?.Trim('"'),
ServerId = source.ServerId?.Trim('"'),
diff --git a/src/StorageSync/StorageSync/Common/Converters/StorageSyncServiceConverter.cs b/src/StorageSync/StorageSync/Common/Converters/StorageSyncServiceConverter.cs
index a94ffc668200..dc7f545f8c14 100644
--- a/src/StorageSync/StorageSync/Common/Converters/StorageSyncServiceConverter.cs
+++ b/src/StorageSync/StorageSync/Common/Converters/StorageSyncServiceConverter.cs
@@ -14,6 +14,8 @@
using Microsoft.Azure.Commands.StorageSync.Models;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
+using Microsoft.Azure.Management.StorageSync.Models;
+using System.Collections.Generic;
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
@@ -39,7 +41,13 @@ public StorageSyncServiceConverter()
///
/// The source.
/// StorageSyncModels.StorageSyncService.
- protected override StorageSyncModels.StorageSyncService Transform(PSStorageSyncService source) => new StorageSyncModels.StorageSyncService(source.Location, source.ResourceId, source.StorageSyncServiceName, StorageSyncConstants.StorageSyncServiceType, source.Tags);
+ protected override StorageSyncModels.StorageSyncService Transform(PSStorageSyncService source) => new StorageSyncModels.StorageSyncService(
+ source.Location,
+ source.ResourceId,
+ source.StorageSyncServiceName,
+ StorageSyncConstants.StorageSyncServiceType,
+ source.Tags,
+ source.IncomingTrafficPolicy);
///
/// Transforms the specified source.
@@ -49,14 +57,27 @@ public StorageSyncServiceConverter()
protected override PSStorageSyncService Transform(StorageSyncModels.StorageSyncService source)
{
var resourceIdentifier = new ResourceIdentifier(source.Id);
+
+ var psPrivateEndpointConnections = new List();
+ // Convert individual PrivateEndpointConnection objects
+ if (source.PrivateEndpointConnections != null)
+ {
+ foreach(PrivateEndpointConnection privateEndpointConnection in source.PrivateEndpointConnections)
+ {
+ psPrivateEndpointConnections.Add(new PrivateEndpointConnectionConverter().Convert(privateEndpointConnection));
+ }
+ }
+
return new PSStorageSyncService()
{
ResourceId = source.Id,
StorageSyncServiceName = source.Name,
ResourceGroupName = resourceIdentifier.ResourceGroupName,
Location = source.Location,
+ IncomingTrafficPolicy = source.IncomingTrafficPolicy,
Tags = source.Tags,
- Type = resourceIdentifier.ResourceType ?? StorageSyncConstants.StorageSyncServiceType
+ Type = resourceIdentifier.ResourceType ?? StorageSyncConstants.StorageSyncServiceType,
+ PrivateEndpointConnections = psPrivateEndpointConnections.Count > 0 ? psPrivateEndpointConnections : null
};
}
}
diff --git a/src/StorageSync/StorageSync/Common/Converters/SyncActivityStatusConverter.cs b/src/StorageSync/StorageSync/Common/Converters/SyncActivityStatusConverter.cs
index 6c76cfc4e0b9..7af7e674dd60 100644
--- a/src/StorageSync/StorageSync/Common/Converters/SyncActivityStatusConverter.cs
+++ b/src/StorageSync/StorageSync/Common/Converters/SyncActivityStatusConverter.cs
@@ -22,14 +22,14 @@ namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
/// Implements the
///
///
- public class SyncActivityStatusConverter : ConverterBase
+ public class SyncActivityStatusConverter : ConverterBase
{
///
/// Transforms the specified source.
///
/// The source.
/// StorageSyncModels.SyncProgressStatus.
- protected override StorageSyncModels.SyncActivityStatus Transform(PSSyncActivityStatus source) => new StorageSyncModels.SyncActivityStatus(
+ protected override StorageSyncModels.ServerEndpointSyncActivityStatus Transform(PSSyncActivityStatus source) => new StorageSyncModels.ServerEndpointSyncActivityStatus(
source.Timestamp,
source.PerItemErrorCount,
source.AppliedItemCount,
@@ -41,7 +41,7 @@ public class SyncActivityStatusConverter : ConverterBase
/// The source.
/// PSSyncProgressStatus.
- protected override PSSyncActivityStatus Transform(StorageSyncModels.SyncActivityStatus source)
+ protected override PSSyncActivityStatus Transform(StorageSyncModels.ServerEndpointSyncActivityStatus source)
{
return new PSSyncActivityStatus()
{
diff --git a/src/StorageSync/StorageSync/Common/Converters/SyncSessionStatusConvertor.cs b/src/StorageSync/StorageSync/Common/Converters/SyncSessionStatusConvertor.cs
index 8fd9e3dbb2e0..e2c6d69590c7 100644
--- a/src/StorageSync/StorageSync/Common/Converters/SyncSessionStatusConvertor.cs
+++ b/src/StorageSync/StorageSync/Common/Converters/SyncSessionStatusConvertor.cs
@@ -23,14 +23,14 @@ namespace Microsoft.Azure.Commands.StorageSync.Common.Converters
/// Implements the
///
///
- public class SyncSessionStatusConvertor : ConverterBase
+ public class SyncSessionStatusConvertor : ConverterBase
{
///
/// Transforms the specified source.
///
/// The source.
/// StorageSyncModels.SyncSessionStatus.
- protected override StorageSyncModels.SyncSessionStatus Transform(PSSyncSessionStatus source) => new StorageSyncModels.SyncSessionStatus(
+ protected override StorageSyncModels.ServerEndpointSyncSessionStatus Transform(PSSyncSessionStatus source) => new StorageSyncModels.ServerEndpointSyncSessionStatus(
source.LastSyncResult, source.LastSyncTimestamp, source.LastSyncSuccessTimestamp, source.LastSyncPerItemErrorCount);
///
@@ -38,7 +38,7 @@ public class SyncSessionStatusConvertor : ConverterBase
/// The source.
/// PSSyncSessionStatus.
- protected override PSSyncSessionStatus Transform(StorageSyncModels.SyncSessionStatus source)
+ protected override PSSyncSessionStatus Transform(StorageSyncModels.ServerEndpointSyncSessionStatus source)
{
return new PSSyncSessionStatus()
{
diff --git a/src/StorageSync/StorageSync/Common/HelpMessages.cs b/src/StorageSync/StorageSync/Common/HelpMessages.cs
index c1e24211de7e..c83041e6bf00 100644
--- a/src/StorageSync/StorageSync/Common/HelpMessages.cs
+++ b/src/StorageSync/StorageSync/Common/HelpMessages.cs
@@ -51,6 +51,10 @@ public class HelpMessages
///
public const string StorageSyncServiceLocationParameter = "Storage Sync Service Location.";
///
+ /// The storage sync service incoming traffic policy parameter
+ ///
+ public const string StorageSyncServiceIncomingTrafficPolicyParameter = "Storage Sync Service Incoming Traffic Policy.";
+ ///
/// The storage sync service tags parameter
///
public const string StorageSyncServiceTagsParameter = "Storage Sync Service Tags.";
diff --git a/src/StorageSync/StorageSync/Models/PSPrivateEndpoint.cs b/src/StorageSync/StorageSync/Models/PSPrivateEndpoint.cs
new file mode 100644
index 000000000000..e2af0271e871
--- /dev/null
+++ b/src/StorageSync/StorageSync/Models/PSPrivateEndpoint.cs
@@ -0,0 +1,25 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+namespace Microsoft.Azure.Commands.StorageSync.Models
+{
+ public class PSPrivateEndpoint
+ {
+ ///
+ /// Gets the resource identifier.
+ ///
+ ///
+ public string ResourceId { get; internal set; }
+ }
+}
diff --git a/src/StorageSync/StorageSync/Models/PSPrivateEndpointConnection.cs b/src/StorageSync/StorageSync/Models/PSPrivateEndpointConnection.cs
new file mode 100644
index 000000000000..e30bc03860b1
--- /dev/null
+++ b/src/StorageSync/StorageSync/Models/PSPrivateEndpointConnection.cs
@@ -0,0 +1,58 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+namespace Microsoft.Azure.Commands.StorageSync.Models
+{
+ ///
+ /// Class PSPrivateEndpointConnection.
+ ///
+ public class PSPrivateEndpointConnection
+ {
+ ///
+ /// Gets the resource identifier.
+ ///
+ /// The resource identifier.
+ public string ResourceId { get; internal set; }
+
+ ///
+ /// Gets the private endpoint connection name.
+ ///
+ ///
+ public string PrivateEndpointConnectionName { get; internal set; }
+
+ ///
+ /// Gets the private endpoint.
+ ///
+ ///
+ public PSPrivateEndpoint PrivateEndpoint { get; internal set; }
+
+ ///
+ /// Gets the private linke service connection state.
+ ///
+ ///
+ public PSPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; internal set; }
+
+ ///
+ /// Gets the provisioning state.
+ ///
+ ///
+ public string ProvisioningState { get; internal set; }
+
+ ///
+ /// Gets the type.
+ ///
+ ///
+ public string Type { get; internal set; }
+ }
+}
\ No newline at end of file
diff --git a/src/StorageSync/StorageSync/Models/PSPrivateEndpointConnectionState.cs b/src/StorageSync/StorageSync/Models/PSPrivateEndpointConnectionState.cs
new file mode 100644
index 000000000000..bb3eeec95fdc
--- /dev/null
+++ b/src/StorageSync/StorageSync/Models/PSPrivateEndpointConnectionState.cs
@@ -0,0 +1,37 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+namespace Microsoft.Azure.Commands.StorageSync.Models
+{
+ public class PSPrivateLinkServiceConnectionState
+ {
+ ///
+ /// Gets the status.
+ ///
+ ///
+ public string Status { get; internal set; }
+
+ ///
+ /// Gets the description.
+ ///
+ ///
+ public string Description { get; internal set; }
+
+ ///
+ /// Gets the action required.
+ ///
+ ///
+ public string ActionRequired { get; internal set; }
+ }
+}
diff --git a/src/StorageSync/StorageSync/Models/PSRegisteredServer.cs b/src/StorageSync/StorageSync/Models/PSRegisteredServer.cs
index 4c80c5e0d2fe..ef0f8b96fe5b 100644
--- a/src/StorageSync/StorageSync/Models/PSRegisteredServer.cs
+++ b/src/StorageSync/StorageSync/Models/PSRegisteredServer.cs
@@ -121,6 +121,11 @@ public class PSRegisteredServer : PSResourceBase
///
/// The management endpoint URI.
public string ManagementEndpointUri { get; set; }
+ //
+ /// Gets or sets the monitoring endpoint URI.
+ ///
+ /// The monitoring endpoint URI.
+ public string MonitoringEndpointUri { get; set; }
///
/// Gets or sets the monitoring configuration.
///
diff --git a/src/StorageSync/StorageSync/Models/PSStorageSyncService.cs b/src/StorageSync/StorageSync/Models/PSStorageSyncService.cs
index 3abc3407b1fd..55d583769baa 100644
--- a/src/StorageSync/StorageSync/Models/PSStorageSyncService.cs
+++ b/src/StorageSync/StorageSync/Models/PSStorageSyncService.cs
@@ -30,16 +30,33 @@ public class PSStorageSyncService : PSResourceBase
/// The location.
[Ps1Xml(Label = "Location", Target = ViewControl.Table, Position = 4)]
public string Location { get; set; }
+
///
/// Gets or sets the name of the storage sync service.
///
/// The name of the storage sync service.
[Ps1Xml(Label = "StorageSyncServiceName ", Target = ViewControl.Table, Position = 5)]
public string StorageSyncServiceName { get; set; }
+
+ ///
+ /// Gets or sets the name of the incoming traffic policy.
+ ///
+ /// The name of the incoming traffic policy.
+ [Ps1Xml(Label = "IncomingTrafficPolicy ", Target = ViewControl.Table, Position = 6)]
+ public string IncomingTrafficPolicy { get; set; }
+
+ ///
+ /// Gets the private endpoint connections.
+ ///
+ /// The private endpoint connections.
+ [Ps1Xml(Label = "PrivateEndpointConnections ", Target = ViewControl.Table, Position = 7)]
+ public IList PrivateEndpointConnections { get; set; }
+
///
/// Gets or sets the tags.
///
/// The tags.
public IDictionary Tags { get; set; }
+
}
}
diff --git a/src/StorageSync/StorageSync/StorageSync.csproj b/src/StorageSync/StorageSync/StorageSync.csproj
index c73cb7c6e5f3..6b6f51c57794 100644
--- a/src/StorageSync/StorageSync/StorageSync.csproj
+++ b/src/StorageSync/StorageSync/StorageSync.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/StorageSync/StorageSync/StorageSyncService/NewStorageSyncServiceCommand.cs b/src/StorageSync/StorageSync/StorageSyncService/NewStorageSyncServiceCommand.cs
index 825922ae72b0..844c8582a362 100644
--- a/src/StorageSync/StorageSync/StorageSyncService/NewStorageSyncServiceCommand.cs
+++ b/src/StorageSync/StorageSync/StorageSyncService/NewStorageSyncServiceCommand.cs
@@ -18,11 +18,11 @@
using Microsoft.Azure.Commands.StorageSync.Models;
using Microsoft.Azure.Commands.StorageSync.Properties;
using Microsoft.Azure.Management.StorageSync;
-using Microsoft.Azure.Management.StorageSync.Models;
using System.Collections;
using System.Management.Automation;
using StorageSyncModels = Microsoft.Azure.Management.StorageSync.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
+using Microsoft.Azure.Management.StorageSync.Models;
namespace Microsoft.Azure.Commands.StorageSync.StorageSyncService
{
@@ -77,6 +77,22 @@ public class NewStorageSyncServiceCommand : StorageSyncClientCmdletBase
[ValidateNotNullOrEmpty]
public string Location { get; set; }
+ ///
+ /// Gets or sets the IncomingTrafficPolicy.
+ ///
+ /// The IncomingTrafficPolicy.
+ [Parameter(
+ Position = 3,
+ ParameterSetName = StorageSyncParameterSets.StringParameterSet,
+ Mandatory = false,
+ ValueFromPipelineByPropertyName = true,
+ HelpMessage = HelpMessages.StorageSyncServiceIncomingTrafficPolicyParameter)]
+ [ValidateNotNullOrEmpty]
+ [ValidateSet(StorageSyncModels.IncomingTrafficPolicy.AllowVirtualNetworksOnly,
+ StorageSyncModels.IncomingTrafficPolicy.AllowAllTraffic,
+ IgnoreCase = true)]
+ public string IncomingTrafficPolicy { get; set; }
+
///
/// Gets or sets the tag.
///
@@ -119,10 +135,25 @@ public override void ExecuteCmdlet()
throw new PSArgumentException(checkNameAvailabilityResult.Message, nameof(Name));
}
+ string incomingTrafficPolicy;
+ if (this.IsParameterBound(c => c.IncomingTrafficPolicy))
+ {
+ if(string.IsNullOrEmpty(this.IncomingTrafficPolicy))
+ {
+ throw new PSArgumentException(nameof(IncomingTrafficPolicy));
+ }
+ incomingTrafficPolicy = this.IncomingTrafficPolicy;
+ }
+ else
+ {
+ incomingTrafficPolicy = StorageSyncModels.IncomingTrafficPolicy.AllowAllTraffic;
+ }
+
var createParameters = new StorageSyncServiceCreateParameters()
{
Location = Location,
Tags = TagsConversionHelper.CreateTagDictionary(Tag ?? new Hashtable(), validate: true),
+ IncomingTrafficPolicy = incomingTrafficPolicy
};
Target = string.Join("/", ResourceGroupName, Name);