Skip to content

Commit dcc34c1

Browse files
committed
feature Metric management plane migrate to autorest
1 parent 80267c5 commit dcc34c1

28 files changed

+2567
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@{
2+
GUID = '3c8bd492-2949-4471-a98c-6dee77ee7f73'
3+
RootModule = './Az.Metric.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Metric cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Metric.private.dll'
13+
FormatsToProcess = './Az.Metric.format.ps1xml'
14+
FunctionsToExport = 'Get-AzMetric', 'Get-AzMetricDefinition', 'New-AzMetricFilter'
15+
PrivateData = @{
16+
PSData = @{
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Metric'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
23+
}

src/Monitor/Metric.Autorest/README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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

Comments
 (0)