diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj index ddefffe24722..1892de8bda61 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj +++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj @@ -200,7 +200,6 @@ - diff --git a/src/ResourceManager/Sql/Commands.Sql/ServerCommunicationLink/Cmdlet/SetAzureSqlServerCommunicationLink.cs b/src/ResourceManager/Sql/Commands.Sql/ServerCommunicationLink/Cmdlet/SetAzureSqlServerCommunicationLink.cs deleted file mode 100644 index 854fef8d3206..000000000000 --- a/src/ResourceManager/Sql/Commands.Sql/ServerCommunicationLink/Cmdlet/SetAzureSqlServerCommunicationLink.cs +++ /dev/null @@ -1,90 +0,0 @@ -// ---------------------------------------------------------------------------------- -// -// 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 System.Collections.Generic; -using System.Linq; -using System.Management.Automation; -using Microsoft.Azure.Commands.Sql.Database.Model; -using Microsoft.Azure.Commands.Sql.ServerCommunicationLink.Model; - -namespace Microsoft.Azure.Commands.Sql.ServerCommunicationLink.Cmdlet -{ - /// - /// Cmdlet to create a new Azure Sql Database server communication link - /// - [Cmdlet(VerbsCommon.Set, "AzureRmSqlServerCommunicationLink", - ConfirmImpact = ConfirmImpact.Medium), OutputType(typeof(AzureSqlServerCommunicationLinkModel))] - public class SetAzureSqlServerCommunicationLink : AzureSqlServerCommunicationLinkCmdletBase - { - /// - /// Gets or sets the name of the server communication link to create. - /// - [Parameter(Mandatory = true, - HelpMessage = "The name of the Azure SQL server communication link to create.")] - [ValidateNotNullOrEmpty] - public string LinkName { get; set; } - - /// - /// Gets or sets the name of the partner server. - /// - [Parameter(Mandatory = true, - HelpMessage = "The name of the partner server.")] - [ValidateNotNullOrEmpty] - public string PartnerServer { get; set; } - - /// - /// Get the entities from the service - /// - /// The list of entities - protected override IEnumerable GetEntity() - { - return new List() { - ModelAdapter.GetServerCommunicationLink(this.ResourceGroupName, this.ServerName, this.LinkName) - }; - } - - /// - /// Create the model from user input - /// - /// Model retrieved from service - /// The model that was passed in - protected override IEnumerable ApplyUserInputToModel(IEnumerable model) - { - string location = ModelAdapter.GetServerLocation(ResourceGroupName, ServerName); - List newEntity = new List(); - newEntity.Add(new AzureSqlServerCommunicationLinkModel() - { - ResourceGroupName = ResourceGroupName, - ServerName = ServerName, - Location = location, - Name = LinkName, - PartnerServer = MyInvocation.BoundParameters.ContainsKey("PartnerServer") ? PartnerServer : null, - }); - - return newEntity; - } - - /// - /// Update the server communication link - /// - /// The output of apply user input to model - /// The input entity - protected override IEnumerable PersistChanges(IEnumerable entity) - { - return new List() { - ModelAdapter.UpsertServerCommunicationLink(entity.First()) - }; - } - } -}