Skip to content

Commit d655862

Browse files
authored
[Application-insights] az monitor app-insights component: Add new command group favorite to support managing favorite (#7108)
* app-insights
1 parent 057f80c commit d655862

38 files changed

+6301
-800
lines changed

src/application-insights/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Release History
44
===============
55

6+
1.1.0
7+
++++++++++++++++++
8+
* `az monitor app-insights component`: Add new command group `favorite` to support managing favorite.
9+
* `az monitor app-insights component`: Add new command group `quotastatus` to support managing quotastatus.
10+
* `az monitor app-insights`: Add new command group `my-workbook` to support managing my-workbook.
11+
* `az monitor app-insights`: Add new command group `workbook revision` to support managing workbook revision.
12+
* `az monitor app-insights`: Add new command `migrate-to-new-pricing-model` to support migrating to new pricing model.
13+
614
1.0.0
715
++++++++++++++++++
816
* Migrate manual code to automatic code by aaz tool.

src/application-insights/azext_applicationinsights/aaz/latest/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
#
55
# Code generated by aaz-dev-tools
66
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+

src/application-insights/azext_applicationinsights/aaz/latest/monitor/app_insights/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
# flake8: noqa
1010

1111
from .__cmd_group import *
12+
from ._migrate_to_new_pricing_model import *
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command(
15+
"monitor app-insights migrate-to-new-pricing-model",
16+
)
17+
class MigrateToNewPricingModel(AAZCommand):
18+
"""Enterprise Agreement Customer opted to use new pricing model.
19+
20+
:example: Migrate to new pricing model
21+
az monitor app-insights migrate-to-new-pricing-model
22+
"""
23+
24+
_aaz_info = {
25+
"version": "2017-10-01",
26+
"resources": [
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.insights/migratetonewpricingmodel", "2017-10-01"],
28+
]
29+
}
30+
31+
def _handler(self, command_args):
32+
super()._handler(command_args)
33+
self._execute_operations()
34+
return None
35+
36+
_args_schema = None
37+
38+
@classmethod
39+
def _build_arguments_schema(cls, *args, **kwargs):
40+
if cls._args_schema is not None:
41+
return cls._args_schema
42+
cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
43+
44+
# define Arg Group ""
45+
return cls._args_schema
46+
47+
def _execute_operations(self):
48+
self.pre_operations()
49+
self.EASubscriptionMigrateToNewPricingModelPost(ctx=self.ctx)()
50+
self.post_operations()
51+
52+
@register_callback
53+
def pre_operations(self):
54+
pass
55+
56+
@register_callback
57+
def post_operations(self):
58+
pass
59+
60+
class EASubscriptionMigrateToNewPricingModelPost(AAZHttpOperation):
61+
CLIENT_TYPE = "MgmtClient"
62+
63+
def __call__(self, *args, **kwargs):
64+
request = self.make_request()
65+
session = self.client.send_request(request=request, stream=False, **kwargs)
66+
if session.http_response.status_code in [204]:
67+
return self.on_204(session)
68+
69+
return self.on_error(session.http_response)
70+
71+
@property
72+
def url(self):
73+
return self.client.format_url(
74+
"/subscriptions/{subscriptionId}/providers/microsoft.insights/migrateToNewPricingModel",
75+
**self.url_parameters
76+
)
77+
78+
@property
79+
def method(self):
80+
return "POST"
81+
82+
@property
83+
def error_format(self):
84+
return "ODataV4Format"
85+
86+
@property
87+
def url_parameters(self):
88+
parameters = {
89+
**self.serialize_url_param(
90+
"subscriptionId", self.ctx.subscription_id,
91+
required=True,
92+
),
93+
}
94+
return parameters
95+
96+
@property
97+
def query_parameters(self):
98+
parameters = {
99+
**self.serialize_query_param(
100+
"api-version", "2017-10-01",
101+
required=True,
102+
),
103+
}
104+
return parameters
105+
106+
def on_204(self, session):
107+
pass
108+
109+
110+
class _MigrateToNewPricingModelHelper:
111+
"""Helper class for MigrateToNewPricingModel"""
112+
113+
114+
__all__ = ["MigrateToNewPricingModel"]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command_group(
15+
"monitor app-insights component favorite",
16+
)
17+
class __CMDGroup(AAZCommandGroup):
18+
"""Manage component favorite
19+
"""
20+
pass
21+
22+
23+
__all__ = ["__CMDGroup"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from .__cmd_group import *
12+
from ._create import *
13+
from ._delete import *
14+
from ._list import *
15+
from ._show import *
16+
from ._update import *

0 commit comments

Comments
 (0)