Skip to content

Commit db3b605

Browse files
[skip ci] Archive 0a2cced (#28462)
1 parent e70f1c0 commit db3b605

File tree

70 files changed

+6702
-1586
lines changed

Some content is hidden

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

70 files changed

+6702
-1586
lines changed

generated/DataTransfer/DataTransfer.Autorest/Az.DataTransfer.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.DataTransfer.private.dll'
1313
FormatsToProcess = './Az.DataTransfer.format.ps1xml'
14-
FunctionsToExport = 'Approve-AzDataTransferConnection', 'Deny-AzDataTransferConnection', 'Disable-AzDataTransferFlow', 'Enable-AzDataTransferFlow', 'Get-AzDataTransferConnection', 'Get-AzDataTransferFlow', 'Get-AzDataTransferPendingConnection', 'Get-AzDataTransferPendingFlow', 'Get-AzDataTransferPipeline', 'Invoke-AzDataTransferLinkPendingConnection', 'Invoke-AzDataTransferLinkPendingFlow', 'New-AzDataTransferConnection', 'New-AzDataTransferFlow', 'Remove-AzDataTransferConnection', 'Remove-AzDataTransferFlow', 'Update-AzDataTransferConnection', 'Update-AzDataTransferFlow'
14+
FunctionsToExport = 'Approve-AzDataTransferConnection', 'Deny-AzDataTransferConnection', 'Disable-AzDataTransferConnection', 'Disable-AzDataTransferFlow', 'Disable-AzDataTransferFlowType', 'Disable-AzDataTransferPipeline', 'Enable-AzDataTransferConnection', 'Enable-AzDataTransferFlow', 'Enable-AzDataTransferFlowType', 'Enable-AzDataTransferPipeline', 'Get-AzDataTransferConnection', 'Get-AzDataTransferFlow', 'Get-AzDataTransferPendingConnection', 'Get-AzDataTransferPendingFlow', 'Get-AzDataTransferPipeline', 'Invoke-AzDataTransferLinkPendingConnection', 'Invoke-AzDataTransferLinkPendingFlow', 'New-AzDataTransferConnection', 'New-AzDataTransferFlow', 'Remove-AzDataTransferConnection', 'Remove-AzDataTransferFlow', 'Update-AzDataTransferConnection', 'Update-AzDataTransferFlow'
1515
PrivateData = @{
1616
PSData = @{
1717
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DataTransfer'
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
17+
<#
18+
.Synopsis
19+
Disables Azure Data Transfer connections.
20+
.Description
21+
The Disable-AzDataTransferConnection cmdlet disables Azure Data Transfer connections.
22+
This prevents data transfer operations on the connections and disables all flows within them.
23+
.Example
24+
Disable-AzDataTransferConnection -PipelineName "Pipeline01" -ResourceGroupName "ResourceGroup01" -ConnectionId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.AzureDataTransfer/connections/Connection01"
25+
.Example
26+
$connectionIds = @(
27+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.AzureDataTransfer/connections/Connection01",
28+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.AzureDataTransfer/connections/Connection02"
29+
)
30+
Disable-AzDataTransferConnection -PipelineName "Pipeline01" -ResourceGroupName "ResourceGroup01" -ConnectionId $connectionIds
31+
32+
.Outputs
33+
ADT.Models.IPipeline
34+
.Link
35+
https://learn.microsoft.com/powershell/module/az.datatransfer/disable-azdatatransferconnection
36+
#>
37+
function Disable-AzDataTransferConnection {
38+
[OutputType([ADT.Models.IPipeline])]
39+
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
40+
param(
41+
[Parameter(Mandatory)]
42+
[ADT.Category('Body')]
43+
[System.String]
44+
# The name of the pipeline containing the connections
45+
${PipelineName},
46+
47+
[Parameter(Mandatory)]
48+
[ADT.Category('Body')]
49+
[System.String]
50+
# The name of the resource group
51+
${ResourceGroupName},
52+
53+
[Parameter(Mandatory)]
54+
[ADT.Category('Body')]
55+
[System.String[]]
56+
# One or more connection resource IDs to disable
57+
${ConnectionId},
58+
59+
[Parameter()]
60+
[ADT.Category('Body')]
61+
[System.String]
62+
# The ID of the target subscription
63+
${SubscriptionId},
64+
65+
[Parameter()]
66+
[ADT.Category('Body')]
67+
[System.String]
68+
# Business justification for disabling the connections
69+
${Justification},
70+
71+
[Parameter()]
72+
[ADT.Category('Body')]
73+
[System.Management.Automation.PSObject]
74+
# The credentials, account, tenant, and subscription used for communication with Azure
75+
${DefaultProfile},
76+
77+
[Parameter()]
78+
[ADT.Category('Body')]
79+
[System.Management.Automation.SwitchParameter]
80+
# Run the command as a job
81+
${AsJob},
82+
83+
[Parameter()]
84+
[ADT.Category('Body')]
85+
[System.Management.Automation.SwitchParameter]
86+
# Run the command asynchronously
87+
${NoWait}
88+
)
89+
90+
begin {
91+
try {
92+
$outBuffer = $null
93+
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
94+
$PSBoundParameters['OutBuffer'] = 1
95+
}
96+
$parameterSet = $PSCmdlet.ParameterSetName
97+
98+
$testPlayback = $false
99+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('ADT.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
100+
101+
$context = Get-AzContext
102+
if (-not $context -and -not $testPlayback) {
103+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
104+
exit
105+
}
106+
107+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
108+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
109+
}
110+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
111+
if ($preTelemetryId -eq '') {
112+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
113+
[ADT.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
114+
} else {
115+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
116+
if ($internalCalledCmdlets -eq '') {
117+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
118+
} else {
119+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
120+
}
121+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
122+
}
123+
124+
$mapping = @{
125+
__AllParameterSets = 'Az.DataTransfer.custom\Disable-AzDataTransferConnection';
126+
}
127+
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
128+
[ADT.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
129+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [ADT.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
130+
[ADT.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
131+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
132+
}
133+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
134+
if ($wrappedCmd -eq $null) {
135+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
136+
}
137+
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
138+
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
139+
$steppablePipeline.Begin($PSCmdlet)
140+
} catch {
141+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
142+
throw
143+
}
144+
}
145+
146+
process {
147+
try {
148+
$steppablePipeline.Process($_)
149+
} catch {
150+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
151+
throw
152+
}
153+
154+
finally {
155+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
156+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
157+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
158+
}
159+
160+
}
161+
end {
162+
try {
163+
$steppablePipeline.End()
164+
165+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
166+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
167+
if ($preTelemetryId -eq '') {
168+
[ADT.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
169+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
170+
}
171+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
172+
173+
} catch {
174+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
175+
throw
176+
}
177+
}
178+
}
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
17+
<#
18+
.Synopsis
19+
Disables Azure Data Transfer flow types.
20+
.Description
21+
The Disable-AzDataTransferFlowType cmdlet disables flow types within an Azure Data Transfer pipeline.
22+
This prevents new flows of the specified types from being created and disables existing flows of those types.
23+
.Example
24+
Disable-AzDataTransferFlowType -PipelineName "Pipeline01" -ResourceGroupName "ResourceGroup01" -FlowType "FlowType01"
25+
.Example
26+
Disable-AzDataTransferFlowType -PipelineName "Pipeline01" -ResourceGroupName "ResourceGroup01" -FlowType @("FlowType01", "FlowType02")
27+
28+
.Outputs
29+
ADT.Models.IPipeline
30+
.Link
31+
https://learn.microsoft.com/powershell/module/az.datatransfer/disable-azdatatransferflowtype
32+
#>
33+
function Disable-AzDataTransferFlowType {
34+
[OutputType([ADT.Models.IPipeline])]
35+
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
36+
param(
37+
[Parameter(Mandatory)]
38+
[ADT.Category('Body')]
39+
[System.String]
40+
# The name of the pipeline containing the flow types
41+
${PipelineName},
42+
43+
[Parameter(Mandatory)]
44+
[ADT.Category('Body')]
45+
[System.String]
46+
# The name of the resource group
47+
${ResourceGroupName},
48+
49+
[Parameter(Mandatory)]
50+
[ADT.Category('Body')]
51+
[System.String[]]
52+
# One or more flow type names to disable
53+
${FlowType},
54+
55+
[Parameter()]
56+
[ADT.Category('Body')]
57+
[System.String]
58+
# The ID of the target subscription
59+
${SubscriptionId},
60+
61+
[Parameter()]
62+
[ADT.Category('Body')]
63+
[System.String]
64+
# Business justification for disabling the flow types
65+
${Justification},
66+
67+
[Parameter()]
68+
[ADT.Category('Body')]
69+
[System.Management.Automation.PSObject]
70+
# The credentials, account, tenant, and subscription used for communication with Azure
71+
${DefaultProfile},
72+
73+
[Parameter()]
74+
[ADT.Category('Body')]
75+
[System.Management.Automation.SwitchParameter]
76+
# Run the command as a job
77+
${AsJob},
78+
79+
[Parameter()]
80+
[ADT.Category('Body')]
81+
[System.Management.Automation.SwitchParameter]
82+
# Run the command asynchronously
83+
${NoWait}
84+
)
85+
86+
begin {
87+
try {
88+
$outBuffer = $null
89+
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
90+
$PSBoundParameters['OutBuffer'] = 1
91+
}
92+
$parameterSet = $PSCmdlet.ParameterSetName
93+
94+
$testPlayback = $false
95+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('ADT.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
96+
97+
$context = Get-AzContext
98+
if (-not $context -and -not $testPlayback) {
99+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
100+
exit
101+
}
102+
103+
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
104+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
105+
}
106+
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
107+
if ($preTelemetryId -eq '') {
108+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
109+
[ADT.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
110+
} else {
111+
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
112+
if ($internalCalledCmdlets -eq '') {
113+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
114+
} else {
115+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
116+
}
117+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
118+
}
119+
120+
$mapping = @{
121+
__AllParameterSets = 'Az.DataTransfer.custom\Disable-AzDataTransferFlowType';
122+
}
123+
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
124+
[ADT.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
125+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [ADT.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
126+
[ADT.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
127+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
128+
}
129+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
130+
if ($wrappedCmd -eq $null) {
131+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
132+
}
133+
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
134+
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
135+
$steppablePipeline.Begin($PSCmdlet)
136+
} catch {
137+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
138+
throw
139+
}
140+
}
141+
142+
process {
143+
try {
144+
$steppablePipeline.Process($_)
145+
} catch {
146+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
147+
throw
148+
}
149+
150+
finally {
151+
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
152+
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
153+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
154+
}
155+
156+
}
157+
end {
158+
try {
159+
$steppablePipeline.End()
160+
161+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
162+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
163+
if ($preTelemetryId -eq '') {
164+
[ADT.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
165+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
166+
}
167+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
168+
169+
} catch {
170+
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
171+
throw
172+
}
173+
}
174+
}

0 commit comments

Comments
 (0)