diff --git a/src/Synapse/Synapse/Az.Synapse.psd1 b/src/Synapse/Synapse/Az.Synapse.psd1 index c5348a5f6f76..8779d802d2a5 100644 --- a/src/Synapse/Synapse/Az.Synapse.psd1 +++ b/src/Synapse/Synapse/Az.Synapse.psd1 @@ -228,7 +228,16 @@ CmdletsToExport = 'Get-AzSynapseSparkJob', 'Stop-AzSynapseSparkJob', 'Export-AzSynapseKqlScript', 'Get-AzSynapseActiveDirectoryOnlyAuthentication', 'Enable-AzSynapseActiveDirectoryOnlyAuthentication', - 'Disable-AzSynapseActiveDirectoryOnlyAuthentication' + 'Disable-AzSynapseActiveDirectoryOnlyAuthentication', + 'Set-AzSynapseLinkConnectionLinkTable','Get-AzSynapseLinkConnectionLinkTable', + 'Get-AzSynapseLinkConnectionLinkTableStatus', + 'Update-AzSynapseLinkConnectionLandingZoneCredential', + 'Get-AzSynapseLinkConnection', + 'Set-AzSynapseLinkConnection', + 'Start-AzSynapseLinkConnection', + 'Stop-AzSynapseLinkConnection', + 'Remove-AzSynapseLinkConnection', + 'Get-AzSynapseLinkConnectionDetailedStatus' # Variables to export from this module # VariablesToExport = @() @@ -251,7 +260,8 @@ AliasesToExport = 'New-AzSynapsePipeline', 'New-AzSynapseLinkedService', 'Set-AzSynapseManagedPrivateEndpoint', 'New-AzSynapseSqlScript', 'Import-AzSynapseSqlScript', 'Set-AzSynapseSparkConfiguration', 'Import-AzSynapseSparkConfiguration', 'Set-AzSynapseKqlScript', - 'Import-AzSynapseKqlScript' + 'Import-AzSynapseKqlScript', + 'New-AzSynapseLinkConnection' # DSC resources to export from this module # DscResourcesToExport = @() diff --git a/src/Synapse/Synapse/ChangeLog.md b/src/Synapse/Synapse/ChangeLog.md index 30ba5f56b369..a64f9615e5e0 100644 --- a/src/Synapse/Synapse/ChangeLog.md +++ b/src/Synapse/Synapse/ChangeLog.md @@ -19,6 +19,17 @@ --> ## Upcoming Release +* Added support for Synapse Link for Azure Sql Database + - Added `Get-AzSynapseLinkConnection` cmdlet + - Added `Get-AzSynapseLinkConnectionDetailedStatus` cmdlet + - Added `Set-AzSynapseLinkConnection` cmdlet + - Added `Remove-AzSynapseLinkConnection` cmdlet + - Added `Start-AzSynapseLinkConnection` cmdlet + - Added `Stop-AzSynapseLinkConnection` cmdlet + - Added `Set-AzSynapseLinkConnectionLinkTable` cmdlet + - Added `Get-AzSynapseLinkConnectionLinkTable` cmdlet + - Added `Get-AzSynapseLinkConnectionLinkTableStatus` cmdlet + - Added `Update-AzSynapseLinkConnectionLandingZoneCredential` cmdlet * Set UploadedTimestamp when adding package to spark pool by `Update-AzSynapseSparkPool` ## Version 1.3.0 diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionDetailedStatus.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionDetailedStatus.cs new file mode 100644 index 000000000000..e4ed7c629fb0 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionDetailedStatus.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.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using System.Management.Automation; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.WindowsAzure.Commands.Utilities.Common; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionDetailedStatus, DefaultParameterSetName = GetByName)] + [OutputType(typeof(PSLinkConnectionDetailedStatus))] + public class GetAzureSynapseLinkConnectionDetailedStatus : SynapseArtifactsCmdletBase + { + private const string GetByName = "GetByName"; + private const string GetByObject = "GetByObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + [Alias("LinkConnectionName")] + public string Name { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + WriteObject(new PSLinkConnectionDetailedStatus(SynapseAnalyticsClient.GetLinkConnectionDetailedStatus(this.Name), this.WorkspaceName)); + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionLinkTable.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionLinkTable.cs new file mode 100644 index 000000000000..cbbe93b28f45 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionLinkTable.cs @@ -0,0 +1,74 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionLinkTable, + DefaultParameterSetName = GetByName)] + [OutputType(typeof(PSLinkTableResource))] + public class GetAzureSynapseLinkConnectionLinkTable : SynapseArtifactsCmdletBase + { + private const string GetByName = "GetByName"; + private const string GetByObject = "GetByObject"; + private const string GetByInputObject = "GetByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = GetByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + public string LinkConnectionName { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.LinkConnectionName = this.InputObject.Name; + } + + var linkTables = SynapseAnalyticsClient.ListLinkTables(this.LinkConnectionName) + .Select(element => new PSLinkTableResource(element, this.WorkspaceName, this.LinkConnectionName)); + WriteObject(linkTables, true); + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionLinkTableStatus.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionLinkTableStatus.cs new file mode 100644 index 000000000000..021f9a585a3c --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynapseLinkConnectionLinkTableStatus.cs @@ -0,0 +1,92 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionLinkTableStatus, + DefaultParameterSetName = GetByName)] + [OutputType(typeof(PSLinkConnectionQueryTableStatus))] + public class GetAzureSynapseLinkConnectionLinkTableStatus : SynapseArtifactsCmdletBase + { + private const string GetByName = "GetByName"; + private const string GetByObject = "GetByObject"; + private const string GetByInputObject = "GetByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + public string LinkConnectionName { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true, HelpMessage = HelpMessages.MaxSegmentCount)] + [ValidateNotNullOrEmpty] + public int MaxSegmentCount { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = GetByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = false, HelpMessage = HelpMessages.LinkTableContinuationToken)] + [ValidateNotNullOrEmpty] + public object ContinuationToken { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.LinkConnectionName = this.InputObject.Name; + } + + var queryTableStatusRequest = new QueryTableStatusRequest + { + MaxSegmentCount = this.MaxSegmentCount + }; + + if (this.IsParameterBound(c => c.ContinuationToken)) + { + queryTableStatusRequest.ContinuationToken = this.ContinuationToken; + } + + var linkTablesStatus = new PSLinkConnectionQueryTableStatus(SynapseAnalyticsClient.QueryTableStatus(this.LinkConnectionName, queryTableStatusRequest)); + + WriteObject(linkTablesStatus, true); + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynaspeLinkConnection.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynaspeLinkConnection.cs new file mode 100644 index 000000000000..dda504cb7c68 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/GetAzureSynaspeLinkConnection.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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Get,ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection, DefaultParameterSetName = GetByName)] + [OutputType(typeof(PSLinkConnectionResource))] + public class GetAzureSynaspeLinkConnection: SynapseArtifactsCmdletBase + { + private const string GetByName = "GetByName"; + private const string GetByObject = "GetByObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = GetByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = GetByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = false, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + [Alias("LinkConnectionName")] + public string Name { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if(this.IsParameterBound(c => c.Name)) + { + WriteObject(new PSLinkConnectionResource(SynapseAnalyticsClient.GetLinkConnection(this.Name), this.WorkspaceName)); + } + else + { + var linkConnections = SynapseAnalyticsClient.GetLinkConnectionByWorkspace() + .Select(element => new PSLinkConnectionResource(element,this.WorkspaceName)); + WriteObject(linkConnections, true); + } + } + + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/RemoveAzureSynaspeLinkConnection.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/RemoveAzureSynaspeLinkConnection.cs new file mode 100644 index 000000000000..4f97ecf91433 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/RemoveAzureSynaspeLinkConnection.cs @@ -0,0 +1,94 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.Azure.Commands.Synapse.Properties; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Remove, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection, + DefaultParameterSetName = RemoveByName, SupportsShouldProcess = true)] + [OutputType(typeof(bool))] + public class RemoveAzureSynaspeLinkConnection : SynapseArtifactsCmdletBase + { + private const string RemoveByName = "RemoveByName"; + private const string RemoveByObject = "RemoveByObject"; + private const string RemoveByInputObject = "RemoveByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = RemoveByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = RemoveByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = RemoveByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = RemoveByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + [Alias("LinkConnectionName")] + public string Name { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = RemoveByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.PassThru)] + public SwitchParameter PassThru { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.AsJob)] + public SwitchParameter AsJob { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.Force)] + public SwitchParameter Force { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.Name = this.InputObject.Name; + } + + ConfirmAction( + Force.IsPresent, + string.Format(Resources.RemoveSynapseLinkConnection, this.Name, this.WorkspaceName), + string.Format(Resources.RemovingSynapseLinkConnection, this.Name, this.WorkspaceName), + this.Name, + () => + { + SynapseAnalyticsClient.DeleteLinkConnection(this.Name); + if (PassThru) + { + WriteObject(true); + } + }); + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/SetAzureSynapseLinkConnection.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/SetAzureSynapseLinkConnection.cs new file mode 100644 index 000000000000..8b95a90f43a1 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/SetAzureSynapseLinkConnection.cs @@ -0,0 +1,72 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.Azure.Commands.Synapse.Properties; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection, + DefaultParameterSetName = SetByName, SupportsShouldProcess = true)] + [Alias("New-" + ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection)] + [OutputType(typeof(PSLinkConnectionResource))] + public class SetAzureSynapseLinkConnection : SynapseArtifactsCmdletBase + { + private const string SetByName = "SetByName"; + private const string SetByObject = "SetByObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = SetByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = SetByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + [Alias("LinkConnectionName")] + public string Name { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true, HelpMessage = HelpMessages.JsonFilePath)] + [ValidateNotNullOrEmpty] + [Alias("File")] + public string DefinitionFile { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.AsJob)] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.ShouldProcess(this.WorkspaceName, String.Format(Resources.SettingSynapseLinkConnection, this.Name, this.WorkspaceName))) + { + string rawJsonContent = SynapseAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(DefinitionFile)); + WriteObject(new PSLinkConnectionResource(SynapseAnalyticsClient.CreateOrUpdateLinkConnection(this.Name, rawJsonContent), this.WorkspaceName)); + } + } + } +} \ No newline at end of file diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/SetAzureSynapseLinkConnectionLinkTable.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/SetAzureSynapseLinkConnectionLinkTable.cs new file mode 100644 index 000000000000..b52eb8140ec3 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/SetAzureSynapseLinkConnectionLinkTable.cs @@ -0,0 +1,84 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.Azure.Commands.Synapse.Properties; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionLinkTable, + DefaultParameterSetName = SetByName, SupportsShouldProcess = true)] + [OutputType(typeof(void))] + public class SetAzureSynapseLinkConnectionLinkTable : SynapseArtifactsCmdletBase + { + private const string SetByName = "SetByName"; + private const string SetByObject = "SetByObject"; + private const string SetByInputObject = "SetByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = SetByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = SetByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true, HelpMessage = HelpMessages.EditTablesRequestFile)] + [ValidateNotNullOrEmpty] + [Alias("File")] + public string EditTablesRequestFile { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = SetByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = SetByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + public string LinkConnectionName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = SetByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.AsJob)] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.LinkConnectionName = this.InputObject.Name; + } + + if (this.ShouldProcess(this.WorkspaceName, String.Format(Resources.EditingLinkConnectionLinkTables, this.LinkConnectionName, this.WorkspaceName))) + { + var rawJsonContent = SynapseAnalyticsClient.ReadJsonFileContent(this.TryResolvePath(EditTablesRequestFile)); + SynapseAnalyticsClient.EditTables(this.LinkConnectionName, rawJsonContent); + } + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/StartAzureSynapseLinkConnection.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/StartAzureSynapseLinkConnection.cs new file mode 100644 index 000000000000..9824f876b57f --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/StartAzureSynapseLinkConnection.cs @@ -0,0 +1,86 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.Azure.Commands.Synapse.Properties; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsLifecycle.Start, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection, + DefaultParameterSetName = StartByName, SupportsShouldProcess = true)] + [OutputType(typeof(bool))] + public class StartAzureSynapseLinkConnection : SynapseArtifactsCmdletBase + { + private const string StartByName = "StartByName"; + private const string StartByObject = "StartByObject"; + private const string StartByInputObject = "StartByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = StartByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = StartByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = StartByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = StartByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + [Alias("LinkConnectionName")] + public string Name { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = StartByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.PassThru)] + public SwitchParameter PassThru { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.AsJob)] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.Name = this.InputObject.Name; + } + + if (this.ShouldProcess(this.Name, string.Format(Resources.StartingSynapseLinkConnection, this.Name, this.WorkspaceName))) + { + SynapseAnalyticsClient.StartLinkConnection(this.Name); + if (PassThru) + { + WriteObject(true); + } + } + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/StopAzureSynapseLinkConnection.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/StopAzureSynapseLinkConnection.cs new file mode 100644 index 000000000000..95ec16c2c2ff --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/StopAzureSynapseLinkConnection.cs @@ -0,0 +1,86 @@ +// ---------------------------------------------------------------------------------- +// +// 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.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System.Management.Automation; +using Microsoft.Azure.Commands.Synapse.Properties; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsLifecycle.Stop, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnection, + DefaultParameterSetName = StopByName, SupportsShouldProcess = true)] + [OutputType(typeof(bool))] + public class StopAzureSynapseLinkConnection : SynapseArtifactsCmdletBase + { + private const string StopByName = "StopByName"; + private const string StopByObject = "StopByObject"; + private const string StopByInputObject = "StopByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = StopByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = StopByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = StopByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = StopByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = StopByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [ValidateNotNullOrEmpty] + [Alias("LinkConnectionName")] + public string Name { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.PassThru)] + public SwitchParameter PassThru { get; set; } + + [Parameter(Mandatory = false, HelpMessage = HelpMessages.AsJob)] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.Name = this.InputObject.Name; + } + + if (this.ShouldProcess(this.WorkspaceName, string.Format(Resources.StoppingPipelineRun, this.Name, this.WorkspaceName))) + { + SynapseAnalyticsClient.StopLinkConnection(this.Name); + if (this.PassThru) + { + WriteObject(true); + } + } + } + } +} diff --git a/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/UpdateAzureSynapseLinkConnectionLandingZoneCredential.cs b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/UpdateAzureSynapseLinkConnectionLandingZoneCredential.cs new file mode 100644 index 000000000000..f8a387b70381 --- /dev/null +++ b/src/Synapse/Synapse/Commands/DataPlaneCommands/Artifact/LinkConnection/UpdateAzureSynapseLinkConnectionLandingZoneCredential.cs @@ -0,0 +1,83 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.Synapse.Common; +using Microsoft.Azure.Commands.Synapse.Models; +using Microsoft.Azure.Commands.Synapse.Properties; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using System; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Synapse +{ + [Cmdlet(VerbsData.Update, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + SynapseConstants.SynapsePrefix + SynapseConstants.LinkConnectionLandingZoneCredential, + DefaultParameterSetName = UpdateByName, SupportsShouldProcess = true)] + [OutputType(typeof(void))] + public class UpdateAzureSynapseLinkConnectionLandingZoneCredential : SynapseArtifactsCmdletBase + { + private const string UpdateByName = "UpdateByName"; + private const string UpdateByObject = "UpdateByObject"; + private const string UpdateByInputObject = "UpdateByInputObject"; + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = UpdateByName, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceName)] + [ResourceNameCompleter(ResourceTypes.Workspace, "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public override string WorkspaceName { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = UpdateByObject, + Mandatory = true, HelpMessage = HelpMessages.WorkspaceObject)] + [ValidateNotNull] + public PSSynapseWorkspace WorkspaceObject { get; set; } + + [Parameter(ValueFromPipeline = true, ParameterSetName = UpdateByInputObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionObject)] + [ValidateNotNull] + public PSLinkConnectionResource InputObject { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = UpdateByName, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + [Parameter(ValueFromPipelineByPropertyName = false, ParameterSetName = UpdateByObject, + Mandatory = true, HelpMessage = HelpMessages.LinkConnectionName)] + public string LinkConnectionName { get; set; } + + [Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true, HelpMessage = HelpMessages.SasToken)] + [ValidateNotNullOrEmpty] + public SecureString SasToken { get; set; } + + public override void ExecuteCmdlet() + { + if (this.IsParameterBound(c => c.WorkspaceObject)) + { + this.WorkspaceName = this.WorkspaceObject.Name; + } + + if (this.IsParameterBound(c => c.InputObject)) + { + this.WorkspaceName = this.InputObject.WorkspaceName; + this.LinkConnectionName = this.InputObject.Name; + } + + var updateLandingZoneCredential = new UpdateLandingZoneCredential(); + updateLandingZoneCredential.SasToken = this.SasToken; + + if (this.ShouldProcess(this.WorkspaceName, String.Format(Resources.UpdatingLinkConnectionLandingZoneCredential, this.LinkConnectionName, this.WorkspaceName))) + { + SynapseAnalyticsClient.UpdateLandingZoneCredential(this.LinkConnectionName, updateLandingZoneCredential); + } + } + } +} diff --git a/src/Synapse/Synapse/Common/HelpMessages.cs b/src/Synapse/Synapse/Common/HelpMessages.cs index 73ac490d7075..85d15da8d115 100644 --- a/src/Synapse/Synapse/Common/HelpMessages.cs +++ b/src/Synapse/Synapse/Common/HelpMessages.cs @@ -228,6 +228,18 @@ public static class HelpMessages public const string ObjectId = "Specifies the object ID of the user or group in Azure Active Directory for which to grant permissions."; + public const string LinkConnectionName = "Name of link connection."; + + public const string MaxSegmentCount = "Max segment count to query table status."; + + public const string SasToken = "Landing zone's sas token."; + + public const string EditTablesRequestFile = "Specifies a local file path for a file to edit link tables"; + + public const string LinkTableContinuationToken = "Continuation token to query table status."; + + public const string LinkConnectionObject = "The information about the link connection."; + // TODO: need to update to Synapse link in future public const string AuditActionGroup = @"The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSEditTablesRequest.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSEditTablesRequest.cs new file mode 100644 index 000000000000..6a9eeca175ed --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSEditTablesRequest.cs @@ -0,0 +1,30 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSEditTablesRequest + { + public PSEditTablesRequest(EditTablesRequest editTablesRequest) + { + this.LinkTables = editTablesRequest?.LinkTables?.Select(element => new PSLinkTableRequest(element)).ToList(); + } + + public IList LinkTables { get; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnection.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnection.cs new file mode 100644 index 000000000000..1d5fb0bb76ac --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnection.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. +// ---------------------------------------------------------------------------------- + +using Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnection + { + public PSLinkConnection(LinkConnection linkConnection) + { + this.SourceDatabase = linkConnection?.SourceDatabase != null ? new PSLinkConnectionSourceDatabase(linkConnection?.SourceDatabase) : null; + this.TargetDatabase = linkConnection?.TargetDatabase != null ? new PSLinkConnectionTargetDatabase(linkConnection?.TargetDatabase) : null; + this.LandingZone = linkConnection?.LandingZone != null ? new PSLinkConnectionLandingZone(linkConnection?.LandingZone) : null; + this.Compute = linkConnection?.Compute != null ? new PSLinkConnectionCompute(linkConnection?.Compute) : null; + } + + public PSLinkConnectionSourceDatabase SourceDatabase{ get; set;} + + public PSLinkConnectionTargetDatabase TargetDatabase { get; set;} + + public PSLinkConnectionLandingZone LandingZone { get; set; } + + public PSLinkConnectionCompute Compute { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionCompute.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionCompute.cs new file mode 100644 index 000000000000..a6c77b563527 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionCompute.cs @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionCompute + { + public PSLinkConnectionCompute(LinkConnectionCompute linkConnectionCompute) + { + this.CoreCount = linkConnectionCompute?.CoreCount; + this.ComputeType = linkConnectionCompute?.ComputeType; + } + + public int? CoreCount { get; set; } + + public string ComputeType { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionDetailedStatus.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionDetailedStatus.cs new file mode 100644 index 000000000000..4f82f303dce3 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionDetailedStatus.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 Azure.Analytics.Synapse.Artifacts.Models; + +using Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionDetailedStatus + { + public PSLinkConnectionDetailedStatus(LinkConnectionDetailedStatus detailedStatus, string workspaceName) + { + this.WorkspaceName = workspaceName; + this.Id = detailedStatus?.Id; + this.Name = detailedStatus?.Name; + this.IsApplyingChanges = detailedStatus?.IsApplyingChanges; + this.IsPartiallyFailed = detailedStatus?.IsPartiallyFailed; + this.StartTime = detailedStatus?.StartTime; + this.StopTime = detailedStatus?.StopTime; + this.Status = detailedStatus?.Status; + this.ContinuousRunId = detailedStatus?.ContinuousRunId; + this.Error = detailedStatus?.Error; + } + + public string WorkspaceName { get; set; } + + public string Id { get; } + + public string Name { get; } + + public bool? IsApplyingChanges { get; } + + public bool? IsPartiallyFailed { get; } + + public object StartTime { get; } + + public object StopTime { get; } + + public string Status { get; } + + public string ContinuousRunId { get; } + + public object Error { get; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionLandingZone.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionLandingZone.cs new file mode 100644 index 000000000000..47c64a0ffc92 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionLandingZone.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. +// ---------------------------------------------------------------------------------- + +using Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionLandingZone + { + public PSLinkConnectionLandingZone(LinkConnectionLandingZone landingZone) + { + this.LinkedService = landingZone?.LinkedService != null ? new PSLinkedServiceReference(landingZone?.LinkedService) : null; + this.FileSystem = landingZone?.FileSystem; + this.FolderPath = landingZone?.FolderPath; + this.SasToken = landingZone?.SasToken != null ? new PSSecureString(landingZone?.SasToken) : null; + } + + public PSLinkedServiceReference LinkedService { get; set; } + + public string FileSystem { get; set; } + + public string FolderPath { get; set; } + + public PSSecureString SasToken { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionQueryTableStatus.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionQueryTableStatus.cs new file mode 100644 index 000000000000..819abe1e516c --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionQueryTableStatus.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionQueryTableStatus + { + public PSLinkConnectionQueryTableStatus(LinkConnectionQueryTableStatus linkConnectionQueryTableStatus) + { + this.Value = linkConnectionQueryTableStatus?.Value.Select(element => new PSLinkTableStatus(element)).ToList(); + this.ContinuationToken = linkConnectionQueryTableStatus?.ContinuationToken; + } + + public IReadOnlyList Value { get; } + + public object ContinuationToken { get; } + + [JsonIgnore] + public string ValueText + { + get { return JsonConvert.SerializeObject(Value, Formatting.Indented, new JsonSerializerSettings()); } + } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionResource.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionResource.cs new file mode 100644 index 000000000000..85e6e2b02d24 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionResource.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionResource + { + public PSLinkConnectionResource(LinkConnectionResource linkConnectionResource, string workspaceName) + { + this.WorkspaceName = workspaceName; + this.Id = linkConnectionResource?.Id; + this.Name = linkConnectionResource?.Name; + this.Type = linkConnectionResource?.Type; + this.Properties = linkConnectionResource?.Properties; + } + + public string WorkspaceName { get; set; } + + public string Id { get; set; } + + public string Name { get; set; } + + public string Type { get; set; } + + public LinkConnection Properties { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionSourceDatabase.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionSourceDatabase.cs new file mode 100644 index 000000000000..f07b6cc79a3d --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionSourceDatabase.cs @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionSourceDatabase + { + public PSLinkConnectionSourceDatabase(LinkConnectionSourceDatabase sourceDatabase) + { + this.LinkedService = sourceDatabase?.LinkedService != null ? new PSLinkedServiceReference(sourceDatabase?.LinkedService) : null; + this.TypeProperties = sourceDatabase?.TypeProperties != null ? new PSLinkConnectionSourceDatabaseTypeProperties(sourceDatabase?.TypeProperties) : null; + } + + public PSLinkedServiceReference LinkedService { get; set; } + + public PSLinkConnectionSourceDatabaseTypeProperties TypeProperties { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionSourceDatabaseTypeProperties.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionSourceDatabaseTypeProperties.cs new file mode 100644 index 000000000000..c544f0fa8ff2 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionSourceDatabaseTypeProperties.cs @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionSourceDatabaseTypeProperties + { + public PSLinkConnectionSourceDatabaseTypeProperties(LinkConnectionSourceDatabaseTypeProperties properties) + { + this.ResourceId = properties?.ResourceId; + this.PrincipalId = properties?.PrincipalId; + } + + public string ResourceId { get; set; } + + public string PrincipalId { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionTargetDatabase.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionTargetDatabase.cs new file mode 100644 index 000000000000..7ddff3be8d46 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkConnectionTargetDatabase.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkConnectionTargetDatabase + { + public PSLinkConnectionTargetDatabase(LinkConnectionTargetDatabase targetDatabase) + { + this.LinkedService = targetDatabase?.LinkedService != null ? new PSLinkedServiceReference(targetDatabase?.LinkedService) : null; + } + + public PSLinkedServiceReference LinkedService { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequest.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequest.cs new file mode 100644 index 000000000000..a70b33a5a4d5 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequest.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. +// ---------------------------------------------------------------------------------- + +using Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkTableRequest + { + public PSLinkTableRequest(LinkTableRequest linkTableRequest) + { + this.Id = linkTableRequest?.Id; + this.Source = new PSLinkTableRequestSource(linkTableRequest?.Source); + this.Target = new PSLinkTableRequestTarget(linkTableRequest?.Target); + this.OperationType = linkTableRequest?.OperationType; + } + + public string Id { get; set; } + + public PSLinkTableRequestSource Source { get; set; } + + public PSLinkTableRequestTarget Target { get; set; } + + public string OperationType { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestSource.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestSource.cs new file mode 100644 index 000000000000..47e6f24a1bcf --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestSource.cs @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkTableRequestSource + { + public PSLinkTableRequestSource(LinkTableRequestSource linkTableRequestSource) + { + this.TableName = linkTableRequestSource?.TableName; + this.SchemaName = linkTableRequestSource?.SchemaName; + } + + public string TableName { get; set; } + + public string SchemaName { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestTarget.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestTarget.cs new file mode 100644 index 000000000000..0ff941dc43e0 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestTarget.cs @@ -0,0 +1,34 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkTableRequestTarget + { + public PSLinkTableRequestTarget(LinkTableRequestTarget linkTableRequestTarget) + { + this.TableName = linkTableRequestTarget?.TableName; + this.SchemaName = linkTableRequestTarget?.SchemaName; + this.DistributionOptions = new PSLinkTableRequestTargetDistributionOptions(linkTableRequestTarget?.DistributionOptions); + } + + public string TableName { get; set; } + + public string SchemaName { get; set; } + + public PSLinkTableRequestTargetDistributionOptions DistributionOptions { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestTargetDistributionOptions.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestTargetDistributionOptions.cs new file mode 100644 index 000000000000..ea17ee3fb1a7 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableRequestTargetDistributionOptions.cs @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkTableRequestTargetDistributionOptions + { + public PSLinkTableRequestTargetDistributionOptions(LinkTableRequestTargetDistributionOptions linkTableRequestTargetDistributionOptions) + { + this.Type = linkTableRequestTargetDistributionOptions?.Type; + this.DistributionColumn = linkTableRequestTargetDistributionOptions?.DistributionColumn; + } + + public string Type { get; set; } + + public string DistributionColumn { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableResource.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableResource.cs new file mode 100644 index 000000000000..60d098b9288a --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableResource.cs @@ -0,0 +1,43 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkTableResource + { + public PSLinkTableResource(LinkTableResource linkTableResource, string workspaceName, string linkConnectionName) + { + this.WorkspaceName = workspaceName; + this.LinkConnectionName = linkConnectionName; + this.Id = linkTableResource?.Id; + this.Name = linkTableResource?.Name; + this.Source = new PSLinkTableRequestSource(linkTableResource?.Source); + this.Target = new PSLinkTableRequestTarget(linkTableResource?.Target); + } + + public string WorkspaceName { get; set; } + + public string LinkConnectionName { get; set; } + + public string Id { get; } + + public string Name { get; } + + public PSLinkTableRequestSource Source { get; } + + public PSLinkTableRequestTarget Target { get; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableStatus.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableStatus.cs new file mode 100644 index 000000000000..176043d22ec5 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkTableStatus.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkTableStatus + { + public PSLinkTableStatus(LinkTableStatus linkTableStatus) + { + this.Id = linkTableStatus?.Id; + this.Status = linkTableStatus?.Status; + this.ErrorMessage = linkTableStatus?.ErrorMessage; + this.StartTime = linkTableStatus?.StartTime; + this.StopTime = linkTableStatus?.StopTime; + } + + public string Id { get; } + + public string Status { get; } + + public string ErrorMessage { get; } + + public object StartTime { get; } + + public object StopTime { get; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkedServiceReference.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkedServiceReference.cs new file mode 100644 index 000000000000..c53c3b7cefd4 --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSLinkedServiceReference.cs @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts; +using Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSLinkedServiceReference + { + public PSLinkedServiceReference(LinkedServiceReference linkServiceReference) + { + this.Type = linkServiceReference?.Type; + this.ReferenceName = linkServiceReference?.ReferenceName; + this.Parameters = linkServiceReference?.Parameters; + } + + public LinkedServiceReferenceType? Type { get; set; } + + public string ReferenceName { get; set; } + + public object Parameters { get; set; } + } +} + diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSSecureString.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSSecureString.cs new file mode 100644 index 000000000000..d94358978bcb --- /dev/null +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/LinkConnection/PSSecureString.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// 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 Azure.Analytics.Synapse.Artifacts.Models; + +namespace Microsoft.Azure.Commands.Synapse.Models +{ + public class PSSecureString + { + public PSSecureString(SecureString secureString) + { + this.Value = secureString?.Value; + } + + public string Value { get; set; } + } +} diff --git a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/SynapseAnalyticsArtifactsClient.cs b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/SynapseAnalyticsArtifactsClient.cs index ba0969c0ac14..21db7f4d80bd 100644 --- a/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/SynapseAnalyticsArtifactsClient.cs +++ b/src/Synapse/Synapse/Models/DataPlaneModels/Artifact/SynapseAnalyticsArtifactsClient.cs @@ -45,6 +45,7 @@ public partial class SynapseAnalyticsArtifactsClient private readonly SparkConfigurationClient _sparkConfigurationClient; private readonly KqlScriptClient _kqlScriptClient; private readonly KqlScriptsClient _kqlScriptsClient; + private readonly LinkConnectionClient _linkConnectionClient; public SynapseAnalyticsArtifactsClient(string workspaceName, IAzureContext context) { @@ -72,6 +73,7 @@ public SynapseAnalyticsArtifactsClient(string workspaceName, IAzureContext conte _sparkConfigurationClient = new SparkConfigurationClient(uri, new AzureSessionCredential(context)); _kqlScriptClient = new KqlScriptClient(uri, new AzureSessionCredential(context)); _kqlScriptsClient = new KqlScriptsClient(uri, new AzureSessionCredential(context)); + _linkConnectionClient = new LinkConnectionClient(uri, new AzureSessionCredential(context)); } #region pipeline @@ -480,6 +482,67 @@ public KqlScriptResource CreateOrUpdateKqlScript(string kqlScriptName, KqlScript #endregion + #region Link Connection + + public void EditTables(string linkConnectionName, string rawJsonContent) + { + EditTablesRequest editTablesRequest = JsonConvert.DeserializeObject(rawJsonContent); + _linkConnectionClient.EditTables(linkConnectionName, editTablesRequest); + } + + public IReadOnlyList ListLinkTables(string linkConnectionName) + { + return _linkConnectionClient.ListLinkTables(linkConnectionName).Value.Value; + } + + public LinkConnectionQueryTableStatus QueryTableStatus(string linkConnectionName, QueryTableStatusRequest queryTableStatusRequest) + { + return _linkConnectionClient.QueryTableStatus(linkConnectionName, queryTableStatusRequest); + } + + public void UpdateLandingZoneCredential(string linkConnectionName, UpdateLandingZoneCredential updateLandingZoneCredentialRequest) + { + _linkConnectionClient.UpdateLandingZoneCredential(linkConnectionName, updateLandingZoneCredentialRequest); + } + + public LinkConnectionResource GetLinkConnection(string linkConnectionName) + { + return _linkConnectionClient.GetLinkConnection(linkConnectionName).Value; + } + + public Pageable GetLinkConnectionByWorkspace() + { + return _linkConnectionClient.ListLinkConnectionsByWorkspace(); + } + + public void StartLinkConnection(string linkConnectionName) + { + _linkConnectionClient.Start(linkConnectionName); + } + + public void StopLinkConnection(string linkConnectionName) + { + _linkConnectionClient.Stop(linkConnectionName); + } + + public void DeleteLinkConnection(string linkConnectionName) + { + _linkConnectionClient.DeleteLinkConnection(linkConnectionName); + } + + public LinkConnectionResource CreateOrUpdateLinkConnection(string linkConnectionName, string rawJsonContent) + { + LinkConnectionResource linkConnection = JsonConvert.DeserializeObject(rawJsonContent); + var response = _linkConnectionClient.CreateOrUpdateLinkConnection(linkConnectionName, linkConnection); + return response.Value; + } + + public LinkConnectionDetailedStatus GetLinkConnectionDetailedStatus(string linkConnectionName) + { + return _linkConnectionClient.GetDetailedStatus(linkConnectionName).Value; + } + #endregion + #region helpers public virtual string ReadJsonFileContent(string path) diff --git a/src/Synapse/Synapse/Models/SynapseConstants.cs b/src/Synapse/Synapse/Models/SynapseConstants.cs index 7e042e46e605..c50b28199af1 100644 --- a/src/Synapse/Synapse/Models/SynapseConstants.cs +++ b/src/Synapse/Synapse/Models/SynapseConstants.cs @@ -207,6 +207,16 @@ public static class SynapseConstants public const string ActiveDirectoryOnlyAuthentication = nameof(ActiveDirectoryOnlyAuthentication); + public const string LinkConnectionLinkTable = nameof(LinkConnectionLinkTable); + + public const string LinkConnectionLinkTableStatus = nameof(LinkConnectionLinkTableStatus); + + public const string LinkConnectionLandingZoneCredential = nameof(LinkConnectionLandingZoneCredential); + + public const string LinkConnection = nameof(LinkConnection); + + public const string LinkConnectionDetailedStatus = nameof(LinkConnectionDetailedStatus); + public static Dictionary ComputeNodeSizes = new Dictionary { { diff --git a/src/Synapse/Synapse/Properties/Resources.Designer.cs b/src/Synapse/Synapse/Properties/Resources.Designer.cs index caa3708243d5..45ba1a80fe23 100644 --- a/src/Synapse/Synapse/Properties/Resources.Designer.cs +++ b/src/Synapse/Synapse/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Commands.Synapse.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -349,6 +349,15 @@ internal static string DisablingSynapseSparkPoolAutoScale { } } + /// + /// Looks up a localized string similar to Editing link tables under link connection '{0}' in workspace '{1}'.. + /// + internal static string EditingLinkConnectionLinkTables { + get { + return ResourceManager.GetString("EditingLinkConnectionLinkTables", resourceCulture); + } + } + /// /// Looks up a localized string similar to One or more of the email addresses you entered are not valid.. /// @@ -954,6 +963,15 @@ internal static string RemoveSynapseKqlScript { } } + /// + /// Looks up a localized string similar to Are you sure you want to remove link connection '{0}' under workspace '{1}'. + /// + internal static string RemoveSynapseLinkConnection { + get { + return ResourceManager.GetString("RemoveSynapseLinkConnection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Are you sure you want to remove linked service '{0}'?. /// @@ -1188,6 +1206,15 @@ internal static string RemovingSynapseKqlScript { } } + /// + /// Looks up a localized string similar to Removing link connection '{0}' in workspace '{1}'.... + /// + internal static string RemovingSynapseLinkConnection { + get { + return ResourceManager.GetString("RemovingSynapseLinkConnection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Deleting linked service '{0}' in workspace '{1}'.. /// @@ -1530,6 +1557,15 @@ internal static string SettingSynapseKqlScript { } } + /// + /// Looks up a localized string similar to Setting link connection '{0}' in workspace '{1}'.. + /// + internal static string SettingSynapseLinkConnection { + get { + return ResourceManager.GetString("SettingSynapseLinkConnection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Setting linked service '{0}' in workspace '{1}'.. /// @@ -1656,6 +1692,15 @@ internal static string StartingIntegrationRuntime { } } + /// + /// Looks up a localized string similar to Starting link connection '{0}' in workspace '{1}'.... + /// + internal static string StartingSynapseLinkConnection { + get { + return ResourceManager.GetString("StartingSynapseLinkConnection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Starting Spark session in Spark pool '{0}' under workspace '{1}' .... /// @@ -1719,6 +1764,15 @@ internal static string StoppingSparkStatement { } } + /// + /// Looks up a localized string similar to Stopping link connection '{0}' in workspace '{1}'.... + /// + internal static string StoppingSynapseLinkConnection { + get { + return ResourceManager.GetString("StoppingSynapseLinkConnection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Stopping Spark session with Id: '{0}' .... /// @@ -1894,6 +1948,15 @@ internal static string UpdatingIntegrationRuntimeNode { } } + /// + /// Looks up a localized string similar to Updating the landing zone credential of link connection '{0}' in workspace '{1}'.. + /// + internal static string UpdatingLinkConnectionLandingZoneCredential { + get { + return ResourceManager.GetString("UpdatingLinkConnectionLandingZoneCredential", resourceCulture); + } + } + /// /// Looks up a localized string similar to Updating managed identity control permissions to SQL pools for pipeline integration on workspace '{0}'.. /// diff --git a/src/Synapse/Synapse/Properties/Resources.resx b/src/Synapse/Synapse/Properties/Resources.resx index cf7f0239814a..0c315ad576af 100644 --- a/src/Synapse/Synapse/Properties/Resources.resx +++ b/src/Synapse/Synapse/Properties/Resources.resx @@ -809,4 +809,25 @@ Failed: {2}. Enabling Azure AD only authentication for workspace '{0}' . + + Editing link tables under link connection '{0}' in workspace '{1}'. + + + Updating the landing zone credential of link connection '{0}' in workspace '{1}'. + + + Starting link connection '{0}' in workspace '{1}'... + + + Stopping link connection '{0}' in workspace '{1}'... + + + Are you sure you want to remove link connection '{0}' under workspace '{1}' + + + Removing link connection '{0}' in workspace '{1}'... + + + Setting link connection '{0}' in workspace '{1}'. + \ No newline at end of file diff --git a/src/Synapse/Synapse/Synapse.csproj b/src/Synapse/Synapse/Synapse.csproj index b5622e479d23..a7c35b40f7ed 100644 --- a/src/Synapse/Synapse/Synapse.csproj +++ b/src/Synapse/Synapse/Synapse.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Synapse/Synapse/Synapse.format.ps1xml b/src/Synapse/Synapse/Synapse.format.ps1xml index 164841563e0b..568dc0a4709d 100644 --- a/src/Synapse/Synapse/Synapse.format.ps1xml +++ b/src/Synapse/Synapse/Synapse.format.ps1xml @@ -77,5 +77,27 @@ + + Link Connection Query Table Status + + Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionQueryTableStatus + + + + + + + + ValueText + + + + ContinuationToken + + + + + + diff --git a/src/Synapse/Synapse/help/Az.Synapse.md b/src/Synapse/Synapse/help/Az.Synapse.md index fbac0a3430e4..eac96850fd66 100644 --- a/src/Synapse/Synapse/help/Az.Synapse.md +++ b/src/Synapse/Synapse/help/Az.Synapse.md @@ -86,6 +86,18 @@ Gets metric data for an integration runtime. ### [Get-AzSynapseIntegrationRuntimeNode](Get-AzSynapseIntegrationRuntimeNode.md) Gets an integration runtime node information. +### [Get-AzSynapseLinkConnectionLinkTable](Get-AzSynapseLinkConnectionLinkTable.md) +Gets information about link tables under a link connection. + +### [Get-AzSynapseLinkConnectionLinkTableStatus](Get-AzSynapseLinkConnectionLinkTableStatus.md) +Gets status of link tables under a link connection. + +### [Get-AzSynapseLinkConnection](Get-AzSynapseLinkConnection.md) +Gets information about link connections in workspace. + +### [Get-AzSynapseLinkConnectionDetailedStatus](Get-AzSynapseLinkConnectionDetailedStatus.md) +Gets detail status about a link connection in workspace. + ### [Get-AzSynapseLinkedService](Get-AzSynapseLinkedService.md) Gets information about linked services in workspace. @@ -371,6 +383,12 @@ Creates or updates a dataset in workspace. ### [Set-AzSynapseIntegrationRuntime](Set-AzSynapseIntegrationRuntime.md) Updates an integration runtime. +### [Set-AzSynapseLinkConnectionLinkTable](Set-AzSynapseLinkConnectionLinkTable.md) +Edits link tables under a link connection. + +### [Set-AzSynapseLinkConnection](Set-AzSynapseLinkConnection.md) +Creates or updates a link connection in workspace. + ### [Set-AzSynapseLinkedService](Set-AzSynapseLinkedService.md) Links a data store or a cloud service to workspace. @@ -479,6 +497,9 @@ Updates an integration runtime. ### [Update-AzSynapseIntegrationRuntimeNode](Update-AzSynapseIntegrationRuntimeNode.md) Updates self-hosted integration runtime node. +### [Update-AzSynapseLinkConnectionLandingZoneCredential](Update-AzSynapseLinkConnectionLandingZoneCredential.md) +Updates the landing zone credential of a link connection. + ### [Update-AzSynapseManagedVirtualNetworkConfig](Update-AzSynapseManagedVirtualNetworkConfig.md) Updates managed virtual network configuration to workspace. @@ -581,12 +602,21 @@ Remove a list of language extensions that can run within KQL queries. ### [Remove-AzSynapseKustoPoolPrincipalAssignment](Remove-AzSynapseKustoPoolPrincipalAssignment.md) Deletes a Kusto pool principalAssignment. +### [Remove-AzSynapseLinkConnection](Remove-AzSynapseLinkConnection.md) +Deletes a link connection from workspace. + ### [Start-AzSynapseKustoPool](Start-AzSynapseKustoPool.md) Starts a Kusto pool. +### [Start-AzSynapseLinkConnection](Start-AzSynapseLinkConnection.md) +Starts a link connection. + ### [Stop-AzSynapseKustoPool](Stop-AzSynapseKustoPool.md) Stops a Kusto pool. +### [Stop-AzSynapseLinkConnection](Stop-AzSynapseLinkConnection.md) +Stops a link connection. + ### [Update-AzSynapseKustoPool](Update-AzSynapseKustoPool.md) Update a Kusto Kusto Pool. diff --git a/src/Synapse/Synapse/help/Get-AzSynapseLinkConnection.md b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnection.md new file mode 100644 index 000000000000..07803d01caa4 --- /dev/null +++ b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnection.md @@ -0,0 +1,129 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/get-azsynapselinkconnection +schema: 2.0.0 +--- + +# Get-AzSynapseLinkConnection + +## SYNOPSIS +Gets information about link connections in workspace. + +## SYNTAX + +### GetByName (Default) +``` +Get-AzSynapseLinkConnection -WorkspaceName [-Name ] [-DefaultProfile ] + [] +``` + +### GetByObject +``` +Get-AzSynapseLinkConnection -WorkspaceObject [-Name ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +The **Get-AzSynapseLinkConnection** cmdlet gets information about link connections in a workspace. If you specify the name of a link connection, the cmdlet gets information about that link connection. If you do not specify a name, the cmdlet gets information about all link connections in the workspace. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace +``` + +Gets a list of all link connections in the workspace ContosoWorkspace. + +### Example 2 +```powershell +PS C:\> Get-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +Gets a single link connection named ContosoLinkConnection in the workspace ContosoWorkspace. + +### Example 3 +```powershell +PS C:\> $ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +PS C:\> $ws | Get-AzSynapseLinkConnection +``` + +This command gets all link connections under a workspace through pipeline. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The Synapse link connection name for Azure Sql Database. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: LinkConnectionName + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: GetByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: GetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +## OUTPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionDetailedStatus.md b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionDetailedStatus.md new file mode 100644 index 000000000000..64247e7b9f7f --- /dev/null +++ b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionDetailedStatus.md @@ -0,0 +1,140 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/get-azsynapselinkconnectiondetailedstatus +schema: 2.0.0 +--- + +# Get-AzSynapseLinkConnectionDetailedStatus + +## SYNOPSIS +Gets detail status about a link connection in workspace. + +## SYNTAX + +### GetByName (Default) +``` +Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceName -Name + [-DefaultProfile ] [] +``` + +### GetByObject +``` +Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceObject -Name + [-DefaultProfile ] [] +``` + +## DESCRIPTION +The **Get-AzSynapseLinkConnectionDetailedStatus** cmdlet gets detail status about a link connection in workspace. After starting/stopping a link connection, you can use this cmdlet to get the status of the link connection. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +Gets detail status about link connection ContosoLinkConnection in the workspace ContosoWorkspace. + +### Example 2 +```powershell +PS C:\> $ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +PS C:\> $ws | Get-AzSynapseLinkConnectionDetailedStatus -Name ContosoLinkConnection +``` + +This command gets detail status about link connection ContosoLinkConnection under a workspace through pipeline. + +### Example 3 +```powershell +PS C:\> Start-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +PS C:\> Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +Starts a link connection named ContosoLinkConnection in workspace ContosoWorkspace, it will cost some time to start, then you can call **Get-AzSynapseLinkConnectionDetailedStatus** to monitor its status. + +### Example 4 +```powershell +PS C:\> Stop-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +PS C:\> Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +Stops a link connection named ContosoLinkConnection in workspace ContosoWorkspace, it will cost some time from running to stop, then you can call **Get-AzSynapseLinkConnectionDetailedStatus** to monitor its status. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The Synapse link connection name for Azure Sql Database. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: LinkConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: GetByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: GetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionDetailedStatus + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionLinkTable.md b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionLinkTable.md new file mode 100644 index 000000000000..3ce1538fca28 --- /dev/null +++ b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionLinkTable.md @@ -0,0 +1,153 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/get-azsynapselinkconnectionlinktable +schema: 2.0.0 +--- + +# Get-AzSynapseLinkConnectionLinkTable + +## SYNOPSIS +Gets information about link tables under a link connection. + +## SYNTAX + +### GetByName (Default) +``` +Get-AzSynapseLinkConnectionLinkTable -WorkspaceName -LinkConnectionName + [-DefaultProfile ] [] +``` + +### GetByObject +``` +Get-AzSynapseLinkConnectionLinkTable -WorkspaceObject -LinkConnectionName + [-DefaultProfile ] [] +``` + +### GetByInputObject +``` +Get-AzSynapseLinkConnectionLinkTable -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +The **Get-AzSynapseLinkConnectionLinkTable** cmdlet gets information about link tables under a link connection. + +## EXAMPLES + +### Example 1 +```powershell +Get-AzSynapseLinkConnectionLinkTable -WorkspaceName ContosoWorkspace -LinkConnectionName ContosoLinkConnection +``` + +This command gets information about link tables under link connection ContosoLinkConnection in workspace ContosoWorkspace. + +### Example 2 +```powershell +$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +$ws | Get-AzSynapseLinkConnectionLinkTable -LinkConnectionName ContosoLinkConnection +``` + +This command gets information about link tables under link connection ContosoLinkConnection in workspace ContosoWorkspace through pipeline. + +### Example 3 +```powershell +$lc = Get-AzSynpaseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +$lc | Get-AzSynapseLinkConnectionLinkTable +``` + +This command gets information about link tables under a link connection through pipeline. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The information about the link connection. + +```yaml +Type: Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource +Parameter Sets: GetByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkConnectionName +Name of link connection. + +```yaml +Type: System.String +Parameter Sets: GetByName, GetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: System.String +Parameter Sets: GetByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace +Parameter Sets: GetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkTableResource + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionLinkTableStatus.md b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionLinkTableStatus.md new file mode 100644 index 000000000000..2a0ab31eaeba --- /dev/null +++ b/src/Synapse/Synapse/help/Get-AzSynapseLinkConnectionLinkTableStatus.md @@ -0,0 +1,185 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/get-azsynapselinkconnectionlinktablestatus +schema: 2.0.0 +--- + +# Get-AzSynapseLinkConnectionLinkTableStatus + +## SYNOPSIS +Gets status of link tables under a link connection. + +## SYNTAX + +### GetByName (Default) +``` +Get-AzSynapseLinkConnectionLinkTableStatus -WorkspaceName -LinkConnectionName + -MaxSegmentCount [-ContinuationToken ] [-DefaultProfile ] + [] +``` + +### GetByObject +``` +Get-AzSynapseLinkConnectionLinkTableStatus -WorkspaceObject -LinkConnectionName + -MaxSegmentCount [-ContinuationToken ] [-DefaultProfile ] + [] +``` + +### GetByInputObject +``` +Get-AzSynapseLinkConnectionLinkTableStatus -MaxSegmentCount -InputObject + [-ContinuationToken ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +The **Get-AzSynapseLinkConnectionLinkTablesStatus** cmdlet gets status of link tables under a link connection. + +## EXAMPLES + +### Example 1 +```powershell +Get-AzSynapseLinkConnectionLinkTablesStatus -WorkspaceName ContosoWorkspace -LinkConnectionName ContosoLinkConnection -MaxSegmentCount 50 +``` + +This command gets status of link tables with max segment count 50 under link connection ContosoLinkConnection in workspace ContosoWorkspace. + +### Example 2 +```powershell +$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +$ws | Get-AzSynapseLinkConnectionLinkTablesStatus -LinkConnectionName ContosoLinkConnection -MaxSegmentCount 50 +``` + +This command gets status of link tables with max segment count 50 under link connection ContosoLinkConnection in workspace ContosoWorkspace through pipeline. + +### Example 3 +```powershell +$lc = Get-AzSynpaseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +$lc | Get-AzSynapseLinkConnectionLinkTablesStatus -MaxSegmentCount 50 +``` + +This command gets status of link tables with max segment count 50 under a link connection through pipeline. + +## PARAMETERS + +### -ContinuationToken +Continuation token to query table status. + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The information about the link connection. + +```yaml +Type: PSLinkConnectionResource +Parameter Sets: GetByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkConnectionName +Name of link connection. + +```yaml +Type: String +Parameter Sets: GetByName, GetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxSegmentCount +Max segment count to query table status. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: GetByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: GetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionQueryTableStatus + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Remove-AzSynapseLinkConnection.md b/src/Synapse/Synapse/help/Remove-AzSynapseLinkConnection.md new file mode 100644 index 000000000000..fd8d8ad84dd3 --- /dev/null +++ b/src/Synapse/Synapse/help/Remove-AzSynapseLinkConnection.md @@ -0,0 +1,230 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/remove-azsynapselinkconnection +schema: 2.0.0 +--- + +# Remove-AzSynapseLinkConnection + +## SYNOPSIS +Deletes a link connection from workspace. + +## SYNTAX + +### RemoveByName (Default) +``` +Remove-AzSynapseLinkConnection -WorkspaceName -Name [-PassThru] [-AsJob] [-Force] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### RemoveByObject +``` +Remove-AzSynapseLinkConnection -WorkspaceObject -Name [-PassThru] [-AsJob] + [-Force] [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### RemoveByInputObject +``` +Remove-AzSynapseLinkConnection -InputObject [-PassThru] [-AsJob] [-Force] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Remove-AzSynapseLinkConnection** cmdlet removes a link connection from workspace. Only link connections in initial or stpped status can be removed. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +This command removes the link connection named ContosoLinkConnection from the workspace named ContosoWorkspace. + +### Example 2 +```powershell +PS C:\> $ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +PS C:\> $ws | Remove-AzSynapseLinkConnection -Name ContosoLinkConnection +``` + +This command removes the link connection named ContosoLinkConnection from the workspace named ContosoWorkspace through pipeline. + +### Example 3 +```powershell +PS C:\> $linkConnection = Get-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +PS C:\> $linkConnection | Remove-AzSynapseLinkConnection +``` + +This command removes the link connection named ContosoLinkConnection from the workspace named ContosoWorkspace through pipeline. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Do not ask for confirmation. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The Synapse link connection object for Azure Sql Database. + +```yaml +Type: PSLinkConnectionResource +Parameter Sets: RemoveByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The Synapse link connection name for Azure Sql Database. + +```yaml +Type: String +Parameter Sets: RemoveByName, RemoveByObject +Aliases: LinkConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +This Cmdlet does not return an object by default. +If this switch is specified, it returns true if successful. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: RemoveByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: RemoveByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Set-AzSynapseLinkConnection.md b/src/Synapse/Synapse/help/Set-AzSynapseLinkConnection.md new file mode 100644 index 000000000000..eb6a2fac7a99 --- /dev/null +++ b/src/Synapse/Synapse/help/Set-AzSynapseLinkConnection.md @@ -0,0 +1,183 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/set-azsynapselinkconnection +schema: 2.0.0 +--- + +# Set-AzSynapseLinkConnection + +## SYNOPSIS +Creates or updates a link connection in workspace. + +## SYNTAX + +### SetByName (Default) +``` +Set-AzSynapseLinkConnection -WorkspaceName -Name -DefinitionFile [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### SetByObject +``` +Set-AzSynapseLinkConnection -WorkspaceObject -Name -DefinitionFile + [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Set-AzSynapseLinkConnection** cmdlet creates or updates a link connections in a workspace. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Set-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -DefinitionFile "C:\\samples\\linkconnection.json" +``` + +This command creates or updates a link connection from definition file linkconnection.json in the workspace named ContosoWorkspace. + +### Example 2 +```powershell +PS C:\> $ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +PS C:\> $ws | Set-AzSynapseLinkConnection -DefinitionFile "C:\\samples\\linkconnection.json" +``` + +This command creates or updates a link connection from definition file linkconnection.json in the workspace named ContosoWorkspace through pipeline. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionFile +The JSON file path. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: File + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The Synapse link connection name for Azure Sql Database. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: LinkConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: SetByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: SetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +## OUTPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Set-AzSynapseLinkConnectionLinkTable.md b/src/Synapse/Synapse/help/Set-AzSynapseLinkConnectionLinkTable.md new file mode 100644 index 000000000000..1dae37d1288f --- /dev/null +++ b/src/Synapse/Synapse/help/Set-AzSynapseLinkConnectionLinkTable.md @@ -0,0 +1,222 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/set-azsynapselinkconnectionlinktables +schema: 2.0.0 +--- + +# Set-AzSynapseLinkConnectionLinkTable + +## SYNOPSIS +Edits link tables under a link connection. + +## SYNTAX + +### SetByName (Default) +``` +Set-AzSynapseLinkConnectionLinkTable -WorkspaceName -EditTablesRequestFile + -LinkConnectionName [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### SetByObject +``` +Set-AzSynapseLinkConnectionLinkTable -WorkspaceObject -EditTablesRequestFile + -LinkConnectionName [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### SetByInputObject +``` +Set-AzSynapseLinkConnectionLinkTable -EditTablesRequestFile -InputObject + [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Set-AzSynapseLinkConnectionLinkTables** cmdlet edits link tables under a link connection. + +## EXAMPLES + +### Example 1 +```powershell +Set-AzSynapseLinkConnectionLinkTables -WorkspaceName ContosoWorkspace -LinkConnectionName ContosoLinkConnection -EditTablesRequestFile "C:\\samples\\edittables.json" +``` + +This command edits link tables under link connection ContosoLinkConnection in workspace ContosoWorkspace. +The command bases the link tables on information in the edittables.json file. +This file includes information about edited link table. + +### Example 2 +```powershell +$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +$ws | Set-AzSynapseLinkConnectionLinkTables -LinkConnectionName ContosoLinkConnection -EditTablesRequestFile "C:\\samples\\edittables.json" +``` + +This command edits link tables under link connection ContosoLinkConnection in workspace ContosoWorkspace through pipeline. +The command bases the link tables on information in the edittables.json file. +This file includes information about edited link table. + +### Example 3 +```powershell +$lc = Get-AzSynpaseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +$lc | Set-AzSynapseLinkConnectionLinkTables -EditTablesRequestFile "C:\\samples\\edittables.json" +``` + +This command edits link tables under a link connection through pipeline. +The command bases the link tables on information in the edittables.json file. +This file includes information about edited link table. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EditTablesRequestFile +Specifies a local file path for a file to edit link tables + +```yaml +Type: String +Parameter Sets: (All) +Aliases: File + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The information about the link connection. + +```yaml +Type: PSLinkConnectionResource +Parameter Sets: SetByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkConnectionName +Name of link connection. + +```yaml +Type: String +Parameter Sets: SetByName, SetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: SetByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: SetByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### System.Void + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Start-AzSynapseLinkConnection.md b/src/Synapse/Synapse/help/Start-AzSynapseLinkConnection.md new file mode 100644 index 000000000000..f171f5a183a4 --- /dev/null +++ b/src/Synapse/Synapse/help/Start-AzSynapseLinkConnection.md @@ -0,0 +1,232 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/start-azsynapselinkconnection +schema: 2.0.0 +--- + +# Start-AzSynapseLinkConnection + +## SYNOPSIS +Starts a link connection. + +## SYNTAX + +### StartByName (Default) +``` +Start-AzSynapseLinkConnection -WorkspaceName -Name [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### StartByObject +``` +Start-AzSynapseLinkConnection -WorkspaceObject -Name [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### StartByInputObject +``` +Start-AzSynapseLinkConnection -InputObject [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Start-AzSynapseLinkConnection** cmdlet starts a link connection in workspace. It will cost some time from starting to running, after calling this cmdlet you can check the detail status by calling **Get-AzSynapseLinkConnectionDetailedStatus**. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Start-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +This command starts a link connection named ContosoLinkConnection in workspace. + +### Example 2 +```powershell +PS C:\> $ws = Get-AzSynapseWorkspace -Workspacename ContosoWorkspace +PS C:\> $ws | Start-AzSynapseLinkConnection -Name ContosoLinkConnection +``` + +This command starts a link connection named ContosoLinkConnection in workspace through pipeline. + +### Example 3 +```powershell +PS C:\> $linkConnection = Get-AzSynapseLinkConnection -Workspacename ContosoWorkspace -Name ContosoLinkConnection +PS C:\> $linkConnection | Start-AzSynapseLinkConnection +``` + +This command starts a link connection named ContosoLinkConnection in workspace through pipeline. + +### Example 4 +```powershell +PS C:\> Start-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +PS C:\> Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection + + WorkspaceName : ContosoWorkspace + Id : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + Name : ContosoLinkConnection + IsApplyingChanges : + IsPartiallyFailed : False + StartTime : 2022-03-10T07:57:37.8730044Z + StopTime : + Status : Starting + ContinuousRunId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + Error : +``` + +The **Start-AzSynapseLinkConnection** command starts a link connection named ContosoLinkConnection in workspace, then you can call **Get-AzSynapseLinkConnectionDetailedStatus** to get status of the link connection. + +### -AsJob +Run cmdlet in the background + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The Synapse link connection object for Azure Sql Database. + +```yaml +Type: PSLinkConnectionResource +Parameter Sets: StartByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The Synapse link connection name for Azure Sql Database. + +```yaml +Type: String +Parameter Sets: StartByName, StartByObject +Aliases: LinkConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +This Cmdlet does not return an object by default. +If this switch is specified, it returns true if successful. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: StartByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: StartByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Stop-AzSynapseLinkConnection.md b/src/Synapse/Synapse/help/Stop-AzSynapseLinkConnection.md new file mode 100644 index 000000000000..42bc5c04e3a5 --- /dev/null +++ b/src/Synapse/Synapse/help/Stop-AzSynapseLinkConnection.md @@ -0,0 +1,234 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/stop-azsynapselinkconnection +schema: 2.0.0 +--- + +# Stop-AzSynapseLinkConnection + +## SYNOPSIS +Stops a link connection. + +## SYNTAX + +### StopByName (Default) +``` +Stop-AzSynapseLinkConnection -WorkspaceName -Name [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### StopByObject +``` +Stop-AzSynapseLinkConnection -WorkspaceObject -Name [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### StopByInputObject +``` +Stop-AzSynapseLinkConnection -InputObject [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Stop-AzSynapseLinkConnection** cmdlet stops a link connection in workspace. It will cost some time from running to stopped, after calling this cmdlet you can check the detail status by calling **Get-AzSynapseLinkConnectionDetailedStatus**. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Stop-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +``` + +This command stops a link connection named ContosoLinkConnection in workspace. + +### Example 2 +```powershell +PS C:\> $ws = Get-AzSynapseWorkspace -Workspacename ContosoWorkspace +PS C:\> $ws | Stop-AzSynapseLinkConnection -Name ContosoLinkConnection +``` + +This command stops a link connection named ContosoLinkConnection in workspace through pipeline. + +### Example 3 +```powershell +PS C:\> $linkConnection = Get-AzSynapseLinkConnection -Workspacename ContosoWorkspace -Name ContosoLinkConnection +PS C:\> $linkConnection | Stop-AzSynapseLinkConnection +``` + +This command stops a link connection named ContosoLinkConnection in workspace through pipeline. + +### Example 4 +```powershell +PS C:\> Stop-AzSynapseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +PS C:\> Get-AzSynapseLinkConnectionDetailedStatus -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection + + WorkspaceName : ContosoWorkspace + Id : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + Name : ContosoLinkConnection + IsApplyingChanges : + IsPartiallyFailed : False + StartTime : 2022-03-10T06:59:34.5820499Z + StopTime : 2022-03-10T07:21:42.4895248Z + Status : Stopping + ContinuousRunId : + Error : +``` + +This command stops a link connection named ContosoLinkConnection in workspace, then you can call **Get-AzSynapseLinkConnectionDetailedStatus** to get status of the link connection. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The Synapse link connection object for Azure Sql Database. + +```yaml +Type: PSLinkConnectionResource +Parameter Sets: StopByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The Synapse link connection name for Azure Sql Database. + +```yaml +Type: String +Parameter Sets: StopByName, StopByObject +Aliases: LinkConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +This Cmdlet does not return an object by default. +If this switch is specified, it returns true if successful. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: String +Parameter Sets: StopByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: PSSynapseWorkspace +Parameter Sets: StopByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS diff --git a/src/Synapse/Synapse/help/Update-AzSynapseLinkConnectionLandingZoneCredential.md b/src/Synapse/Synapse/help/Update-AzSynapseLinkConnectionLandingZoneCredential.md new file mode 100644 index 000000000000..18538d82adb1 --- /dev/null +++ b/src/Synapse/Synapse/help/Update-AzSynapseLinkConnectionLandingZoneCredential.md @@ -0,0 +1,200 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Synapse.dll-Help.xml +Module Name: Az.Synapse +online version: https://docs.microsoft.com/powershell/module/az.synapse/set-azsynapselinkconnectionlandingzonecredential +schema: 2.0.0 +--- + +# Update-AzSynapseLinkConnectionLandingZoneCredential + +## SYNOPSIS +Updates the landing zone credential of a link connection. + +## SYNTAX + +### UpdateByName (Default) +``` +Update-AzSynapseLinkConnectionLandingZoneCredential -WorkspaceName -LinkConnectionName + -SasToken [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### UpdateByObject +``` +Update-AzSynapseLinkConnectionLandingZoneCredential -WorkspaceObject + -LinkConnectionName -SasToken [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +### UpdateByInputObject +``` +Update-AzSynapseLinkConnectionLandingZoneCredential -InputObject + -SasToken [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Update-AzSynapseLinkConnectionLandingZoneCredential** cmdlet updates the landing zone credential of a link connection. + +## EXAMPLES + +### Example 1 +```powershell +Update-AzSynapseLinkConnectionLandingZoneCredential -WorkspaceName ContosoWorkspace -LinkConnectionName ContosoLinkConnection -SasToken "SampleSasToken" +``` + +This command updates the landing zone credential with sas token "exampleSasToken" of link connection ContosoLinkConnection in workspace ContosoWorkspace. + +### Example 2 +```powershell +$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace +$ws | Update-AzSynapseLinkConnectionLandingZoneCredential -LinkConnectionName ContosoLinkConnection -SasToken "SampleSasToken" +``` + +This command updates the landing zone credential with sas token "exampleSasToken" of link connection ContosoLinkConnection in workspace ContosoWorkspace through pipeline. + +### Example 3 +```powershell +$lc = Get-AzSynpaseLinkConnection -WorkspaceName ContosoWorkspace -Name ContosoLinkConnection +$lc | Update-AzSynapseLinkConnectionLandingZoneCredential -SasToken "SampleSasToken" +``` + +This command updates the landing zone credential with sas token "exampleSasToken" of a link connection through pipeline. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The information about the link connection. + +```yaml +Type: Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource +Parameter Sets: UpdateByInputObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkConnectionName +Name of link connection. + +```yaml +Type: System.String +Parameter Sets: UpdateByName, UpdateByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SasToken +Landing zone's sas token. + +```yaml +Type: Azure.Analytics.Synapse.Artifacts.Models.SecureString +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceName +Name of Synapse workspace. + +```yaml +Type: System.String +Parameter Sets: UpdateByName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceObject +workspace input object, usually passed through the pipeline. + +```yaml +Type: Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace +Parameter Sets: UpdateByObject +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Synapse.Models.PSSynapseWorkspace + +### Microsoft.Azure.Commands.Synapse.Models.PSLinkConnectionResource + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS