-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AEM: initial change for Azure Enhanced Monitoring Extension for SAP (#41
) * initial code * copy code over * wip * fix a few lint errors * address review feedback * add code owner * fix lint error * revert unnecessary script change * fix an incorrect usage of get_models
- Loading branch information
1 parent
dbf5f18
commit d56c2c2
Showing
11 changed files
with
1,919 additions
and
1 deletion.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ | |
|
||
/src/eventhubs/ @v-ajnava | ||
|
||
/src/webapps/ @panchagnula | ||
/src/webapps/ @panchagnula | ||
|
||
/src/aem/ @yugangw-msft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
|
||
import azext_aem._help # pylint: disable=unused-import | ||
|
||
|
||
class AEMCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
aem_custom = CliCommandType( | ||
operations_tmpl='azext_aem.custom#{}') | ||
super(AEMCommandsLoader, self).__init__(cli_ctx=cli_ctx, | ||
custom_command_type=aem_custom) | ||
|
||
def load_command_table(self, _): | ||
with self.command_group('vm aem', min_api='2016-04-30-preview') as g: | ||
g.custom_command('set', 'set_aem') | ||
g.custom_command('delete', 'delete_aem') | ||
g.custom_command('verify', 'verify_aem') | ||
|
||
return self.command_table | ||
|
||
def load_arguments(self, _): | ||
# pylint: disable=line-too-long | ||
from knack.arguments import CLIArgumentType | ||
from azure.cli.core.commands.parameters import get_resource_name_completion_list | ||
name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME') | ||
existing_vm_name = CLIArgumentType(overrides=name_arg_type, | ||
configured_default='vm', | ||
help="The name of the Virtual Machine. You can configure the default using `az configure --defaults vm=<name>`", | ||
completer=get_resource_name_completion_list('Microsoft.Compute/virtualMachines'), id_part='name') | ||
|
||
with self.argument_context('vm aem') as c: | ||
c.argument('vm_name', existing_vm_name) | ||
c.argument('skip_storage_check', action='store_true', | ||
help='Disables the test for table content') | ||
c.argument('skip_storage_analytics', action='store_true', | ||
help='skip enabling analytics on storage accounts') | ||
c.argument('wait_time_in_minutes', type=int, | ||
help='Maximum minutes to wait for the storage metrics to be available') | ||
|
||
|
||
COMMAND_LOADER_CLS = AEMCommandsLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from knack.help_files import helps | ||
|
||
helps['vm aem'] = """ | ||
type: group | ||
short-summary: Manage Azure Enhanced Monitoring Extension for SAP | ||
""" | ||
|
||
helps['vm aem set'] = """ | ||
type: command | ||
short-summary: Configure Azure Enhanced Monitoring Extension | ||
long-summary: It can take up to 15 minutes for the monitoring data to appear in the SAP system | ||
""" | ||
|
||
helps['vm aem delete'] = """ | ||
type: command | ||
short-summary: Remove Azure Enhanced Monitoring Extension | ||
""" | ||
|
||
helps['vm aem verify'] = """ | ||
type: command | ||
short-summary: Verify Azure Enhanced Monitoring Extensions configured correctly | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"azext.minCliCoreVersion": "2.0.24" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- |
1,206 changes: 1,206 additions & 0 deletions
1,206
src/aem/azext_aem/tests/recordings/latest/test_vm_aem_configure.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) | ||
|
||
# pylint: disable=unused-argument,too-few-public-methods | ||
|
||
|
||
class VMAEM(ScenarioTest): | ||
|
||
@ResourceGroupPreparer() | ||
def test_vm_aem_configure(self, resource_group): | ||
self.kwargs.update({ | ||
'vm': 'vm1', | ||
}) | ||
self.cmd('vm create -g {rg} -n {vm} --image centos') | ||
self.cmd('vm aem set -g {rg} -n {vm}') | ||
self.cmd('vm aem verify -g {rg} -n {vm}') | ||
self.cmd('vm aem delete -g {rg} -n {vm}') | ||
self.cmd('vm aem verify -g {rg} -n {vm}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Azure CLI Enhanced Monitoring Extension # | ||
This is an extension to azure cli which provides commands to configure, verify and remove Azure Enhanced Monitoring Extension for SAP | ||
|
||
## How to use ## | ||
First, install the extension: | ||
``` | ||
az extension add --name aem | ||
``` | ||
|
||
Then, call it as you would any other az command: | ||
``` | ||
az vm aem set --resource-group rg --name vm1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[bdist_wheel] | ||
universal=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python | ||
|
||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from codecs import open | ||
from setuptools import setup, find_packages | ||
|
||
VERSION = "0.0.1" | ||
|
||
CLASSIFIERS = [ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: System Administrators', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'License :: OSI Approved :: MIT License', | ||
] | ||
|
||
DEPENDENCIES = [] | ||
|
||
setup( | ||
name='aem', | ||
version=VERSION, | ||
description='CLI Extension to managed Azure Enhanced Monitoring Extension for SAP', | ||
long_description='N/A', | ||
license='MIT', | ||
author='Yugang Wang', | ||
author_email='yugangw@microsoft.com', | ||
url='https://github.com/Azure/azure-cli-extensions', | ||
classifiers=CLASSIFIERS, | ||
package_data={'azext_aem': ['azext_metadata.json']}, | ||
packages=find_packages(exclude=["tests"]), | ||
install_requires=DEPENDENCIES | ||
) |