Skip to content

Commit 16fa202

Browse files
committed
resolve response with no mi
1 parent 5f35698 commit 16fa202

2 files changed

Lines changed: 52 additions & 1 deletion

File tree

src/azure-cli/azure/cli/command_modules/monitor/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def load_command_table(self, _):
9696
self.command_table['monitor action-group test-notifications create'] = \
9797
ActionGroupTestNotificationCreate(loader=self, table_transformer=action_group_list_table)
9898

99-
from .aaz.latest.monitor.action_group.identity import Assign as AGIdentityAssign, Remove as AGIdentityRemove, Show as AGIdentityShow
99+
from .operations.action_groups_identity import AGIdentityAssign, AGIdentityRemove, AGIdentityShow
100100
self.command_table['monitor action-group identity assign'] = AGIdentityAssign(loader=self)
101101
self.command_table['monitor action-group identity remove'] = AGIdentityRemove(loader=self)
102102
self.command_table['monitor action-group identity show'] = AGIdentityShow(loader=self)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
# pylint: disable=protected-access
6+
from ..aaz.latest.monitor.action_group.identity import Assign as _AGIdentityAssign, \
7+
Remove as _AGIdentityRemove, Show as _AGIdentityShow
8+
9+
10+
class AGIdentityAssign(_AGIdentityAssign):
11+
def _execute_operations(self):
12+
self.pre_operations()
13+
self.ActionGroupsGet(ctx=self.ctx)()
14+
self.pre_instance_update(self.ctx.selectors.subresource.get())
15+
self.InstanceUpdateByJson(ctx=self.ctx)()
16+
self.post_instance_update(self.ctx.selectors.subresource.get())
17+
self.ActionGroupsCreateOrUpdate(ctx=self.ctx)()
18+
self.post_operations()
19+
20+
def _output(self, *args, **kwargs):
21+
result = self.deserialize_output(self.ctx.selectors.subresource.get(), client_flatten=True)
22+
return result
23+
24+
class InstanceUpdateByJson(_AGIdentityAssign.InstanceUpdateByJson):
25+
def __call__(self, *args, **kwargs):
26+
self._update_instance(self.ctx.selectors.subresource.get())
27+
28+
29+
class AGIdentityRemove(_AGIdentityRemove):
30+
def _execute_operations(self):
31+
self.pre_operations()
32+
self.ActionGroupsGet(ctx=self.ctx)()
33+
self.pre_instance_update(self.ctx.selectors.subresource.get())
34+
self.InstanceUpdateByJson(ctx=self.ctx)()
35+
self.post_instance_update(self.ctx.selectors.subresource.get())
36+
self.ActionGroupsCreateOrUpdate(ctx=self.ctx)()
37+
self.post_operations()
38+
39+
def _output(self, *args, **kwargs):
40+
result = self.deserialize_output(self.ctx.selectors.subresource.get(), client_flatten=True)
41+
return result
42+
43+
class InstanceUpdateByJson(_AGIdentityRemove.InstanceUpdateByJson):
44+
def __call__(self, *args, **kwargs):
45+
self._update_instance(self.ctx.selectors.subresource.get())
46+
47+
48+
class AGIdentityShow(_AGIdentityShow):
49+
def _output(self, *args, **kwargs):
50+
result = self.deserialize_output(self.ctx.selectors.subresource.get(), client_flatten=True)
51+
return result

0 commit comments

Comments
 (0)