|
| 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