-
Notifications
You must be signed in to change notification settings - Fork 30
ACR Admin module - Pester Test fixes #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
e71e750
Initial code changes
rjaini e953c3d
ACR auto-generating cmdlets.
larisaborodina d40995a
Merge pull request #1 from larisaborodina/release/acrchanges
rjaini 8bc4b41
ACR auto-generating cmdlets. - #2
larisaborodina 579d76f
Merge pull request #2 from larisaborodina/release/acrchanges
rjaini d16c156
Add pester tests for all the cmdlets.
larisaborodina d62418c
Merge branch 'release/acrchanges' of https://github.com/larisaborodin…
larisaborodina f4aaa5e
Merge pull request #3 from larisaborodina/release/acrchanges
rjaini ada05b3
Merge branch 'dev' into release/acrchanges
larisaborodina 5f81725
Add examples for all the cmdlets.
larisaborodina 31a2056
Merge pull request #4 from larisaborodina/release/acrchanges
larisaborodina 55ea749
Increase vertion to 0.2.0 to avoid clashing with manually released 0.…
larisaborodina 5c1e28b
Merge pull request #5 from larisaborodina/release/acrchanges
larisaborodina dba2afd
Merge branch 'Azure:dev' into release/acrchanges
larisaborodina be23ddd
Merge branch 'Azure:dev' into release/acrchanges
larisaborodina 10211aa
Replace Read-AzsContainerRegistry to Get-AzsContainerRegistry.
larisaborodina e983df3
Merge pull request #6 from larisaborodina/release/acrchanges
larisaborodina b97a244
Add missed Get-AzsContainerRegistry.Recording.json
larisaborodina d3ffb18
Merge pull request #7 from larisaborodina/release/acrchanges
larisaborodina ec31d3b
Add docs for all cmdlets
larisaborodina 53a98cf
Merge branch 'release/acrchanges' of https://github.com/larisaborodin…
larisaborodina 4a22f44
Merge pull request #8 from larisaborodina/release/acrchanges
larisaborodina 26b3572
Initial code changes
rjaini ea79435
ACR auto-generating cmdlets.
larisaborodina 4181db5
ACR auto-generating cmdlets. - #2
larisaborodina 0e02a3f
Add pester tests for all the cmdlets.
larisaborodina fe2ac98
Add examples for all the cmdlets.
larisaborodina 5f361ca
Increase vertion to 0.2.0 to avoid clashing with manually released 0.…
larisaborodina 617f1f0
Replace Read-AzsContainerRegistry to Get-AzsContainerRegistry.
larisaborodina 34bf575
Add missed Get-AzsContainerRegistry.Recording.json
larisaborodina b78246c
Add docs for all cmdlets
larisaborodina 7b24676
Merge branch 'release/acrchanges' of https://github.com/larisaborodin…
larisaborodina 7a689a8
Merge pull request #9 from larisaborodina/release/acrchanges
larisaborodina c641788
Merge branch 'Azure:dev' into release/acrchanges
larisaborodina f81437a
Fixed tests running locally, updated docs.
larisaborodina 36f9520
Merge pull request #10 from larisaborodina/release/acrchanges
larisaborodina cfa1ba7
adding loadEnvJson file for tests
bganapa c30c4d8
Pester Test fixes.
larisaborodina 810898c
Merge pull request #11 from larisaborodina/release/acrchanges
larisaborodina 28ef012
Merge branch 'Azure:dev' into release/acrchanges
larisaborodina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryCapacity.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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. | ||
|
|
15 changes: 15 additions & 0 deletions
15
src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryConfiguration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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. | ||
|
|
||
|
|
39 changes: 39 additions & 0 deletions
39
src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistryQuota.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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. | ||
|
|
16 changes: 16 additions & 0 deletions
16
src/Azs.ContainerRegistry.Admin/examples/Get-AzsContainerRegistrySetupStatus.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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. | ||
|
|
15 changes: 15 additions & 0 deletions
15
src/Azs.ContainerRegistry.Admin/examples/New-AzsContainerRegistryQuota.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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. | ||
|
|
||
19 changes: 19 additions & 0 deletions
19
src/Azs.ContainerRegistry.Admin/examples/Read-AzsContainerRegistry.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ### Example 1: Read List Azs Container Registries | ||
| ```powershell | ||
| PS C:\> Read-AzsContainerRegistry | ||
larisaborodina marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| { | ||
| "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. | ||
7 changes: 7 additions & 0 deletions
7
...zs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryConfiguration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ### Example 1: Remove Azs ContainerRegistry Configuration | ||
| ```powershell | ||
| PS C:\> Remove-AzsContainerRegistryConfiguration -ConfigurationName default | ||
|
|
||
| ``` | ||
|
|
||
| Delete an existing container registry configuration. |
7 changes: 7 additions & 0 deletions
7
src/Azs.ContainerRegistry.Admin/examples/Remove-AzsContainerRegistryQuota.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ### Example 1: Remove Azs ContainerRegistry Configuration | ||
| ```powershell | ||
| PS C:\> Remove-AzsContainerRegistryConfiguration -ConfigurationName default | ||
|
|
||
| ``` | ||
|
|
||
| Delete an existing container registry configuration. |
14 changes: 14 additions & 0 deletions
14
src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryConfiguration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ### Example 1: Set Azs ContainerRegistry Configuration | ||
| ```powershell | ||
| PS C:\> Set-AzsContainerRegistryConfiguration -MaximumCapacityInGib 30 -ConfigurationName default | ||
larisaborodina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| { | ||
| "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. | ||
|
|
||
15 changes: 15 additions & 0 deletions
15
src/Azs.ContainerRegistry.Admin/examples/Set-AzsContainerRegistryQuota.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ### Example 1: Set Azs ContainerRegistry Quota | ||
| ```powershell | ||
| PS C:\> Set-AzsContainerRegistryQuota -QuotaName testquota -CapacityPerRegistryInGib 30 -NumberOfRegistry 30 | ||
larisaborodina marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| { | ||
| "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. | ||
|
|
||
8 changes: 8 additions & 0 deletions
8
src/Azs.ContainerRegistry.Admin/examples/Start-AzsContainerRegistrySetup.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| <!-- region Generated --> | ||
| # Azs.ContainerRegistry.Admin | ||
| This directory contains the PowerShell module for the ContainerRegistryAdmin service. | ||
|
|
||
| --- | ||
| ## Status | ||
| [](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). | ||
| <!-- endregion --> | ||
|
|
||
| ## 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 <br>`npm install -g autorest@beta`<br> | ||
| - PowerShell 6.0 or greater | ||
| - If you don't have it installed, you can use the cross-platform npm package <br>`npm install -g pwsh`<br> | ||
| - .NET Core SDK 2.0 or greater | ||
| - If you don't have it installed, you can use the cross-platform npm package <br>`npm install -g dotnet-sdk-2.2`<br> | ||
|
|
||
| ## 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 Get-AzsContainerRegistry to Read-AzsContainerRegistry | ||
| - where: | ||
larisaborodina marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| verb: Get | ||
| subject: ContainerRegistry | ||
| set: | ||
| verb: Read | ||
|
|
||
| # 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('<releaseNotes></releaseNotes>', '<releaseNotes>AzureStack Hub Admin module generated with https://github.com/Azure/autorest.powershell.</releaseNotes>'); | ||
|
|
||
| # Add Az.Accounts/Az.Resources as dependencies | ||
| - from: Azs.ContainerRegistry.Admin.nuspec | ||
| where: $ | ||
| transform: $ = $.replace('<dependency id=\"Az.Accounts\" version=\"1.6.0\" />', '<dependency id="Az.Accounts" version="2.2.8" />\n <dependency id="Az.Resources" version="[0.11.0]" />'); | ||
|
|
||
| # 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\'\"\);' ); | ||
| ``` | ||
43 changes: 43 additions & 0 deletions
43
src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Recording.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "Get-AzsContainerRegistryCapacity+[NoContext]+TestGetContainerRegistryCapacity+$GET+https://management.azure.com/subscriptions/80cc99fb-a34a-449e-a880-24f85d73cb04/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/80cc99fb-a34a-449e-a880-24f85d73cb04/providers/Microsoft.ContainerRegistry.Admin/locations/redmond/capacities?api-version=2019-11-01-preview", | ||
| "Content": null, | ||
| "isContentBase64": false, | ||
| "Headers": { | ||
| "x-ms-unique-id": [ "1" ], | ||
| "x-ms-client-request-id": [ "6d2216ce-c1ed-4d4a-9e76-537a99939cd9" ], | ||
| "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": [ "4ae3898e-ce0f-4628-bd90-fc05b695bd2e" ], | ||
| "Server": [ "Microsoft-HTTPAPI/2.0" ], | ||
| "x-ms-ratelimit-remaining-subscription-reads": [ "14816" ], | ||
| "x-ms-correlation-request-id": [ "f8851610-9220-4e6e-aeda-1fd1e000d471" ], | ||
| "x-ms-routing-request-id": [ "REDMOND:20210805T012053Z:f8851610-9220-4e6e-aeda-1fd1e000d471" ], | ||
| "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], | ||
| "X-Content-Type-Options": [ "nosniff" ], | ||
| "Date": [ "Thu, 05 Aug 2021 01:20:52 GMT" ] | ||
| }, | ||
| "ContentHeaders": { | ||
| "Content-Length": [ "334" ], | ||
| "Content-Type": [ "application/json; charset=utf-8" ], | ||
| "Expires": [ "-1" ] | ||
| }, | ||
| "Content": "{\"value\":[{\"id\":\"/subscriptions/80cc99fb-a34a-449e-a880-24f85d73cb04/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 | ||
| } | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
src/Azs.ContainerRegistry.Admin/test/Get-AzsContainerRegistryCapacity.Tests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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 | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.