diff --git a/src/Azs.ContainerRegistry.Admin/docs/Azs.ContainerRegistry.Admin.md b/src/Azs.ContainerRegistry.Admin/docs/Azs.ContainerRegistry.Admin.md new file mode 100644 index 00000000..fb3652a3 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Azs.ContainerRegistry.Admin.md @@ -0,0 +1,46 @@ +--- +Module Name: Azs.ContainerRegistry.Admin +Module Guid: 27950488-3e83-458b-8797-6db82864cf62 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Azs.ContainerRegistry.Admin Module +## Description +Microsoft AzureStack PowerShell: ContainerRegistry Admin cmdlets + +## Azs.ContainerRegistry.Admin Cmdlets +### [Get-AzsContainerRegistry](Get-AzsContainerRegistry.md) +Returns a list of container registries present in all tenant location. + +### [Get-AzsContainerRegistryCapacity](Get-AzsContainerRegistryCapacity.md) +Returns container registry capacity property. + +### [Get-AzsContainerRegistryConfiguration](Get-AzsContainerRegistryConfiguration.md) +Returns the specified configuration details. + +### [Get-AzsContainerRegistryQuota](Get-AzsContainerRegistryQuota.md) +Returns the specified container registry quota. + +### [Get-AzsContainerRegistrySetupStatus](Get-AzsContainerRegistrySetupStatus.md) +Returns the status of the container registry setup. + +### [New-AzsContainerRegistryQuota](New-AzsContainerRegistryQuota.md) +Create or update an existing container registry quota. + +### [Remove-AzsContainerRegistryConfiguration](Remove-AzsContainerRegistryConfiguration.md) +Delete an existing container registry configuration + +### [Remove-AzsContainerRegistryQuota](Remove-AzsContainerRegistryQuota.md) +Delete an existing container registry quota + +### [Set-AzsContainerRegistryConfiguration](Set-AzsContainerRegistryConfiguration.md) +Configure container registry overall configuration properties. + +### [Set-AzsContainerRegistryQuota](Set-AzsContainerRegistryQuota.md) +Create or update an existing container registry quota. + +### [Start-AzsContainerRegistrySetup](Start-AzsContainerRegistrySetup.md) +Invokes container registry certificate uploading and service deployment. + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistry.md b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistry.md new file mode 100644 index 00000000..e0058729 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistry.md @@ -0,0 +1,104 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/get-azscontainerregistry +schema: 2.0.0 +--- + +# Get-AzsContainerRegistry + +## SYNOPSIS +Returns a list of container registries present in all tenant location. + +## SYNTAX + +``` +Get-AzsContainerRegistry [-Location ] [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns a list of container registries present in all tenant location. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Get-AzsContainerRegistry +``` + +{ + "CreationDate": "\/Date(1629160842681)\/", + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/registries/testregistry01", + "Location": "redmond", + "Name": "redmond/testregistry01", + "PropertiesName": "testregistry01", + "RegistryId": "/subscriptions/72b77b1b-3e43-4d00-8b5b-be6beceb7f3a/resourceGroups/acrtenanttestrg/providers/Microsoft.ContainerRegistry/registries/testregistry01", + "RegistrySizeInByte": 3011, + "ResourceGroup": "acrtenanttestrg", + "SubscriptionId": "72b77b1b-3e43-4d00-8b5b-be6beceb7f3a", + "Type": "Microsoft.ContainerRegistry.Admin/locations/registries" +} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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 + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistry + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryCapacity.md b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryCapacity.md new file mode 100644 index 00000000..09d48121 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryCapacity.md @@ -0,0 +1,159 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/get-azscontainerregistrycapacity +schema: 2.0.0 +--- + +# Get-AzsContainerRegistryCapacity + +## SYNOPSIS +Returns container registry capacity property. + +## SYNTAX + +### List (Default) +``` +Get-AzsContainerRegistryCapacity [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzsContainerRegistryCapacity -CapacityName [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzsContainerRegistryCapacity -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns container registry capacity property. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Get-AzsContainerRegistryCapacity +``` + +{ + "AllowPush": true, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/capacities/Default", + "MaximumCapacityInGiB": 2000, + "Name": "redmond/Default", + "RegistriesConsumptionInGiB": 0, + "Type": "Microsoft.ContainerRegistry.Admin/locations/capacities" +} + +## PARAMETERS + +### -CapacityName +The name of the capacity parameter. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +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: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryCapacity + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryConfiguration.md b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryConfiguration.md new file mode 100644 index 00000000..1bf60f9d --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryConfiguration.md @@ -0,0 +1,157 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/get-azscontainerregistryconfiguration +schema: 2.0.0 +--- + +# Get-AzsContainerRegistryConfiguration + +## SYNOPSIS +Returns the specified configuration details. + +## SYNTAX + +### List (Default) +``` +Get-AzsContainerRegistryConfiguration [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzsContainerRegistryConfiguration -ConfigurationName [-Location ] + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzsContainerRegistryConfiguration -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the specified configuration details. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Get-AzsContainerRegistryConfiguration +``` + +{{ + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default", + "MaximumCapacityInGiB": 2000, + "Name": "redmond/Default", + "Type": "Microsoft.ContainerRegistry.Admin/locations/configurations" +} + +## PARAMETERS + +### -ConfigurationName +The name of the configuration. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +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: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryConfiguration + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..7129de57 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistryQuota.md @@ -0,0 +1,180 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/get-azscontainerregistryquota +schema: 2.0.0 +--- + +# Get-AzsContainerRegistryQuota + +## SYNOPSIS +Returns the specified container registry quota. + +## SYNTAX + +### List (Default) +``` +Get-AzsContainerRegistryQuota [-Location ] [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzsContainerRegistryQuota -Name [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzsContainerRegistryQuota -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the specified container registry quota. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Get-AzsContainerRegistryQuota +``` + +[ + { + "CapacityPerRegistryInGiB": 20, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota", + "Name": "redmond/Default quota", + "NumberOfRegistry": 20, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" + }, + { + "CapacityPerRegistryInGiB": 30, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota", + "Name": "redmond/testquota", + "NumberOfRegistry": 30, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" + } +] + +### -------------------------- EXAMPLE 2 -------------------------- +```powershell +Get-AzsContainerRegistryQuota -Name "Default quota" +``` + +{ + "CapacityPerRegistryInGiB": 20, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota", + "Name": "redmond/Default quota", + "NumberOfRegistry": 20, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" +} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the container registry quota. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: QuotaName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistrySetupStatus.md b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistrySetupStatus.md new file mode 100644 index 00000000..cef110db --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Get-AzsContainerRegistrySetupStatus.md @@ -0,0 +1,138 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/get-azscontainerregistrysetupstatus +schema: 2.0.0 +--- + +# Get-AzsContainerRegistrySetupStatus + +## SYNOPSIS +Returns the status of the container registry setup. + +## SYNTAX + +### Get (Default) +``` +Get-AzsContainerRegistrySetupStatus [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzsContainerRegistrySetupStatus -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the status of the container registry setup. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Get-AzsContainerRegistrySetupStatus +``` + +{ + "id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup/value", + "name": "redmond/value", + "type": "Microsoft.ContainerRegistry.Setup/locations/setup", + "properties": { + "status": "Completed" + } +} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.ISetupResult + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/New-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/docs/New-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..7b0f1b40 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/New-AzsContainerRegistryQuota.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/new-azscontainerregistryquota +schema: 2.0.0 +--- + +# New-AzsContainerRegistryQuota + +## SYNOPSIS +Create or update an existing container registry quota. + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzsContainerRegistryQuota -Name [-Location ] [-SubscriptionId ] + [-CapacityPerRegistryInGiB ] [-NumberOfRegistry ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### Create +``` +New-AzsContainerRegistryQuota -Name -QuotaObject [-Location ] + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or update an existing container registry quota. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +New-AzsContainerRegistryQuota -QuotaName testquota -CapacityPerRegistryInGib 20 -NumberOfRegistry 20 +``` + +{ + "CapacityPerRegistryInGiB": 20, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota", + "Name": "redmond/testquota", + "NumberOfRegistry": 20, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" +} + +## PARAMETERS + +### -CapacityPerRegistryInGiB +Storage capacity (GiB) of each registry. + +```yaml +Type: System.Int32 +Parameter Sets: CreateExpanded +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: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the container registry quota. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: QuotaName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NumberOfRegistry +Total number of container registry accounts. + +```yaml +Type: System.Int32 +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QuotaObject +Container registry quota. +To construct, see NOTES section for QUOTAOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota +Parameter Sets: Create +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota + +## NOTES + +ALIASES + +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. + + +QUOTAOBJECT : Container registry quota. + - `[CapacityPerRegistryInGiB ]`: Storage capacity (GiB) of each registry. + - `[NumberOfRegistry ]`: Total number of container registry accounts. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Remove-AzsContainerRegistryConfiguration.md b/src/Azs.ContainerRegistry.Admin/docs/Remove-AzsContainerRegistryConfiguration.md new file mode 100644 index 00000000..ffe77127 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Remove-AzsContainerRegistryConfiguration.md @@ -0,0 +1,192 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/remove-azscontainerregistryconfiguration +schema: 2.0.0 +--- + +# Remove-AzsContainerRegistryConfiguration + +## SYNOPSIS +Delete an existing container registry configuration + +## SYNTAX + +### Delete (Default) +``` +Remove-AzsContainerRegistryConfiguration -ConfigurationName [-Location ] + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzsContainerRegistryConfiguration -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing container registry configuration + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Remove-AzsContainerRegistryConfiguration -ConfigurationName default +``` + + + +## PARAMETERS + +### -ConfigurationName +The name of the configuration. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +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: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Remove-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/docs/Remove-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..03258cf7 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Remove-AzsContainerRegistryQuota.md @@ -0,0 +1,192 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/remove-azscontainerregistryquota +schema: 2.0.0 +--- + +# Remove-AzsContainerRegistryQuota + +## SYNOPSIS +Delete an existing container registry quota + +## SYNTAX + +### Delete (Default) +``` +Remove-AzsContainerRegistryQuota -Name [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzsContainerRegistryQuota -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an existing container registry quota + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Remove-AzsContainerRegistryConfiguration -ConfigurationName default +``` + + + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the container registry quota. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: QuotaName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Set-AzsContainerRegistryConfiguration.md b/src/Azs.ContainerRegistry.Admin/docs/Set-AzsContainerRegistryConfiguration.md new file mode 100644 index 00000000..b6b562c9 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Set-AzsContainerRegistryConfiguration.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/set-azscontainerregistryconfiguration +schema: 2.0.0 +--- + +# Set-AzsContainerRegistryConfiguration + +## SYNOPSIS +Configure container registry overall configuration properties. + +## SYNTAX + +### PutExpanded (Default) +``` +Set-AzsContainerRegistryConfiguration -ConfigurationName [-Location ] + [-SubscriptionId ] [-MaximumCapacityInGiB ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### Put +``` +Set-AzsContainerRegistryConfiguration -ConfigurationName + -ConfigurationObject [-Location ] [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Configure container registry overall configuration properties. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Set-AzsContainerRegistryConfiguration -MaximumCapacityInGib 30 -ConfigurationName default +``` + +{ + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default", + "MaximumCapacityInGiB": 30, + "Name": "redmond/Default", + "Type": "Microsoft.ContainerRegistry.Admin/locations/configurations" +} + +## PARAMETERS + +### -ConfigurationName +The name of the configuration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ConfigurationObject +Container registry configuration property. +To construct, see NOTES section for CONFIGURATIONOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryConfiguration +Parameter Sets: Put +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaximumCapacityInGiB +Total storage capacity (GiB) which can used by the registry. + +```yaml +Type: System.Int32 +Parameter Sets: PutExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryConfiguration + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryConfiguration + +## NOTES + +ALIASES + +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. + + +CONFIGURATIONOBJECT : Container registry configuration property. + - `[MaximumCapacityInGiB ]`: Total storage capacity (GiB) which can used by the registry. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Set-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/docs/Set-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..1b533332 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Set-AzsContainerRegistryQuota.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/set-azscontainerregistryquota +schema: 2.0.0 +--- + +# Set-AzsContainerRegistryQuota + +## SYNOPSIS +Create or update an existing container registry quota. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Set-AzsContainerRegistryQuota -Name [-Location ] [-SubscriptionId ] + [-CapacityPerRegistryInGiB ] [-NumberOfRegistry ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### Update +``` +Set-AzsContainerRegistryQuota -Name -QuotaObject [-Location ] + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or update an existing container registry quota. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Set-AzsContainerRegistryQuota -QuotaName testquota -CapacityPerRegistryInGib 30 -NumberOfRegistry 30 +``` + +{ + "CapacityPerRegistryInGiB": 30, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota", + "Name": "redmond/testquota", + "NumberOfRegistry": 30, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" +} + +## PARAMETERS + +### -CapacityPerRegistryInGiB +Storage capacity (GiB) of each registry. + +```yaml +Type: System.Int32 +Parameter Sets: UpdateExpanded +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: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the container registry quota. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: QuotaName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NumberOfRegistry +Total number of container registry accounts. + +```yaml +Type: System.Int32 +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QuotaObject +Container registry quota. +To construct, see NOTES section for QUOTAOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota +Parameter Sets: Update +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistryQuota + +## NOTES + +ALIASES + +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. + + +QUOTAOBJECT : Container registry quota. + - `[CapacityPerRegistryInGiB ]`: Storage capacity (GiB) of each registry. + - `[NumberOfRegistry ]`: Total number of container registry accounts. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/Start-AzsContainerRegistrySetup.md b/src/Azs.ContainerRegistry.Admin/docs/Start-AzsContainerRegistrySetup.md new file mode 100644 index 00000000..6e69f000 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/Start-AzsContainerRegistrySetup.md @@ -0,0 +1,227 @@ +--- +external help file: +Module Name: Azs.ContainerRegistry.Admin +online version: https://docs.microsoft.com/en-us/powershell/module/azs.containerregistry.admin/start-azscontainerregistrysetup +schema: 2.0.0 +--- + +# Start-AzsContainerRegistrySetup + +## SYNOPSIS +Invokes container registry certificate uploading and service deployment. + +## SYNTAX + +### StartExpanded (Default) +``` +Start-AzsContainerRegistrySetup [-Location ] [-SubscriptionId ] [-Password ] + [-SslCertInputFile ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Start +``` +Start-AzsContainerRegistrySetup -StartSetupRequest [-Location ] + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### StartViaIdentity +``` +Start-AzsContainerRegistrySetup -InputObject + -StartSetupRequest [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### StartViaIdentityExpanded +``` +Start-AzsContainerRegistrySetup -InputObject [-Password ] + [-SslCertInputFile ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Invokes container registry certificate uploading and service deployment. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +```powershell +Start-AzsContainerRegistrySetup -Password $password -SslCertInputFile $pfx_cert_path +``` + + + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity +Parameter Sets: StartViaIdentity, StartViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of Azure region. + +```yaml +Type: System.String +Parameter Sets: Start, StartExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzLocation)[0].Location +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Password +Ssl certificate password. + +```yaml +Type: System.Security.SecureString +Parameter Sets: StartExpanded, StartViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SslCertInputFile +Input File for SslCert (Ssl certificate in base64 format.) + +```yaml +Type: System.String +Parameter Sets: StartExpanded, StartViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartSetupRequest +Container registry setup properties. +To construct, see NOTES section for STARTSETUPREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistrySetupProperty +Parameter Sets: Start, StartViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Start, StartExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +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.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistrySetupProperty + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.IContainerRegistryAdminIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistryAdmin.Models.Api20191101Preview.IContainerRegistrySetup + +## NOTES + +ALIASES + +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 : Identity Parameter + - `[CapacityName ]`: The name of the capacity parameter. + - `[ConfigurationName ]`: The name of the configuration. + - `[Id ]`: Resource identity path + - `[Location ]`: The name of Azure region. + - `[QuotaName ]`: The name of the container registry quota. + - `[SubscriptionId ]`: The ID of the target subscription. + +STARTSETUPREQUEST : Container registry setup properties. + - `[Password ]`: Ssl certificate password. + - `[SslCertBase64 ]`: Ssl certificate in base64 format. + +## RELATED LINKS + diff --git a/src/Azs.ContainerRegistry.Admin/docs/readme.md b/src/Azs.ContainerRegistry.Admin/docs/readme.md new file mode 100644 index 00000000..0ddd5ffb --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/docs/readme.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Azs.ContainerRegistry.Admin` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Azs.ContainerRegistry.Admin` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistry.md b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistry.md new file mode 100644 index 00000000..73f8dfa5 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistry.md @@ -0,0 +1,19 @@ +### Example 1: Get List Azs Container Registries +```powershell +PS C:\> Get-AzsContainerRegistry + +{ + "CreationDate": "\/Date(1629160842681)\/", + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/registries/testregistry01", + "Location": "redmond", + "Name": "redmond/testregistry01", + "PropertiesName": "testregistry01", + "RegistryId": "/subscriptions/72b77b1b-3e43-4d00-8b5b-be6beceb7f3a/resourceGroups/acrtenanttestrg/providers/Microsoft.ContainerRegistry/registries/testregistry01", + "RegistrySizeInByte": 3011, + "ResourceGroup": "acrtenanttestrg", + "SubscriptionId": "72b77b1b-3e43-4d00-8b5b-be6beceb7f3a", + "Type": "Microsoft.ContainerRegistry.Admin/locations/registries" +} +``` + +Returns a list of container registries present in all tenant location. \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryCapacity.md b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryCapacity.md new file mode 100644 index 00000000..6795c54e --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryCapacity.md @@ -0,0 +1,16 @@ +### Example 1: Get Azs ContainerRegistry Capacity +```powershell +PS C:\> Get-AzsContainerRegistryCapacity + +{ + "AllowPush": true, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/capacities/Default", + "MaximumCapacityInGiB": 2000, + "Name": "redmond/Default", + "RegistriesConsumptionInGiB": 0, + "Type": "Microsoft.ContainerRegistry.Admin/locations/capacities" +} +``` + +Returns container registry capacity property. + diff --git a/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryConfiguration.md b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryConfiguration.md new file mode 100644 index 00000000..cec2abea --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryConfiguration.md @@ -0,0 +1,15 @@ +### Example 1: Get AzsContainerRegistry Configuration +```powershell +PS C:\> Get-AzsContainerRegistryConfiguration + +{{ + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default", + "MaximumCapacityInGiB": 2000, + "Name": "redmond/Default", + "Type": "Microsoft.ContainerRegistry.Admin/locations/configurations" +} +``` + +Returns the specified configuration details. + + diff --git a/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..96031498 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryQuota.md @@ -0,0 +1,39 @@ +### Example 1: Get List Azs ContainerRegistry Quotas +```powershell +PS C:\> Get-AzsContainerRegistryQuota + +[ + { + "CapacityPerRegistryInGiB": 20, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota", + "Name": "redmond/Default quota", + "NumberOfRegistry": 20, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" + }, + { + "CapacityPerRegistryInGiB": 30, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota", + "Name": "redmond/testquota", + "NumberOfRegistry": 30, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" + } +] +``` + +Returns a list of container registry quotas at the given location. + +### Example 2: Get Azs ContainerRegistry Quota by Name +```powershell +PS C:\> Get-AzsContainerRegistryQuota -Name "Default quota" + +{ + "CapacityPerRegistryInGiB": 20, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota", + "Name": "redmond/Default quota", + "NumberOfRegistry": 20, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" +} +``` + +Returns the specified container registry quota. + diff --git a/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistrySetupStatus.md b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistrySetupStatus.md new file mode 100644 index 00000000..b77472ba --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistrySetupStatus.md @@ -0,0 +1,16 @@ +### Example 1: Get Azs ContainerRegistry Setup Status +```powershell +PS C:\> Get-AzsContainerRegistrySetupStatus + +{ + "id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup/value", + "name": "redmond/value", + "type": "Microsoft.ContainerRegistry.Setup/locations/setup", + "properties": { + "status": "Completed" + } +} +``` + +Returns the status of the container registry setup. + diff --git a/src/Azs.ContainerRegistry.Admin/examples/New-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/examples/New-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..2741160c --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/New-AzsContainerRegistryQuota.md @@ -0,0 +1,15 @@ +### Example 1: New Azs ContainerRegistry Quota +```powershell +PS C:\> New-AzsContainerRegistryQuota -QuotaName testquota -CapacityPerRegistryInGib 20 -NumberOfRegistry 20 + +{ + "CapacityPerRegistryInGiB": 20, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota", + "Name": "redmond/testquota", + "NumberOfRegistry": 20, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" +} +``` + +Create or update an existing container registry quota. + diff --git a/src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryConfiguration.md b/src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryConfiguration.md new file mode 100644 index 00000000..86bb1fa0 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryConfiguration.md @@ -0,0 +1,7 @@ +### Example 1: Remove Azs ContainerRegistry Configuration +```powershell +PS C:\> Remove-AzsContainerRegistryConfiguration -ConfigurationName default + +``` + +Delete an existing container registry configuration. \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..4043c635 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryQuota.md @@ -0,0 +1,7 @@ +### Example 1: Remove Azs ContainerRegistry Configuration +```powershell +PS C:\> Remove-AzsContainerRegistryConfiguration -ConfigurationName default + +``` + +Delete an existing container registry configuration. diff --git a/src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryConfiguration.md b/src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryConfiguration.md new file mode 100644 index 00000000..54e44dd8 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryConfiguration.md @@ -0,0 +1,14 @@ +### Example 1: Set Azs ContainerRegistry Configuration +```powershell +PS C:\> Set-AzsContainerRegistryConfiguration -MaximumCapacityInGib 30 -ConfigurationName default + +{ + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default", + "MaximumCapacityInGiB": 30, + "Name": "redmond/Default", + "Type": "Microsoft.ContainerRegistry.Admin/locations/configurations" +} +``` + +Configure container registry overall configuration properties. + diff --git a/src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryQuota.md b/src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryQuota.md new file mode 100644 index 00000000..1d189538 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryQuota.md @@ -0,0 +1,15 @@ +### Example 1: Set Azs ContainerRegistry Quota +```powershell +PS C:\> Set-AzsContainerRegistryQuota -QuotaName testquota -CapacityPerRegistryInGib 30 -NumberOfRegistry 30 + +{ + "CapacityPerRegistryInGiB": 30, + "Id": "/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota", + "Name": "redmond/testquota", + "NumberOfRegistry": 30, + "Type": "Microsoft.ContainerRegistry.Admin/locations/quotas" +} +``` + +Update an existing container registry quota. + diff --git a/src/Azs.ContainerRegistry.Admin/examples/Start-AzsContainerRegistrySetup.md b/src/Azs.ContainerRegistry.Admin/examples/Start-AzsContainerRegistrySetup.md new file mode 100644 index 00000000..6fec9ee6 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/examples/Start-AzsContainerRegistrySetup.md @@ -0,0 +1,8 @@ +### Example 1: Start Azs ContainerRegistry Setup +```powershell +PS C:\> Start-AzsContainerRegistrySetup -Password $password -SslCertInputFile $pfx_cert_path + +``` + +Invokes container registry certificate uploading and service deployment. + diff --git a/src/Azs.ContainerRegistry.Admin/readme.md b/src/Azs.ContainerRegistry.Admin/readme.md new file mode 100644 index 00000000..be3e78e9 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/readme.md @@ -0,0 +1,104 @@ + +# Azs.ContainerRegistry.Admin +This directory contains the PowerShell module for the ContainerRegistryAdmin service. + +--- +## Status +[![Azs.ContainerRegistry.Admin](https://img.shields.io/powershellgallery/v/Azs.ContainerRegistry.Admin.svg?style=flat-square&label=Azs.ContainerRegistry.Admin "Azs.ContainerRegistry.Admin")](https://www.powershellgallery.com/packages/Azs.ContainerRegistry.Admin/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Azs.ContainerRegistry.Admin`, see [how-to.md](how-to.md). + + +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@beta`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../readme.azurestack.md + - $(repo)/specification/azsadmin/resource-manager/containerregistry/readme.azsautogen.md + +metadata: + description: 'Microsoft AzureStack PowerShell: ContainerRegistry Admin cmdlets' + +### PSD1 metadata changes +subject-prefix: '' +module-version: 0.2.0 +service-name: ContainerRegistryAdmin + +### File Renames +### IMPORTANT - Note that the following settings are case sensitive ### +module-name: Azs.ContainerRegistry.Admin +csproj: Azs.ContainerRegistry.Admin.csproj +psd1: Azs.ContainerRegistry.Admin.psd1 +psm1: Azs.ContainerRegistry.Admin.psm1 +``` + +### Parameter default values +``` yaml +directive: + # Prepend ContainerRegistry for the Quota cmdlets + - where: + subject: Quota + set: + subject-prefix: ContainerRegistry + + # Rename cmdlet parameter name in ContainerRegistrySetup + - where: + subject: ContainerRegistrySetup + parameter-name: SslCertBase64 + set: + parameter-name: SslCert + +# Add release notes + - from: Azs.ContainerRegistry.Admin.nuspec + where: $ + transform: $ = $.replace('', 'AzureStack Hub Admin module generated with https://github.com/Azure/autorest.powershell.'); + +# Add Az.Accounts/Az.Resources as dependencies + - from: Azs.ContainerRegistry.Admin.nuspec + where: $ + transform: $ = $.replace('', '\n '); + +# PSD1 changes for RequiredModules + - from: source-file-csharp + where: $ + transform: $ = $.replace('sb.AppendLine\(\$@\"\{Indent\}RequiredAssemblies = \'\{\"./bin/Azs.ContainerRegistry.Admin.private.dll\"\}\'\"\);', 'sb.AppendLine\(\$@\"\{Indent\}RequiredAssemblies = \'\{\"./bin/Azs.ContainerRegistry.Admin.private.dll\"\}\'\"\);\n sb.AppendLine\(\$@\"\{Indent\}RequiredModules = @\(@\{\{ModuleName = \'Az.Accounts\'; ModuleVersion = \'2.2.8\'; \}\}, @\{\{ModuleName = \'Az.Resources\'; RequiredVersion = \'0.11.0\'; \}\}\)\"\);'); + +# PSD1 changes for ReleaseNotes + - from: source-file-csharp + where: $ + transform: $ = $.replace('sb.AppendLine\(\$@\"\{Indent\}\{Indent\}\{Indent\}ReleaseNotes = \'\'\"\);', 'sb.AppendLine\(\$@\"\{Indent\}\{Indent\}\{Indent\}ReleaseNotes = \'AzureStack Hub Admin module generated with https://github.com/Azure/autorest.powershell\'\"\);' ); +``` diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistry.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistry.Recording.json new file mode 100644 index 00000000..9160fd5b --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistry.Recording.json @@ -0,0 +1,43 @@ +{ + "Get-AzsContainerRegistry+[NoContext]+TestGetContainerRegistryRegistry+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/registries?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/registries?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "1" ], + "x-ms-client-request-id": [ "16aa7e29-7714-4ecd-913a-97c229e7d2c2" ], + "CommandName": [ "Get-AzsContainerRegistry" ], + "FullCommandName": [ "Get-AzsContainerRegistry_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "51433578-a9f8-41b6-ae61-71232a896672" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14920" ], + "x-ms-correlation-request-id": [ "0323b032-4ec3-4492-abbe-6aa922153f1c" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181209Z:0323b032-4ec3-4492-abbe-6aa922153f1c" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:09 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "641" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/registries/testregistry01\",\"name\":\"redmond/testregistry01\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/registries\",\"properties\":{\"registryId\":\"/subscriptions/72b77b1b-3e43-4d00-8b5b-be6beceb7f3a/resourceGroups/acrtenanttestrg/providers/Microsoft.ContainerRegistry/registries/testregistry01\",\"name\":\"testregistry01\",\"location\":\"redmond\",\"creationDate\":\"2021-08-17T00:40:42.6810944Z\",\"subscriptionId\":\"72b77b1b-3e43-4d00-8b5b-be6beceb7f3a\",\"resourceGroup\":\"acrtenanttestrg\",\"registrySizeInBytes\":3011}}]}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistry.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistry.Tests.ps1 new file mode 100644 index 00000000..6c3efc7b --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistry.Tests.ps1 @@ -0,0 +1,47 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzsContainerRegistry.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzsContainerRegistry' { + BeforeEach { + + function ValidateRegistry { + param( + [Parameter(Mandatory = $true)] + $Registry + ) + $registry | Should Not Be $null + $registry.CreationDate | Should Not Be $null + $registry.Id | Should Not Be $null + $registry.Location | Should Not Be $null + $registry.Name | Should Not Be $null + $registry.PropertiesName| Should Not Be $null + $registry.RegistryId | Should Not Be $null + $registry.RegistrySizeInByte | Should Not Be $null + $registry.ResourceGroup | Should Not Be $null + $registry.SubscriptionId| Should Not Be $null + $registry.Type | Should Not Be $null + } + } + + AfterEach { + $global:Client = $null + } + + It "TestGetContainerRegistryRegistry" -Skip:$('TestGetContainerRegistry' -in $global:SkippedTests) { + $global:TestName = 'TestGetContainerRegistry' + + $result = Get-AzsContainerRegistry + $result | Should Not Be $null + ValidateRegistry -Registry $result + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Recording.json new file mode 100644 index 00000000..79c77be7 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Recording.json @@ -0,0 +1,43 @@ +{ + "Get-AzsContainerRegistryCapacity+[NoContext]+TestGetContainerRegistryCapacity+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/capacities?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/capacities?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "2" ], + "x-ms-client-request-id": [ "d4d1b292-07a1-4e28-9ef8-255f99e81e6f" ], + "CommandName": [ "Get-AzsContainerRegistryCapacity" ], + "FullCommandName": [ "Get-AzsContainerRegistryCapacity_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "0b545f04-f153-44d8-a983-fe2111410a1e" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14918" ], + "x-ms-correlation-request-id": [ "2063e8ba-cbfe-42fb-b3f1-7351d7d60381" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181212Z:2063e8ba-cbfe-42fb-b3f1-7351d7d60381" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:11 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "334" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/capacities/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/capacities\",\"properties\":{\"maximumCapacityInGiB\":0,\"registriesConsumptionInGiB\":0.00,\"allowPush\":false}}]}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Tests.ps1 new file mode 100644 index 00000000..a89cc119 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Tests.ps1 @@ -0,0 +1,39 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzsContainerRegistryCapacity.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzsContainerRegistryCapacity' { + BeforeEach { + + function ValidateCapacity { + param( + [Parameter(Mandatory = $true)] + $Capacity + ) + $capacity | Should Not Be $null + $capacity.MaximumCapacityInGiB | Should Not Be $null + $capacity.RegistriesConsumptionInGiB | Should Not Be $null + } + } + + AfterEach { + $global:Client = $null + } + + It "TestGetContainerRegistryCapacity" -Skip:$('TestGetContainerRegistryCapacity' -in $global:SkippedTests) { + $global:TestName = 'TestGetContainerRegistryCapacity' + + $result = Get-AzsContainerRegistryCapacity + $result | Should Not Be $null + ValidateCapacity -Capacity $result + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryConfiguration.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryConfiguration.Recording.json new file mode 100644 index 00000000..15e0b729 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryConfiguration.Recording.json @@ -0,0 +1,43 @@ +{ + "Get-AzsContainerRegistryConfiguration+[NoContext]+TestGetContainerRegistryConfiguration+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "06564f23-62d4-4190-843b-42d87855dde2" ], + "CommandName": [ "Get-AzsContainerRegistryConfiguration" ], + "FullCommandName": [ "Get-AzsContainerRegistryConfiguration_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "e2df8213-5b6b-42b6-87fa-2b976cb91449" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14916" ], + "x-ms-correlation-request-id": [ "f20d4a07-fd82-459f-9a24-da47bb1ef4c9" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181213Z:f20d4a07-fd82-459f-9a24-da47bb1ef4c9" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:13 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "290" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":0}}]}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryConfiguration.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryConfiguration.Tests.ps1 new file mode 100644 index 00000000..e02ab919 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryConfiguration.Tests.ps1 @@ -0,0 +1,38 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzsContainerRegistryConfiguration.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzsContainerRegistryConfiguration' { + BeforeEach { + + function ValidateConfiguration { + param( + [Parameter(Mandatory = $true)] + $Configuration + ) + $configuration | Should Not Be $null + $configuration.MaximumCapacityInGib | Should Not Be $null + } + } + + AfterEach { + $global:Client = $null + } + + It "TestGetContainerRegistryConfiguration" -Skip:$('TestGetContainerRegistryConfiguration' -in $global:SkippedTests) { + $global:TestName = 'TestGetContainerRegistryConfiguration' + + $result = Get-AzsContainerRegistryConfiguration + $result | Should Not Be $null + ValidateConfiguration -Configuration $result + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryQuota.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryQuota.Recording.json new file mode 100644 index 00000000..6c01d3be --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryQuota.Recording.json @@ -0,0 +1,248 @@ +{ + "Get-AzsContainerRegistryQuota+[NoContext]+TestListAllContainerRegistryQuotas+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "4" ], + "x-ms-client-request-id": [ "e8b858ac-2df0-4537-89b6-5523e6208374" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "4e50191c-412d-4427-9236-4c31c346562c" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14914" ], + "x-ms-correlation-request-id": [ "b8e640ba-49c0-44eb-96d4-4fd13a052eae" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181215Z:b8e640ba-49c0-44eb-96d4-4fd13a052eae" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:14 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "611" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}},{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota\",\"name\":\"redmond/testquota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}]}", + "isContentBase64": false + } + }, + "Get-AzsContainerRegistryQuota+[NoContext]+TestGetContainerRegistryQuota+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "5" ], + "x-ms-client-request-id": [ "2352b38f-aaa8-484e-9347-7bebc0ee49db" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "d74350f5-5a1f-45d3-bbb8-9df1426aba09" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14912" ], + "x-ms-correlation-request-id": [ "6918ba9f-0d78-42c7-8aba-9f7e13deffa9" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181217Z:6918ba9f-0d78-42c7-8aba-9f7e13deffa9" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:17 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "611" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}},{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota\",\"name\":\"redmond/testquota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}]}", + "isContentBase64": false + } + }, + "Get-AzsContainerRegistryQuota+[NoContext]+TestGetContainerRegistryQuota+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default%20quota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "6" ], + "x-ms-client-request-id": [ "d62ade18-9508-455e-8ed1-6d7ee85f8d39" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_GetViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "50050688-d375-4e18-bf92-74684ed9c7f3" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14911" ], + "x-ms-correlation-request-id": [ "e2661a4a-1fa8-424d-b177-41d7efdc48f4" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181217Z:e2661a4a-1fa8-424d-b177-41d7efdc48f4" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:17 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "303" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}", + "isContentBase64": false + } + }, + "Get-AzsContainerRegistryQuota+[NoContext]+TestGetAllContainerRegistryQuotas+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "7" ], + "x-ms-client-request-id": [ "3386c1e8-f676-4ca9-8298-9a977a72385b" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "445cbc18-93d8-4704-8975-8fc8ae1c5513" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14909" ], + "x-ms-correlation-request-id": [ "94462c49-851e-46d5-82a3-1b477b04fd27" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181219Z:94462c49-851e-46d5-82a3-1b477b04fd27" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:18 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "611" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}},{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota\",\"name\":\"redmond/testquota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}]}", + "isContentBase64": false + } + }, + "Get-AzsContainerRegistryQuota+[NoContext]+TestGetAllContainerRegistryQuotas+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default%20quota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "8" ], + "x-ms-client-request-id": [ "422bca38-314e-4049-8283-7d38d6fa4c52" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_GetViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "9205fa72-6c95-4809-adc1-7451e1dbe332" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14908" ], + "x-ms-correlation-request-id": [ "58c37d91-13a3-4709-8ca9-c31118e96307" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181219Z:58c37d91-13a3-4709-8ca9-c31118e96307" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:18 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "303" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}", + "isContentBase64": false + } + }, + "Get-AzsContainerRegistryQuota+[NoContext]+TestGetAllContainerRegistryQuotas+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota?api-version=2019-11-01-preview+3": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "9" ], + "x-ms-client-request-id": [ "6f768574-0f06-48ac-ba0f-aeb17cd5434a" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_GetViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "334f6881-8abe-4020-888b-de1b24c2597c" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14907" ], + "x-ms-correlation-request-id": [ "1639c9a4-7503-48c5-9365-296c9605bf0f" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181219Z:1639c9a4-7503-48c5-9365-296c9605bf0f" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:19 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "295" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/testquota\",\"name\":\"redmond/testquota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryQuota.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryQuota.Tests.ps1 new file mode 100644 index 00000000..c3704b3a --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryQuota.Tests.ps1 @@ -0,0 +1,89 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzsContainerRegistryQuota.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzsContainerRegistryQuota' { + BeforeEach { + + function ValidateContainerRegistryQuota { + param( + [Parameter(Mandatory = $true)] + $containerRegistryQuota + ) + # Resource + $containerRegistryQuota | Should Not Be $null + + # Validate ContainerRegistry quota properties + $containerRegistryQuota.CapacityPerRegistryInGib | Should Not Be $null + $containerRegistryQuota.NumberOfRegistry | Should Not Be $null + $containerRegistryQuota.Type | Should Not Be $null + $containerRegistryQuota.Id | Should Not Be $null + $containerRegistryQuota.Name | Should Not Be $null + } + + function AssertAreEqual { + param( + [Parameter(Mandatory = $true)] + $expected, + [Parameter(Mandatory = $true)] + $found + ) + # Resource + if ($null -eq $expected) { + $found | Should Be $null + } + else { + $found | Should Not Be $null + # Validate ContainerRegistry quota properties + $expected.CapacityPerRegistryInGib | Should Be $found.CapacityPerRegistryInGib + $expected.NumberOfRegistry | Should Be $found.NumberOfRegistry + } + } + } + + AfterEach { + $global:Client = $null + } + + It "TestListAllContainerRegistryQuotas" -Skip:$('TestListAllContainerRegistryQuotas' -in $global:SkippedTests) { + $global:TestName = 'TestListAllContainerRegistryQuotas' + + $quotas = Get-AzsContainerRegistryQuota + foreach ($quota in $quotas.Value) { + ValidateContainerRegistryQuota -containerRegistryQuota $quota + } + } + + It "TestGetContainerRegistryQuota" -Skip:$('TestGetContainerRegistryQuota' -in $global:SkippedTests) { + $global:TestName = 'TestGetContainerRegistryQuota' + + $quota = Get-AzsContainerRegistryQuota + if ($quota -as [Array]) + { + $quota = $quota[0] + } + $retrievedQuota = Get-AzsContainerRegistryQuota -InputObject $quota + ValidateContainerRegistryQuota -containerRegistryQuota $retrievedQuota + AssertAreEqual -expected $quota -found $retrievedQuota + } + + It "TestGetAllContainerRegistryQuotas" -Skip:$('TestGetAllContainerRegistryQuotas' -in $global:SkippedTests) { + $global:TestName = 'TestGetAllContainerRegistryQuotas' + + $quotas = Get-AzsContainerRegistryQuota + foreach ($quota in $quotas -as [Array]) { + $result = Get-AzsContainerRegistryQuota -InputObject $quota + ValidateContainerRegistryQuota -containerRegistryQuota $quota + AssertAreEqual -expected $quota -found $result + } + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistrySetupStatus.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistrySetupStatus.Recording.json new file mode 100644 index 00000000..680dc00a --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistrySetupStatus.Recording.json @@ -0,0 +1,43 @@ +{ + "Get-AzsContainerRegistrySetupStatus+[NoContext]+TestGetContainerRegistrySetupStatus+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "10" ], + "x-ms-client-request-id": [ "a61ceec4-0ec9-4477-8d13-8c2ee3e9105b" ], + "CommandName": [ "Get-AzsContainerRegistrySetupStatus" ], + "FullCommandName": [ "Get-AzsContainerRegistrySetupStatus_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "62298517-8fe3-4abb-964f-63b5fec33119" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14905" ], + "x-ms-correlation-request-id": [ "257fcfb9-6eeb-4a09-a9b8-41dd6e9b764d" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181222Z:257fcfb9-6eeb-4a09-a9b8-41dd6e9b764d" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:22 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "252" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup/value\",\"name\":\"redmond/value\",\"type\":\"Microsoft.ContainerRegistry.Setup/locations/setup\",\"properties\":{\"status\":\"Completed\"}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistrySetupStatus.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistrySetupStatus.Tests.ps1 new file mode 100644 index 00000000..04c50441 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistrySetupStatus.Tests.ps1 @@ -0,0 +1,42 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzsContainerRegistrySetupStatus.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzsContainerRegistrySetupStatus' { + + BeforeEach { + + function ValidateSetupStatus { + param( + [Parameter(Mandatory = $true)] + $SetupStatus + ) + $setupStatus | Should Not Be $null + $setupStatus.Id | Should Not Be $null + $setupStatus.Name | Should Not Be $null + $setupStatus.Type | Should Not Be $null + $setupStatus.Status | Should Not Be $null + } + } + + AfterEach { + $global:Client = $null + } + + It "TestGetContainerRegistrySetupStatus" -Skip:$('TestGetContainerRegistrySetupStatus' -in $global:SkippedTests) { + $global:TestName = 'TestGetContainerRegistrySetupStatus' + + $result = Get-AzsContainerRegistrySetupStatus + $result | Should Not Be $null + ValidateSetupStatus -SetupStatus $result + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/New-AzsContainerRegistryQuota.Recording.json b/src/Azs.ContainerRegistry.Admin/test/New-AzsContainerRegistryQuota.Recording.json new file mode 100644 index 00000000..c9a4bba3 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/New-AzsContainerRegistryQuota.Recording.json @@ -0,0 +1,78 @@ +{ + "New-AzsContainerRegistryQuota+[NoContext]+TestCreateStorageQuota+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"numberOfRegistries\": 20,\r\n \"capacityPerRegistryInGiB\": 20\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "95" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "75cab910-fb1d-4f21-a077-74e864ab4257" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1199" ], + "x-ms-correlation-request-id": [ "e2b21f89-beee-4c89-9ce1-04f39fca466e" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181224Z:e2b21f89-beee-4c89-9ce1-04f39fca466e" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:24 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "307" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestCreateQuota\",\"name\":\"redmond/TestCreateQuota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}", + "isContentBase64": false + } + }, + "New-AzsContainerRegistryQuota+[NoContext]+TestCreateStorageQuota+$DELETE+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestCreateQuota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "12" ], + "x-ms-client-request-id": [ "49e20dde-42f5-4fd4-982d-0404a7c859bf" ], + "CommandName": [ "Remove-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Remove-AzsContainerRegistryQuota_Delete" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "5433ccad-6732-42ce-9f70-549740687f77" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "14999" ], + "x-ms-correlation-request-id": [ "b1eaae52-9226-40ca-9fba-254f6f33b4f4" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181226Z:b1eaae52-9226-40ca-9fba-254f6f33b4f4" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:25 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null, + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/New-AzsContainerRegistryQuota.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/New-AzsContainerRegistryQuota.Tests.ps1 new file mode 100644 index 00000000..93872b84 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/New-AzsContainerRegistryQuota.Tests.ps1 @@ -0,0 +1,25 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'New-AzsContainerRegistryQuota.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'New-AzsContainerRegistryQuota' { + It "TestCreateStorageQuota" -Skip:$('TestCreateContainerRegistryQuota' -in $global:SkippedTests) { + $global:TestName = 'TestCreateContainerRegistryQuota' + + $name = "TestCreateQuota" + $quota = New-AzsContainerRegistryQuota -CapacityPerRegistryInGib 20 -NumberOfRegistry 20 -Name $name + $quota | Should Not Be $null + $quota.CapacityPerRegistryInGib | Should Be 20 + $quota.NumberOfRegistry | Should Be 20 + Remove-AzsContainerRegistryQuota -Name $name + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryConfiguration.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryConfiguration.Recording.json new file mode 100644 index 00000000..7efaed33 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryConfiguration.Recording.json @@ -0,0 +1,160 @@ +{ + "Remove-AzsContainerRegistryConfiguration+[NoContext]+TestRemoveContainerRegistryConfiguration+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "13" ], + "x-ms-client-request-id": [ "ca973158-44b9-4f74-9f7b-d3493ce4bd73" ], + "CommandName": [ "Get-AzsContainerRegistryConfiguration" ], + "FullCommandName": [ "Get-AzsContainerRegistryConfiguration_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "780b1234-e64b-4c6f-b69e-125d779e3e52" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14901" ], + "x-ms-correlation-request-id": [ "2ec702aa-52cf-49ba-8839-9d1608be7f0a" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181227Z:2ec702aa-52cf-49ba-8839-9d1608be7f0a" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:27 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "290" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":0}}]}", + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryConfiguration+[NoContext]+TestRemoveContainerRegistryConfiguration+$DELETE+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "14" ], + "x-ms-client-request-id": [ "22d61cee-7cb7-45be-af4f-55ac32c8bc22" ], + "CommandName": [ "Remove-AzsContainerRegistryConfiguration" ], + "FullCommandName": [ "Remove-AzsContainerRegistryConfiguration_Delete" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "0df61c64-6ae1-4e33-a6bb-7a8abe68af7f" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "14998" ], + "x-ms-correlation-request-id": [ "77cda7ef-3503-4012-a9c2-bca3a1def352" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181229Z:77cda7ef-3503-4012-a9c2-bca3a1def352" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:29 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null, + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryConfiguration+[NoContext]+TestRemoveContainerRegistryConfiguration+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview+3": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "15" ], + "x-ms-client-request-id": [ "e7f13bfb-34f0-46db-b66f-ad04cc651b8c" ], + "CommandName": [ "Get-AzsContainerRegistryConfiguration" ], + "FullCommandName": [ "Get-AzsContainerRegistryConfiguration_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "f56af45b-a923-4fd0-b8b7-bc35b7e97c40" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14898" ], + "x-ms-correlation-request-id": [ "ea9fcffd-5d53-4d90-973c-768716f2b188" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181230Z:ea9fcffd-5d53-4d90-973c-768716f2b188" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:30 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "290" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":0}}]}", + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryConfiguration+[NoContext]+TestRemoveContainerRegistryConfiguration+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview+4": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"maximumCapacityInGiB\": 0\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "59" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "26bb3969-7b78-4f5b-906f-4df70648cc85" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1198" ], + "x-ms-correlation-request-id": [ "5fcf1ad7-d9f4-498e-9b51-d3527a690004" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181232Z:5fcf1ad7-d9f4-498e-9b51-d3527a690004" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:32 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "278" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":0}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryConfiguration.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryConfiguration.Tests.ps1 new file mode 100644 index 00000000..2ea2616d --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryConfiguration.Tests.ps1 @@ -0,0 +1,26 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzsContainerRegistryConfiguration.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Remove-AzsContainerRegistryConfiguration' { + It "TestRemoveContainerRegistryConfiguration" -Skip:$('TestRemoveContainerRegistryConfiguration' -in $global:SkippedTests) { + $global:TestName = 'TestRemoveContainerRegistryConfiguration' + + $maxCapacityInGib = (Get-AzsContainerRegistryConfiguration ).MaximumCapacityInGib + $targetCapacityInGib = 0 + Remove-AzsContainerRegistryConfiguration -ConfigurationName default + $result = Get-AzsContainerRegistryConfiguration + $result | Should Not Be $null + $result.MaximumCapacityInGib | Should Be $targetCapacityInGib + Set-AzsContainerRegistryConfiguration -MaximumCapacityInGib $maxCapacityInGib -ConfigurationName default + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryQuota.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryQuota.Recording.json new file mode 100644 index 00000000..303fd238 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryQuota.Recording.json @@ -0,0 +1,195 @@ +{ + "Remove-AzsContainerRegistryQuota+[NoContext]+TestDeleteContainerRegistryQuota+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"numberOfRegistries\": 100,\r\n \"capacityPerRegistryInGiB\": 50\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "96" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "5ed23094-37b8-4dcb-805d-a5843392547e" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1197" ], + "x-ms-correlation-request-id": [ "3b493476-64e1-41a0-ba06-dc09715da4af" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181235Z:3b493476-64e1-41a0-ba06-dc09715da4af" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:34 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "308" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota\",\"name\":\"redmond/TestDeleteQuota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":50,\"numberOfRegistries\":100}}", + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryQuota+[NoContext]+TestDeleteContainerRegistryQuota+$DELETE+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "18" ], + "x-ms-client-request-id": [ "ec657587-cedd-4979-8e97-ee0c63df9ce9" ], + "CommandName": [ "Remove-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Remove-AzsContainerRegistryQuota_Delete" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "b5728e9b-00ea-4593-9087-925a4a62b2fb" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "14997" ], + "x-ms-correlation-request-id": [ "c655abf7-7068-43d9-b270-3e6d2f8be2db" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181236Z:c655abf7-7068-43d9-b270-3e6d2f8be2db" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:36 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null, + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryQuota+[NoContext]+TestDeleteContainerRegistryQuota+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview+3": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"numberOfRegistries\": 100,\r\n \"capacityPerRegistryInGiB\": 50\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "96" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "776e3efa-4af1-4482-8327-be0e870ba757" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1196" ], + "x-ms-correlation-request-id": [ "a70a07c7-4cee-4a61-bdd5-d055925f2630" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181238Z:a70a07c7-4cee-4a61-bdd5-d055925f2630" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:37 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "308" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota\",\"name\":\"redmond/TestDeleteQuota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":50,\"numberOfRegistries\":100}}", + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryQuota+[NoContext]+TestDeleteContainerRegistryQuota+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview+4": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "20" ], + "x-ms-client-request-id": [ "eb62b564-7251-4856-a2c0-ca8dfcfddc9b" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "4ee5da3a-6397-4340-b27f-3cb5d34d084c" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14892" ], + "x-ms-correlation-request-id": [ "f67e252b-3dd2-422d-b00a-db6f7f017589" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181239Z:f67e252b-3dd2-422d-b00a-db6f7f017589" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:39 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "308" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota\",\"name\":\"redmond/TestDeleteQuota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":50,\"numberOfRegistries\":100}}", + "isContentBase64": false + } + }, + "Remove-AzsContainerRegistryQuota+[NoContext]+TestDeleteContainerRegistryQuota+$DELETE+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview+5": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/TestDeleteQuota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "21" ], + "x-ms-client-request-id": [ "9f5c38a6-3e21-4aa9-ad90-b046ab328447" ], + "CommandName": [ "Remove-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Remove-AzsContainerRegistryQuota_DeleteViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "60c5f41d-47e6-40de-836d-47e4aea76c9f" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "14996" ], + "x-ms-correlation-request-id": [ "a15e8d65-9bc7-4940-9310-6d7d2f4d877b" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181240Z:a15e8d65-9bc7-4940-9310-6d7d2f4d877b" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:39 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null, + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryQuota.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryQuota.Tests.ps1 new file mode 100644 index 00000000..2d24276f --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Remove-AzsContainerRegistryQuota.Tests.ps1 @@ -0,0 +1,28 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzsContainerRegistryQuota.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Remove-AzsContainerRegistryQuota' { + It "TestDeleteContainerRegistryQuota" -Skip:$('TestDeleteContainerRegistryQuota' -in $global:SkippedTests) { + $global:TestName = 'TestDeleteContainerRegistryQuota' + + $name = "TestDeleteQuota" + $quota = New-AzsContainerRegistryQuota -CapacityPerRegistryInGib 50 -NumberOfRegistry 100 -Name $name + $quota | Should Not Be $null + $quota.CapacityPerRegistryInGib | Should Be 50 + $quota.NumberOfRegistry | Should Be 100 + Remove-AzsContainerRegistryQuota -Name $name + $quota | New-AzsContainerRegistryQuota -Name $name + $retrievedQuota = Get-AzsContainerRegistryQuota -Name $name + Remove-AzsContainerRegistryQuota -InputObject $retrievedQuota + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryConfiguration.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryConfiguration.Recording.json new file mode 100644 index 00000000..a80e5675 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryConfiguration.Recording.json @@ -0,0 +1,115 @@ +{ + "Set-AzsContainerRegistryConfiguration+[NoContext]+TestUpdateContainerRegistryConfiguration+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "22" ], + "x-ms-client-request-id": [ "bcd7401f-8045-4255-a62f-83f0c9fc10bc" ], + "CommandName": [ "Get-AzsContainerRegistryConfiguration" ], + "FullCommandName": [ "Get-AzsContainerRegistryConfiguration_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "e299cf8e-2b37-4bd5-b808-6bcc3553dc6f" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14890" ], + "x-ms-correlation-request-id": [ "00a6dc15-a8bd-413d-94af-673a1b1a2446" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181241Z:00a6dc15-a8bd-413d-94af-673a1b1a2446" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:41 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "290" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":0}}]}", + "isContentBase64": false + } + }, + "Set-AzsContainerRegistryConfiguration+[NoContext]+TestUpdateContainerRegistryConfiguration+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"maximumCapacityInGiB\": 1\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "59" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "a6ab0516-d187-4b66-96a4-802ead3680f7" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1195" ], + "x-ms-correlation-request-id": [ "70469760-c195-4d30-9049-36b20f26fd4c" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181243Z:70469760-c195-4d30-9049-36b20f26fd4c" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:43 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "278" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":1}}", + "isContentBase64": false + } + }, + "Set-AzsContainerRegistryConfiguration+[NoContext]+TestUpdateContainerRegistryConfiguration+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview+3": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/default?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"maximumCapacityInGiB\": 0\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "59" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "f32fcc50-4bc7-4afa-a985-f3d6f50d4153" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1194" ], + "x-ms-correlation-request-id": [ "2b4d20ce-a0ee-483a-afc0-4451ca4d1818" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181245Z:2b4d20ce-a0ee-483a-afc0-4451ca4d1818" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:45 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "278" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/configurations/Default\",\"name\":\"redmond/Default\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/configurations\",\"properties\":{\"maximumCapacityInGiB\":0}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryConfiguration.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryConfiguration.Tests.ps1 new file mode 100644 index 00000000..1baf125d --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryConfiguration.Tests.ps1 @@ -0,0 +1,25 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzsContainerRegistryConfiguration.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Set-AzsContainerRegistryConfiguration' { + It "TestUpdateContainerRegistryConfiguration" -Skip:$('TestUpdateContainerRegistryConfiguration' -in $global:SkippedTests) { + $global:TestName = 'TestUpdateContainerRegistryConfiguration' + + $maxCapacityInGib = (Get-AzsContainerRegistryConfiguration ).MaximumCapacityInGib + $targetCapacityInGib = $originalDays + 1 + $result = Set-AzsContainerRegistryConfiguration -MaximumCapacityInGib $targetCapacityInGib -ConfigurationName default + $result | Should Not Be $null + $result.MaximumCapacityInGib | Should Be $targetCapacityInGib + Set-AzsContainerRegistryConfiguration -MaximumCapacityInGib $maxCapacityInGib -ConfigurationName default + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryQuota.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryQuota.Recording.json new file mode 100644 index 00000000..21392536 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryQuota.Recording.json @@ -0,0 +1,115 @@ +{ + "Set-AzsContainerRegistryQuota+[NoContext]+TestUpdateContainerRegistryQuota+$GET+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default Quota?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://adminmanagement.redmond.ext-n25r1308.masd.stbtest.microsoft.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default%20Quota?api-version=2019-11-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "25" ], + "x-ms-client-request-id": [ "aed03352-0099-4faa-b03e-f9e3baeb906e" ], + "CommandName": [ "Get-AzsContainerRegistryQuota" ], + "FullCommandName": [ "Get-AzsContainerRegistryQuota_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "ce2868d0-86ff-4e1d-ad95-18b98d883fdb" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "14886" ], + "x-ms-correlation-request-id": [ "23b76036-d3f3-4894-8823-433ff4bbfb87" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181247Z:23b76036-d3f3-4894-8823-433ff4bbfb87" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:47 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "303" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}", + "isContentBase64": false + } + }, + "Set-AzsContainerRegistryQuota+[NoContext]+TestUpdateContainerRegistryQuota+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default Quota?api-version=2019-11-01-preview+2": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default%20Quota?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"numberOfRegistries\": 10,\r\n \"capacityPerRegistryInGiB\": 100\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "96" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "5e1c71c9-9394-40d5-b73b-5c4dc4ae0635" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1193" ], + "x-ms-correlation-request-id": [ "9527283b-0328-47f7-8136-6c3e072109ef" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181249Z:9527283b-0328-47f7-8136-6c3e072109ef" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:49 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "304" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":100,\"numberOfRegistries\":10}}", + "isContentBase64": false + } + }, + "Set-AzsContainerRegistryQuota+[NoContext]+TestUpdateContainerRegistryQuota+$PUT+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default Quota?api-version=2019-11-01-preview+3": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default%20Quota?api-version=2019-11-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"numberOfRegistries\": 20,\r\n \"capacityPerRegistryInGiB\": 20\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "95" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "c0ec29a7-7fae-4e1c-a6ca-bdc0c5ff394c" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1192" ], + "x-ms-correlation-request-id": [ "3aef1b41-5895-4871-938c-5767b282a489" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181250Z:3aef1b41-5895-4871-938c-5767b282a489" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:50 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "303" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/quotas/Default quota\",\"name\":\"redmond/Default quota\",\"type\":\"Microsoft.ContainerRegistry.Admin/locations/quotas\",\"properties\":{\"capacityPerRegistryInGiB\":20,\"numberOfRegistries\":20}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryQuota.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryQuota.Tests.ps1 new file mode 100644 index 00000000..b37583e4 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Set-AzsContainerRegistryQuota.Tests.ps1 @@ -0,0 +1,83 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Set-AzsContainerRegistryQuota.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Set-AzsContainerRegistryQuota' { + BeforeEach { + + function ValidateContainerRegistryQuota { + param( + [Parameter(Mandatory = $true)] + $containerRegistryQuota + ) + # Resource + $containerRegistryQuota | Should Not Be $null + + # Validate ContainerRegistry quota properties + $containerRegistryQuota.CapacityPerRegistryInGib | Should Not Be $null + $containerRegistryQuota.NumberOfRegistry | Should Not Be $null + $containerRegistryQuota.Type | Should Not Be $null + $containerRegistryQuota.Id | Should Not Be $null + $containerRegistryQuota.Name | Should Not Be $null + } + + function AssertAreEqual { + param( + [Parameter(Mandatory = $true)] + $expected, + [Parameter(Mandatory = $true)] + $found + ) + # Resource + if ($null -eq $expected) { + $found | Should Be $null + } + else { + $found | Should Not Be $null + # Validate ContainerRegistry quota properties + $expected.CapacityPerRegistryInGib | Should Be $found.CapacityPerRegistryInGib + $expected.NumberOfRegistry | Should Be $found.NumberOfRegistry + } + } + } + + AfterEach { + $global:Client = $null + } + + It "TestUpdateContainerRegistryQuota" -Skip:$('TestUpdateContainerRegistryQuota' -in $global:SkippedTests) { + $global:TestName = 'TestUpdateContainerRegistryQuota' + + $name = "Default Quota" + + $quota = Get-AzsContainerRegistryQuota -Name 'Default Quota' + + $quota | Should Not Be $null + + $CapInGiB = 100 + $NumOfRegistry = 10 + + $updated = Set-AzsContainerRegistryQuota ` + -CapacityPerRegistryInGib $CapInGiB ` + -NumberOfRegistry $NumOfRegistry ` + -Name $name + + ValidateContainerRegistryQuota -containerRegistryQuota $updated + $updated.CapacityPerRegistryInGib | Should Be $CapInGiB + $updated.NumberOfRegistry | Should Be $NumOfRegistry + + Set-AzsContainerRegistryQuota ` + -CapacityPerRegistryInGib $quota.CapacityPerRegistryInGib ` + -NumberOfRegistry $quota.NumberOfRegistry ` + -Name $name + } +} diff --git a/src/Azs.ContainerRegistry.Admin/test/Start-AzsContainerRegistrySetup.Recording.json b/src/Azs.ContainerRegistry.Admin/test/Start-AzsContainerRegistrySetup.Recording.json new file mode 100644 index 00000000..32798c7d --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Start-AzsContainerRegistrySetup.Recording.json @@ -0,0 +1,38 @@ +{ + "Start-AzsContainerRegistrySetup+[NoContext]+[NoScenario]+$POST+https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup?api-version=2019-11-01-preview+1": { + "Request": { + "Method": "POST", + "RequestUri": "https://management.azure.com/subscriptions/7e41090c-4aa7-40bc-856a-a993f8fbd215/providers/Microsoft.ContainerRegistry.Setup/locations/redmond/setup?api-version=2019-11-01-preview", + "Content": "{\r\n \"password\": \"password\",\r\n \"sslCertBase64\": \"MIIi7QIBAzCCIqkGCSqGSIb3DQEHAaCCIpoEgiKWMIIikjCCCqsGCSqGSIb3DQEHAaCCCpwEggqYMIIKlDCCCpAGCyqGSIb3DQEMCgECoIIJfjCCCXowHAYKKoZIhvcNAQwBAzAOBAhRjAPnR8YnhwICB9AEgglYe2P5S4PL8OrlOKHlh2NKxWYtkSosXswvt3F/4H4+mJeg9CaPwLXn9RY72EawlCJ8R2nWxYJCVLWhAyIACYlbjpHlZjJEx7bRFfRUPHnG/BAol8jQuKG0N3yNszZqlU3azgaDcgJvPdcLYt/WdAIE2Tisl1Ly1ukXkThlxzQ96WoiemVHOtjmEUyFsW+VWNmEDzdV6oLOJktFv3mbAEOUOz3onTcQbNr4IXyFrrxHFns8PvXcKDCZaGI8Bk8RzajJHbuoqsorGPexMCoLn1lYE1VQh5rP09boZ83uHjMhIR5V6c45HFFtRw2GQkl4gnoCpU9uV3Kr0bQ2PzwATEE+8MJ4cac12nYUQ0w7EQg6tHwWJTkK6Wpf0CiaV1CtSvB4Xs0h3timQxEU5IcOD3+Uu9LwlYu2OkmN19Ot61edO1PbPnOoSeRoiTPaSc2EpnkFAFRFNEvM6t9FPhpUTdPeq3AbcYHut2xm1hixm6p8QM+KyeoKqaCDTVEY629VOizQAR77qZWczzH30OqWgjrQfYsBLmNa2ojvdzVasu5z5mGCS+caFCJ8SSU1T9jutdA4YjROXLWYuMs8KDv7D38MtkpbWK1TnBx0HQ6DT9urTff5zM6KFCVrwY3cw3xU6rn9b7eEEiFA4WHd7Nk3a8ue0dBW6lq3b81dzp/cekpki+blMJKuBiWOzA1w8FGYm1bOLce0AaNX0x7iwF3el6nOqmHfjqPbWO79VatYvUf+zGNLi8Qo8ZBuIk1IRwbCYA/w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zk6r1oe9AhRbg+H/LBk87Y1bm+rDghOdyvAY9Q6HHBroOqhfLhmJ0OvHKx7vJm0Vhpp05vSHB32T1wL5QjCcJDtVwyqP3VTSQ3B37NzJAGk1Ogzb4QEJFz66TNYTqeTJbqf+3YqVftL30o9UojA7MB8wBwYFKw4DAhoEFCAUO1qfPnlbw7HCurHqfxQU6ZyiBBS8kGkralY8bGYQ5oQaBjCq2MJXfAICB9A=\"\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "11982" ] + } + }, + "Response": { + "StatusCode": 409, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-request-id": [ "fd07dfd6-cd20-446d-b667-aec040e28413" ], + "Server": [ "Microsoft-HTTPAPI/2.0" ], + "x-ms-ratelimit-remaining-subscription-writes": [ "1199" ], + "x-ms-correlation-request-id": [ "8020e31e-22fc-4986-b338-4749074a4a9b" ], + "x-ms-routing-request-id": [ "REDMOND:20210819T181253Z:8020e31e-22fc-4986-b338-4749074a4a9b" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Thu, 19 Aug 2021 18:12:53 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "161" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"error\":{\"code\":\"AcrAlreadyDeployed\",\"message\":\"Container registry deployment has already been successfully completed. It is not allowed to repeat deployment\"}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Azs.ContainerRegistry.Admin/test/Start-AzsContainerRegistrySetup.Tests.ps1 b/src/Azs.ContainerRegistry.Admin/test/Start-AzsContainerRegistrySetup.Tests.ps1 new file mode 100644 index 00000000..ffd5cc96 --- /dev/null +++ b/src/Azs.ContainerRegistry.Admin/test/Start-AzsContainerRegistrySetup.Tests.ps1 @@ -0,0 +1,19 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Start-AzsContainerRegistrySetup.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Start-AzsContainerRegistrySetup' { + $password = ConvertTo-SecureString "password" -AsPlainText -Force + $pfx_cert_path = "C:\CloudDeployment\Setup\Certificates\ADFS\Container Registry\SSL.pfx" + + { Start-AzsContainerRegistrySetup -Password $password -SslCertInputFile $pfx_cert_path } | Should Not Throw +}