-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AEM: initial change for Azure Enhanced Monitoring Extension for SAP #41
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9460f6e
initial code
yugangw-msft b9a6a01
copy code over
yugangw-msft f1ca0d1
wip
yugangw-msft 79807fe
fix a few lint errors
yugangw-msft ac8267a
address review feedback
yugangw-msft 0eef5ae
add code owner
yugangw-msft 2be4583
fix lint error
yugangw-msft 1cf713d
revert unnecessary script change
yugangw-msft f3c712f
fix an incorrect usage of get_models
yugangw-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set min profile here like with other command modules so it doesn't appear on the stack profile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I put a comment in the code to do this, but looks like i still forgot it