Skip to content
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

[Monitor] Fix activity-log list issues. #7525

Merged
merged 2 commits into from
Oct 18, 2018
Merged

[Monitor] Fix activity-log list issues. #7525

merged 2 commits into from
Oct 18, 2018

Conversation

tjprescott
Copy link
Member

@tjprescott tjprescott commented Oct 9, 2018

Fix #5608. Fix #4885.
Closes #6196. Closes #6198.

  • Allow listing all events at the subscription level.
  • Added --offset parameter to more easily create time queries.
  • Improved validation for --start-time and --end-time to use wider range of ISO8601 formats and more user-friendly datetime formats.
  • Added --namespace as alias for deprecated option --resource-provider.
  • Deprecated --filters because no values other than those with strongly-typed options are supported by the service.

cc/ @JasonRShaver


This checklist is used to make sure that common guidelines for a pull request are followed.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@tjprescott tjprescott added the Monitor az monitor label Oct 9, 2018
@tjprescott tjprescott added this to the Sprint 47 milestone Oct 9, 2018
Copy link
Contributor

@adewaleo adewaleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some comments.

the start time will be calculated by subtracting the offset. If --start-time and --end-time are
provided, then --offset will be ignored.
examples:
- name: List all events from July 1st, looking forward one week.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add an example using the --caller and --namespace parameters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it doesn't contribute to understanding and just clutters the help screen.

c.argument('correlation_id')
c.argument('caller')
c.argument('resource_group')
c.argument('resource_group', resource_group_name_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because the global alias is for resource_group_name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if this extra argument registration was necessary given the CLI would automatically surface the resource_group parameter.

Thanks for clarifying.

if match_len != tuple([0, len(value)]):
raise ValueError
# simply return value if a valid ISO8601 string is supplied
if match.regs[1] != tuple([-1, -1]) and match.regs[5] != tuple([-1, -1]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: It seems like match.regs is undocumented and might be deprecated in the future.

@tjprescott tjprescott merged commit e0b46a9 into Azure:dev Oct 18, 2018
@tjprescott tjprescott deleted the ActivityLogTime branch October 18, 2018 16:25
jaysterp added a commit to AzureCR/azure-cli that referenced this pull request Oct 25, 2018
* Progress (Azure#7558)

* update knack 0.4.4 (Azure#7567)

* Update CODEOWNERS (Azure#7571)

* Add table for exit codes (Azure#7572)

* Updated adls version to 0.0.34 (Azure#7570)

* Updated adls version to 0.0.33

* Updated version

* Update version

* Downgrade to 0.0.32 due to test failures

* Updated test recordings with new version and updated to version 0.0.34 again

* Updated History.rst

* Merge CLI 2.0.48 hotfix to dev and bump versions (Azure#7590)

* Homebrew hotfix.

* CI issue?

* make scrubbed over value valid base64 (Azure#7592)

* Graph: support add/remove/list owners on app, sp, and group (Azure#7578)

* Container Instance: Updating VNET workflow (Azure#7517)

* Adding vnet-resource-group

* fixing wording for more clear content

* Removing vnet-resource-group

* allow passing in vnet name or id

* updating container module version

* adding wording change for the LRP in container warning.

* reverting version back to current version

* Adding private option for --ip-address

* updating tests for new parameters

* updating tests recordings

* Removing the ability to create VNET by passing the resource ID

* adding --vnet-name back for backwards compatability

* Fixing based on feedback

* Bumping the version for CItests

* updating container instance sdk version

* changing casing and removing existance check

* fixing no image error validation

* Fix CI. Remove autopep8 dependency (Azure#7597)

* Update tools setup.

* Remove autopep8

* Iot Central Added Display Name and Template Parameters for App Create (Azure#7518)

* [Storage] allow deletion of containers with immutability policy after service bug fix (Azure#7569)

* delete container to custom command

* finished up commands

* added test

* history and pep8

* linter, static

* new recording after scrubbing fix

* comment typo

* vmss: avoid producing useless stroage accounts with unmanaegd scaleset (Azure#7601)

* [Monitor] Fix `activity-log list` issues. (Azure#7525)

* Fix Azure#5608. Fix Azure#4885.

* Update Metric command.

* Container Instance: Role Assignment for System Assigned MSI (Azure#7577)

* adding deployment based for resources

* changing to sdk calls for role assignment

* Fixing naming problem causing authorization client to fail

* Fixing formatting errors

* fixing differnt return statemnet errors

* adding tests for the --scope parameter

* fixing conflicts in recordings

* fixing conflicts and rerecording tests

* removing whitespace

* making non predictble test live only

* Fixing blank lines

* allow role assignment for --no-wait aswell

* removed unused imports

* CLI now prints extension messages. E.g. This extension is in preview. The behavior of this command has been altered by the following extension: storage-preview (Azure#7606)

* Removing Warnings for Cloudshell Proxy (Azure#7605)

* removing warnings for cloudshell proxy

* updating code owners for the container modules

* Updating how env var is accessed

* fixing formatting error in string message

* removing unused import

* Bump versions for next CLI release (Azure#7610)

* AAD Graph: support grant/list app permissions(Azure#7611)

Contributed by: @shanepeckham
Payload details: https://blogs.msdn.microsoft.com/arsen/2017/07/30/azure-ad-how-to-create-oauth2permissiongrant-using-graph-api-grant-permissions-and-consent-for-application/

* Fixes Azure#7596. (Azure#7620)

* Retry webbrowser.open() after a TypeError (Azure#7542)

* [Monitor] Metric alerts - allow special characters in metric name (Azure#7623)

* Fixes Azure#7598.

* Add test.

* Closes Azure#7545.

* moved interactive events to core (Azure#7632)

* Fixed bug where --no-wait option causes vm resize to crash. (Azure#7627)

* Fixed bug where --no-wait option causes vm resize to crash.

* Bump up VM version number

* Update rdbms help examples text from Gen4 to Gen5 (Azure#7642)

* Update rdbms help examples text from Gen4 to Gen5

* Fix version

* Fix public-ip create. (Azure#7638)

* image create now accepts a storage-sku.  (Azure#7614)

* image create now accepts a storage-sku. Unused when source is a VM due to service side issue. Also updated help text and made some changes to some model imports.

* Updated storage-sku help parameter

* Fixed bug introduced by using get_models. For profiles that don't have StorageAccountTypes defined define the possible storage-sku values.

* History changes.

* Bumped up VM version number.

removed extra newline in History.rst

* Added test coverage for --storage-sku

* Comment explaining else statement in vm/_params.py

* Modified  test_vm_managed_disk

* Addressed pep8 warnings.

* ACR: Add Pull Request Event to Task Source Trigger (Azure#7526)

* initial work on the PR trigger

* task create and update with PR trigger

* use one flag to enable commit and pr trigger events

* nit fixes

* Two event flags and only support one source trigger per task

* PR fixes

* allow empty event list when disabling all trigger events

* format fix

* do not clear event list in update, instead status disabled

* update task table

* nit fix

* bump cli event version

* nit fixes

* update ACR sdk version

* version fix

* update appservice version

* pylint fixes

* pylint fixes

* nit

* pylint fix

* respond to PR comments

* change from null to empty check

* ad: clarify the confusion between displayName and service principal name (Azure#7651)

* [setup]: windows installer improvement (Azure#7633)

* revert to desktop python

* change before do model file concat

* add trimmer

* revert an unrelated change

* incorporate model file trimmer

* revert a few unnecessary change

* lint fix

* remove an irrelevant command file

* backup python to storage accounts

* remove irrelevant comment

* simplify

* Closes Azure#7536 (Azure#7626)

* pin flake8 to 3.5.0 (Azure#7663)

* pin flake8 to 3.5.0

* wrong version

* setup: add back the workaround of pinning pycparser==2.18 (Azure#7662)

* Fixed bug with update --remove --ids (Azure#7643)

* Fixed bug where if update --remove is called with --ids, the correct params aren't passed in subsequent iterations of the update command.

* Fixed Pep8 issues

* Fixed bug by changing generic update logic instead of copying CLI params.

* Move extension logic into core (Azure#7653)

* moved previous 'extensions' event handling logic

* moved all extension management utility to core

* fix ref

static checking

fix test import

* core package

* fix reference

* renamed to register_global_transforms

* Update to latest Advisor SDK (Azure#7576)

* Updates for GA release.

* Addressing PR feedback:
- Removed 'recommendation generate' command and added a '--refresh' option to 'recommendation list' instead.
- Renamed 'configuration get' to 'configuration list'.
- Renamed 'configuration set' to 'configuration update'.
- Test recording updates.

* Update history with details of the changes.

* Adding generic update and show command.

* Addressing review feedback.

* Update SDK package version.

* Addressing review feedback.

* Fix indentation errors.

* Add support for ids.

* Updates for GA release.

* Addressing PR feedback:
- Removed 'recommendation generate' command and added a '--refresh' option to 'recommendation list' instead.
- Renamed 'configuration get' to 'configuration list'.
- Renamed 'configuration set' to 'configuration update'.
- Test recording updates.

* Update history with details of the changes.

* Adding generic update and show command.

* Addressing review feedback.

* Update SDK package version.

* Addressing review feedback.

* Fix indentation errors.

* Add support for ids.

* Fix test failures.

* Update to latest SDK version

* Update history

* Reference new package version

* Fixed non-working example for mysql db create (Azure#7557)

* Update _help.py

Fixed non-working example with guidance from 
https://docs.microsoft.com/en-us/azure/mysql/quickstart-create-mysql-server-database-using-azure-cli

* Update HISTORY.rst

* Update setup.py

* Fix placeholder

* Fix Azure#7659 (Azure#7668)
@meiliumeiliu
Copy link

meiliumeiliu commented Nov 28, 2018

Allow listing all events at the subscription level.
I have update azure CLI to (2.0.51) and use cmd " /root/bin/az monitor activity-log list --start-time 2018-09-01 --offset 90d " to try to get all activity-log events. But it can't get Microsoft.ServiceHealth events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants