forked from Azure/azurestack-powershell
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Network and AzureBridge module fixes
- Loading branch information
Showing
4 changed files
with
301 additions
and
3 deletions.
There are no files selected for viewing
154 changes: 154 additions & 0 deletions
154
src/Azs.AzureBridge.Admin/custom/Remove-AzsAzureBridgeDownloadedProduct.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
|
||
# ---------------------------------------------------------------------------------- | ||
# | ||
# 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. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
<# | ||
.Synopsis | ||
Delete a downloaded product. | ||
.Description | ||
Delete a downloaded product. | ||
.Inputs | ||
Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Models.IBridgeAdminIdentity | ||
.Outputs | ||
Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Models.Api201601.IDownloadedProductResource | ||
.Notes | ||
COMPLEX PARAMETER PROPERTIES | ||
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. | ||
INPUTOBJECT <IBridgeAdminIdentity>: Identity Parameter | ||
[ActivationName <String>]: Name of the activation. | ||
[Id <String>]: Resource identity path | ||
[ProductName <String>]: Name of the product. | ||
[ResourceGroupName <String>]: The resource group the resource is located under. | ||
[SubscriptionId <String>]: Subscription credentials which uniquely identify Microsoft Azure subscription.The subscription ID forms part of the URI for every service call. | ||
.Link | ||
https://docs.microsoft.com/en-us/powershell/module/azs.azurebridge.admin/remove-azsazurebridgedownloadedproduct | ||
#> | ||
function Remove-AzsAzureBridgeDownloadedProduct { | ||
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Models.Api201601.IDownloadedProductResource])] | ||
[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] | ||
param( | ||
[Parameter(ParameterSetName='Delete', Mandatory)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Path')] | ||
[System.String] | ||
# Name of the activation. | ||
${ActivationName}, | ||
|
||
[Parameter(ParameterSetName='Delete', Mandatory)] | ||
[Alias('Name')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Path')] | ||
[System.String] | ||
# Name of the product. | ||
${ProductName}, | ||
|
||
[Parameter(ParameterSetName='Delete', Mandatory)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Path')] | ||
[System.String] | ||
# The resource group the resource is located under. | ||
${ResourceGroupName}, | ||
|
||
[Parameter(ParameterSetName='Delete')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Path')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] | ||
[System.String] | ||
# Subscription credentials which uniquely identify Microsoft Azure subscription.The subscription ID forms part of the URI for every service call. | ||
${SubscriptionId}, | ||
|
||
[Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Path')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Models.IBridgeAdminIdentity] | ||
# Identity Parameter | ||
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table. | ||
${InputObject}, | ||
|
||
[Parameter()] | ||
[Alias('AzureRMContext', 'AzureCredential')] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Azure')] | ||
[System.Management.Automation.PSObject] | ||
# The credentials, account, tenant, and subscription used for communication with Azure. | ||
${DefaultProfile}, | ||
|
||
[Parameter()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Run the command as a job | ||
${AsJob}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Wait for .NET debugger to attach | ||
${Break}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Runtime.SendAsyncStep[]] | ||
# SendAsync Pipeline Steps to be appended to the front of the pipeline | ||
${HttpPipelineAppend}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Runtime.SendAsyncStep[]] | ||
# SendAsync Pipeline Steps to be prepended to the front of the pipeline | ||
${HttpPipelinePrepend}, | ||
|
||
[Parameter()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Run the command asynchronously | ||
${NoWait}, | ||
|
||
[Parameter()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Returns true when the command succeeds | ||
${PassThru}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Uri] | ||
# The URI for the proxy server to use | ||
${Proxy}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Management.Automation.PSCredential] | ||
# Credentials for a proxy server to use for the remote call | ||
${ProxyCredential}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.BridgeAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Use the default credentials for the proxy | ||
${ProxyUseDefaultCredentials} | ||
) | ||
|
||
process { | ||
# Generated cmdlet does not support {prefix}/{name} for quota name, so extract the {name} part here | ||
if ($PSBoundParameters.ContainsKey('ProductName')) | ||
{ | ||
if ($null -ne $ProductName -and $ProductName.Contains('/')) | ||
{ | ||
$PSBoundParameters['ProductName'] = $ProductName.Split("/")[-1] | ||
} | ||
} | ||
|
||
Azs.Azurebridge.Admin.internal\Remove-AzsAzureBridgeDownloadedProduct @PSBoundParameters | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
|
||
# ---------------------------------------------------------------------------------- | ||
# | ||
# 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. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
<# | ||
.Synopsis | ||
Get a quota by name. | ||
.Description | ||
Get a quota by name. | ||
.Inputs | ||
Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.INetworkAdminIdentity | ||
.Outputs | ||
Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.IQuota | ||
.Notes | ||
COMPLEX PARAMETER PROPERTIES | ||
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. | ||
INPUTOBJECT <INetworkAdminIdentity>: Identity Parameter | ||
[Id <String>]: Resource identity path | ||
[Location <String>]: Location of the resource. | ||
[ResourceName <String>]: Name of the resource. | ||
[SubscriptionId <String>]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. | ||
.Link | ||
https://docs.microsoft.com/en-us/powershell/module/azs.network.admin/get-azsnetworkquota | ||
#> | ||
function Get-AzsNetworkQuota { | ||
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.IQuota])] | ||
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] | ||
param( | ||
[Parameter(ParameterSetName='Get')] | ||
[Parameter(ParameterSetName='List')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Path')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Runtime.DefaultInfo(Script='(Get-AzLocation)[0].Location')] | ||
[System.String] | ||
# Location of the resource. | ||
${Location}, | ||
|
||
[Parameter(ParameterSetName='Get', Mandatory)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Path')] | ||
[System.String] | ||
# Name of the resource. | ||
${Name}, | ||
|
||
[Parameter(ParameterSetName='Get')] | ||
[Parameter(ParameterSetName='List')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Path')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] | ||
[System.String[]] | ||
# Subscription credentials which uniquely identify Microsoft Azure subscription. | ||
# The subscription ID forms part of the URI for every service call. | ||
${SubscriptionId}, | ||
|
||
[Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Path')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.INetworkAdminIdentity] | ||
# Identity Parameter | ||
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table. | ||
${InputObject}, | ||
|
||
[Parameter(ParameterSetName='List')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Query')] | ||
[System.String] | ||
# OData filter parameter. | ||
${Filter}, | ||
|
||
[Parameter()] | ||
[Alias('AzureRMContext', 'AzureCredential')] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Azure')] | ||
[System.Management.Automation.PSObject] | ||
# The credentials, account, tenant, and subscription used for communication with Azure. | ||
${DefaultProfile}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Wait for .NET debugger to attach | ||
${Break}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Runtime')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Runtime.SendAsyncStep[]] | ||
# SendAsync Pipeline Steps to be appended to the front of the pipeline | ||
${HttpPipelineAppend}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Runtime')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Runtime.SendAsyncStep[]] | ||
# SendAsync Pipeline Steps to be prepended to the front of the pipeline | ||
${HttpPipelinePrepend}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Runtime')] | ||
[System.Uri] | ||
# The URI for the proxy server to use | ||
${Proxy}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Runtime')] | ||
[System.Management.Automation.PSCredential] | ||
# Credentials for a proxy server to use for the remote call | ||
${ProxyCredential}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Use the default credentials for the proxy | ||
${ProxyUseDefaultCredentials} | ||
) | ||
|
||
process { | ||
# Generated cmdlet does not support {prefix}/{name} for quota name, so extract the {name} part here | ||
if ($PSBoundParameters.ContainsKey('Name')) | ||
{ | ||
if ($null -ne $Name -and $Name.Contains('/')) | ||
{ | ||
$PSBoundParameters['Name'] = $Name.Split("/")[-1] | ||
} | ||
} | ||
|
||
Azs.Network.Admin.internal\Get-AzsNetworkQuota @PSBoundParameters | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters