-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Monitor] az monitor diagnostic-settings subscription: Support diagnositc settings for subscription #14157
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
Merged
mmyyrroonn
merged 10 commits into
Azure:dev
from
mmyyrroonn:fix-13692-support-diagnositc-settings-for-activity-log-export
Jul 6, 2020
Merged
[Monitor] az monitor diagnostic-settings subscription: Support diagnositc settings for subscription #14157
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3d7f092
bump version
ecdd0ee
in progress
852010b
finish draft version
3ffcdd9
testing
a94bb50
finish init test
16c76f0
finish version
b5729f1
rerun
1e8484e
fix linter
599191f
back
30e3e97
remove workaround
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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
38 changes: 38 additions & 0 deletions
38
...zure-cli/azure/cli/command_modules/monitor/operations/subscription_diagnostic_settings.py
This file contains hidden or 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,38 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| # pylint: disable=unused-argument, line-too-long | ||
| def create_subscription_diagnostic_settings(cmd, client, | ||
| name, logs, | ||
| location, | ||
| event_hub_name=None, | ||
| event_hub_auth_rule=None, | ||
| storage_account=None, | ||
| service_bus_rule=None, | ||
| workspace=None): | ||
| from azure.mgmt.monitor.models import SubscriptionDiagnosticSettingsResource | ||
| from azure.cli.core.commands.client_factory import get_subscription_id | ||
| parameters = SubscriptionDiagnosticSettingsResource(storage_account_id=storage_account, | ||
| workspace_id=workspace, | ||
| event_hub_name=event_hub_name, | ||
| event_hub_authorization_rule_id=event_hub_auth_rule, | ||
| service_bus_rule_id=service_bus_rule, | ||
| logs=logs, | ||
| location=location) | ||
| return client.create_or_update(subscription_id=get_subscription_id(cmd.cli_ctx), parameters=parameters, name=name) | ||
|
|
||
|
|
||
| def update_subscription_diagnostic_settings(cmd, instance, event_hub_name=None, logs=None, | ||
| event_hub_auth_rule=None, storage_account=None, | ||
| service_bus_rule=None, workspace=None): | ||
| with cmd.update_context(instance) as c: | ||
| c.set_param('storage_account_id', storage_account) | ||
| c.set_param('workspace_id', workspace) | ||
| c.set_param('event_hub_name', event_hub_name) | ||
| c.set_param('event_hub_authorization_rule_id', event_hub_auth_rule) | ||
| c.set_param('service_bus_rule_id', service_bus_rule) | ||
| c.set_param('logs', logs) | ||
| return instance |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.