Conversation
🔄AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds help documentation examples for the az acr show-usage command to clarify the difference between "Size" and "MaximumStorageCapacity" usage entities and demonstrate how to query them specifically using JMESPath queries.
- Added example showing how to query the current storage usage ("Size")
- Added example showing how to query the maximum storage capacity limit ("MaximumStorageCapacity")
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| - name: Size: The current amount of storage used by the registry (in bytes). | ||
| text: > | ||
| az acr show-usage -n myregistry --query "value[?name=='Size'] | [0]" | ||
| - name: MaximumStorageCapacity: The maximum storage limit allowed for the registry based on its SKU (in bytes). | ||
| text: > | ||
| az acr show-usage -n myregistry --query "value[?name=='MaximumStorageCapacity'] | [0]" |
There was a problem hiding this comment.
The indentation is inconsistent. Lines 902, 905 should use 4 spaces for indentation to match the existing pattern, but they appear to use 6 spaces instead of the expected 4.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| - name: Get the storage usage for an Azure Container Registry. | ||
| text: > | ||
| az acr show-usage -n myregistry | ||
| - name: Get the current amount of storage used by the registry (in bytes). |
There was a problem hiding this comment.
The Size item shows the current storage usage and the included storage limit based on its SKU. The maximum storage capacity is not dependent on SKU. Let's update the descriptions accordingly. The maximum storage limit one does not need to mention sku
There was a problem hiding this comment.
@jaysterp Updated the naming to what Payal, you, and I had discussed offline. Let me know if you would like any other edits!
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az acr show-usage: Add examples for MaximumStorageCapacity and Size query
Related command
az acr show-usage
Description
We are adding a new listUsage entity to our API to expose "MaximumStorageCapacity". This will allow us to show the maximum storage capacity of the registry without altering the existing structure of the API.
The update to the help command helps users under the different between the "Size" and "MaximumStorageCapacity" listUsages entities and how to query them.
Testing Guide
Example of
az acr show-usage --helpCommand az acr show-usage : Get the storage usage for an Azure Container Registry. Arguments --name -n [Required] : The name of the container registry. It should be specified in lower case. You can configure the default registry name using `az configure --defaults acr=<registry name>`. --resource-group -g : Name of resource group. You can configure the default group using `az configure --defaults group=<name>`. Global Arguments --debug : Increase logging verbosity to show all debug logs. --help -h : Show this help message and exit. --only-show-errors : Only show errors, suppressing warnings. --output -o : Output format. Allowed values: json, jsonc, none, table, tsv, yaml, yamlc. Default: json. --query : JMESPath query string. See http://jmespath.org/ for more information and examples. --subscription : Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`. --verbose : Increase logging verbosity. Use --debug for full debug logs. Examples Get the storage usage for an Azure Container Registry. az acr show-usage -n myregistry Get the current amount of storage used by the registry (in bytes). az acr show-usage -n myregistry --query "value[?name=='Size'] | [0]" Get the maximum storage limit allowed for the registry based on its SKU. az acr show-usage -n myregistry --query "value[?name=='MaximumStorageCapacity'] | [0]" **History Notes** <!--If your PR is not customer-facing, use {Component Name} in the PR title. Otherwise, use [Component Name] to allow our pipeline to add the title as a history note. If you need multiple history notes or would like to overwrite the note from the PR title, please fill in the following templates.--> [Component Name 1] BREAKING CHANGE: `az command a`: Make some customer-facing breaking change [Component Name 2] `az command b`: Add some customer-facing feature --- This checklist is used to make sure that common guidelines for a pull request are followed. - [X ] The PR title and description has followed the guideline in [Submitting Pull Requests](https://github.com/Azure/azure-cli/tree/dev/doc/authoring_command_modules#submitting-pull-requests). - [X ] I adhere to the [Command Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md). - [ X] I adhere to the [Error Handling Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/error_handling_guidelines.md).