|
| 1 | +<!-- region Generated --> |
| 2 | +# Az.Metric |
| 3 | +This directory contains the PowerShell module for the Metric service. |
| 4 | + |
| 5 | +--- |
| 6 | +## Info |
| 7 | +- Modifiable: yes |
| 8 | +- Generated: all |
| 9 | +- Committed: yes |
| 10 | +- Packaged: yes |
| 11 | + |
| 12 | +--- |
| 13 | +## Detail |
| 14 | +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. |
| 15 | + |
| 16 | +## Module Requirements |
| 17 | +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater |
| 18 | + |
| 19 | +## Authentication |
| 20 | +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. |
| 21 | + |
| 22 | +## Development |
| 23 | +For information on how to develop for `Az.Metric`, see [how-to.md](how-to.md). |
| 24 | +<!-- endregion --> |
| 25 | + |
| 26 | +### AutoRest Configuration |
| 27 | +> see https://aka.ms/autorest |
| 28 | +```yaml |
| 29 | +# pin the swagger version by using the commit id instead of branch name |
| 30 | +require: |
| 31 | +# readme.azure.noprofile.md is the common configuration file |
| 32 | + - $(this-folder)/../../readme.azure.noprofile.md |
| 33 | +commit: 62937afd6872cb4da67787bcc7866725db3366a5 |
| 34 | + |
| 35 | +input-file: |
| 36 | + - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-10-01/metricDefinitions_API.json |
| 37 | + - $(repo)/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-10-01/metrics_API.json |
| 38 | + |
| 39 | +root-module-name: $(prefix).Monitor |
| 40 | +title: Metric |
| 41 | +module-name: Az.Metric |
| 42 | +module-version: 0.1.0 |
| 43 | +subject-prefix: Metric |
| 44 | + |
| 45 | +directive: |
| 46 | + # remove duplicate parameter |
| 47 | + - from: swagger-document |
| 48 | + where: $.paths["/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics"].post.parameters |
| 49 | + transform: >- |
| 50 | + return [ |
| 51 | + { |
| 52 | + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" |
| 53 | + }, |
| 54 | + { |
| 55 | + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" |
| 56 | + }, |
| 57 | + { |
| 58 | + "$ref": "../../../../common-types/v2/commonMonitoringTypes.json#/parameters/RegionParameter" |
| 59 | + }, |
| 60 | + { |
| 61 | + "in": "body", |
| 62 | + "name": "body", |
| 63 | + "description": "Parameters serialized in the body", |
| 64 | + "schema": { |
| 65 | + "$ref": "#/definitions/SubscriptionScopeMetricsRequestBodyParameters" |
| 66 | + } |
| 67 | + } |
| 68 | + ] |
| 69 | + # remove variant: Metrics_ListAtSubscriptionScope and non-expanded Metrics_ListAtSubscriptionScopePost |
| 70 | + - where: |
| 71 | + subject: Metric |
| 72 | + variant: ^List$|^List1$ |
| 73 | + remove: true |
| 74 | + # rollupby and orderby use Camel-Case, fix 'Sequence contains no matching element' error when building Metrics_ListAtSubscriptionScopePost |
| 75 | + - where: |
| 76 | + subject: Metric |
| 77 | + parameter-name: rollUpBy |
| 78 | + set: |
| 79 | + parameter-name: RollUpBy |
| 80 | + - where: |
| 81 | + subject: Metric |
| 82 | + parameter-name: orderBy |
| 83 | + set: |
| 84 | + parameter-name: OrderBy |
| 85 | + - where: |
| 86 | + parameter-name: Metricnamespace |
| 87 | + set: |
| 88 | + parameter-name: MetricNamespace |
| 89 | + - where: |
| 90 | + parameter-name: Metricname |
| 91 | + set: |
| 92 | + parameter-name: MetricName |
| 93 | + # Fix breaking change |
| 94 | + - where: |
| 95 | + parameter-name: ResourceUri |
| 96 | + set: |
| 97 | + alias: ResourceId |
| 98 | + - where: |
| 99 | + parameter-name: Filter |
| 100 | + set: |
| 101 | + alias: MetricFilter |
| 102 | + - where: |
| 103 | + parameter-name: Aggregation |
| 104 | + set: |
| 105 | + alias: AggregationType |
| 106 | + - where: |
| 107 | + parameter-name: Interval |
| 108 | + set: |
| 109 | + alias: TimeGrain |
| 110 | + # Customize cmdlets |
| 111 | + - where: |
| 112 | + subject: Metric |
| 113 | + hide: true |
0 commit comments