From edeec2ed52b5921356c57af43a6fcb3043e9d398 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Wed, 4 Aug 2021 16:43:25 +0800 Subject: [PATCH 1/9] update SDK --- .../azure_mgmt_scheduled_query/__init__.py | 20 +- .../_configuration.py | 81 +- .../_monitor_client.py | 49 -- .../_monitor_management_client.py | 88 +++ .../{version.py => _version.py} | 10 +- .../aio/__init__.py | 10 + .../aio/_configuration.py | 67 ++ .../aio/_monitor_management_client.py | 81 ++ .../aio/operations/__init__.py | 13 + .../_scheduled_query_rules_operations.py | 433 +++++++++++ .../models/__init__.py | 70 +- .../models/_models.py | 669 +++++++++------- .../models/_models_py3.py | 732 +++++++++++------- .../models/_monitor_client_enums.py | 36 - .../_monitor_management_client_enums.py | 81 ++ .../models/_paged_models.py | 27 - .../operations/__init__.py | 7 +- .../_scheduled_query_rules_operations.py | 538 ++++++------- 18 files changed, 1979 insertions(+), 1033 deletions(-) delete mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_client.py create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_management_client.py rename src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/{version.py => _version.py} (82%) create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/__init__.py create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_configuration.py create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_monitor_management_client.py create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/__init__.py create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/_scheduled_query_rules_operations.py delete mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_client_enums.py create mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py delete mode 100644 src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_paged_models.py diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/__init__.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/__init__.py index 940dc046983..d8247951009 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/__init__.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/__init__.py @@ -1,19 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import MonitorClientConfiguration -from ._monitor_client import MonitorClient -__all__ = ['MonitorClient', 'MonitorClientConfiguration'] - -from .version import VERSION +from ._monitor_management_client import MonitorManagementClient +from ._version import VERSION __version__ = VERSION +__all__ = ['MonitorManagementClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_configuration.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_configuration.py index b3de8cc8b8f..7ce16fb9f28 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_configuration.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_configuration.py @@ -1,48 +1,71 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class MonitorManagementClientConfiguration(Configuration): + """Configuration for MonitorManagementClient. -class MonitorClientConfiguration(AzureConfiguration): - """Configuration for MonitorClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Azure subscription Id. + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. :type subscription_id: str - :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(MonitorClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True + super(MonitorManagementClientConfiguration, self).__init__(**kwargs) - self.add_user_agent('azure-mgmt-monitor/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-02-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_client.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_client.py deleted file mode 100644 index 9126e1c0d2c..00000000000 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_client.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer - -from ._configuration import MonitorClientConfiguration -from .operations import ScheduledQueryRulesOperations -from . import models - - -class MonitorClient(SDKClient): - """Monitor Management Client - - :ivar config: Configuration for client. - :vartype config: MonitorClientConfiguration - - :ivar scheduled_query_rules: ScheduledQueryRules operations - :vartype scheduled_query_rules: azure.mgmt.monitor.v2020_05_01_preview.operations.ScheduledQueryRulesOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Azure subscription Id. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = MonitorClientConfiguration(credentials, subscription_id, base_url) - super(MonitorClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-05-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.scheduled_query_rules = ScheduledQueryRulesOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_management_client.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_management_client.py new file mode 100644 index 00000000000..5dbe0e76d8d --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_monitor_management_client.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import MonitorManagementClientConfiguration +from .operations import ScheduledQueryRulesOperations +from . import models + + +class MonitorManagementClient(object): + """Monitor Management Client. + + :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations + :vartype scheduled_query_rules: $(python-base-namespace).v2021_02_preview.operations.ScheduledQueryRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.scheduled_query_rules = ScheduledQueryRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MonitorManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/version.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_version.py similarity index 82% rename from src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/version.py rename to src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_version.py index fc729cd3194..e5754a47ce6 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/version.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/_version.py @@ -1,13 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2020-05-01-preview" - +VERSION = "1.0.0b1" diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/__init__.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/__init__.py new file mode 100644 index 00000000000..96ce9b45c05 --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._monitor_management_client import MonitorManagementClient +__all__ = ['MonitorManagementClient'] diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_configuration.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_configuration.py new file mode 100644 index 00000000000..0e2854d9ff4 --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class MonitorManagementClientConfiguration(Configuration): + """Configuration for MonitorManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_monitor_management_client.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_monitor_management_client.py new file mode 100644 index 00000000000..78e116427b2 --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/_monitor_management_client.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import MonitorManagementClientConfiguration +from .operations import ScheduledQueryRulesOperations +from .. import models + + +class MonitorManagementClient(object): + """Monitor Management Client. + + :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations + :vartype scheduled_query_rules: $(python-base-namespace).v2021_02_preview.aio.operations.ScheduledQueryRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.scheduled_query_rules = ScheduledQueryRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MonitorManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/__init__.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/__init__.py new file mode 100644 index 00000000000..f677702ed3d --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._scheduled_query_rules_operations import ScheduledQueryRulesOperations + +__all__ = [ + 'ScheduledQueryRulesOperations', +] diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/_scheduled_query_rules_operations.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/_scheduled_query_rules_operations.py new file mode 100644 index 00000000000..8a75626115d --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/aio/operations/_scheduled_query_rules_operations.py @@ -0,0 +1,433 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ScheduledQueryRulesOperations: + """ScheduledQueryRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2021_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ScheduledQueryRuleResourceCollection"]: + """Retrieve a scheduled query rule definitions in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ScheduledQueryRuleResourceCollection"]: + """Retrieve scheduled query rule definitions in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore + + async def get( + self, + resource_group_name: str, + rule_name: str, + **kwargs: Any + ) -> "_models.ScheduledQueryRuleResource": + """Retrieve an scheduled query rule definition. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + rule_name: str, + parameters: "_models.ScheduledQueryRuleResource", + **kwargs: Any + ) -> "_models.ScheduledQueryRuleResource": + """Creates or updates a scheduled query rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to create or update. + :type parameters: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + rule_name: str, + parameters: "_models.ScheduledQueryRuleResourcePatch", + **kwargs: Any + ) -> "_models.ScheduledQueryRuleResource": + """Update a scheduled query rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to update. + :type parameters: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResourcePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + rule_name: str, + **kwargs: Any + ) -> None: + """Deletes a scheduled query rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/__init__.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/__init__.py index cfb55074177..fccf4920f88 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/__init__.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/__init__.py @@ -1,68 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: - from ._models_py3 import Action - from ._models_py3 import AzureEntityResource + from ._models_py3 import Actions from ._models_py3 import Condition from ._models_py3 import ConditionFailingPeriods from ._models_py3 import Dimension from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorContract, ErrorContractException + from ._models_py3 import ErrorContract from ._models_py3 import ErrorResponse - from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import ScheduledQueryRuleCriteria from ._models_py3 import ScheduledQueryRuleResource + from ._models_py3 import ScheduledQueryRuleResourceCollection from ._models_py3 import ScheduledQueryRuleResourcePatch + from ._models_py3 import SystemData from ._models_py3 import TrackedResource except (SyntaxError, ImportError): - from ._models import Action - from ._models import AzureEntityResource - from ._models import Condition - from ._models import ConditionFailingPeriods - from ._models import Dimension - from ._models import ErrorAdditionalInfo - from ._models import ErrorContract, ErrorContractException - from ._models import ErrorResponse - from ._models import ProxyResource - from ._models import Resource - from ._models import ScheduledQueryRuleCriteria - from ._models import ScheduledQueryRuleResource - from ._models import ScheduledQueryRuleResourcePatch - from ._models import TrackedResource -from ._paged_models import ScheduledQueryRuleResourcePaged -from ._monitor_client_enums import ( - TimeAggregation, - DimensionOperator, + from ._models import Actions # type: ignore + from ._models import Condition # type: ignore + from ._models import ConditionFailingPeriods # type: ignore + from ._models import Dimension # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorContract # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Resource # type: ignore + from ._models import ScheduledQueryRuleCriteria # type: ignore + from ._models import ScheduledQueryRuleResource # type: ignore + from ._models import ScheduledQueryRuleResourceCollection # type: ignore + from ._models import ScheduledQueryRuleResourcePatch # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackedResource # type: ignore + +from ._monitor_management_client_enums import ( + AlertSeverity, ConditionOperator, + CreatedByType, + DimensionOperator, + Kind, + TimeAggregation, ) __all__ = [ - 'Action', - 'AzureEntityResource', + 'Actions', 'Condition', 'ConditionFailingPeriods', 'Dimension', 'ErrorAdditionalInfo', - 'ErrorContract', 'ErrorContractException', + 'ErrorContract', 'ErrorResponse', - 'ProxyResource', 'Resource', 'ScheduledQueryRuleCriteria', 'ScheduledQueryRuleResource', + 'ScheduledQueryRuleResourceCollection', 'ScheduledQueryRuleResourcePatch', + 'SystemData', 'TrackedResource', - 'ScheduledQueryRuleResourcePaged', - 'TimeAggregation', - 'DimensionOperator', + 'AlertSeverity', 'ConditionOperator', + 'CreatedByType', + 'DimensionOperator', + 'Kind', + 'TimeAggregation', ] diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py index c5e78eef7c5..24620517cf2 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py @@ -1,160 +1,71 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class Action(Model): +class Actions(msrest.serialization.Model): """Actions to invoke when the alert fires. - :param action_group_id: Action Group resource Id to invoke when the alert - fires. - :type action_group_id: str - :param web_hook_properties: The properties of a webhook object. - :type web_hook_properties: dict[str, str] + :param action_groups: Action Group resource Ids to invoke when the alert fires. + :type action_groups: list[str] + :param custom_properties: The properties of an alert payload. + :type custom_properties: dict[str, str] """ _attribute_map = { - 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, - 'web_hook_properties': {'key': 'webHookProperties', 'type': '{str}'}, + 'action_groups': {'key': 'actionGroups', 'type': '[str]'}, + 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, } - def __init__(self, **kwargs): - super(Action, self).__init__(**kwargs) - self.action_group_id = kwargs.get('action_group_id', None) - self.web_hook_properties = kwargs.get('web_hook_properties', None) + def __init__( + self, + **kwargs + ): + super(Actions, self).__init__(**kwargs) + self.action_groups = kwargs.get('action_groups', None) + self.custom_properties = kwargs.get('custom_properties', None) -class Resource(Model): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class Condition(Model): +class Condition(msrest.serialization.Model): """A condition of the scheduled query rule. - All required parameters must be populated in order to send to Azure. - - :param query: Log query alert + :param query: Log query alert. :type query: str - :param time_aggregation: Required. Aggregation type. Possible values - include: 'Count', 'Average', 'Minimum', 'Maximum', 'Total' + :param time_aggregation: Aggregation type. Relevant and required only for rules of the kind + LogAlert. Possible values include: "Count", "Average", "Minimum", "Maximum", "Total". :type time_aggregation: str or - ~azure.mgmt.monitor.v2020_05_01_preview.models.TimeAggregation - :param metric_measure_column: The column containing the metric measure - number. + ~$(python-base-namespace).v2021_02_preview.models.TimeAggregation + :param metric_measure_column: The column containing the metric measure number. Relevant only + for rules of the kind LogAlert. :type metric_measure_column: str - :param resource_id_column: The column containing the resource id. The - content of the column must be a uri formatted as resource id + :param resource_id_column: The column containing the resource id. The content of the column + must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. :type resource_id_column: str - :param dimensions: List of Dimensions conditions - :type dimensions: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.Dimension] - :param operator: Required. The criteria operator. Possible values include: - 'Equals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', - 'LessThanOrEqual' - :type operator: str or - ~azure.mgmt.monitor.v2020_05_01_preview.models.ConditionOperator - :param threshold: Required. the criteria threshold value that activates - the alert. - :type threshold: int - :param failing_periods: The minimum number of violations required within - the selected lookback time window required to raise an alert. + :param dimensions: List of Dimensions conditions. + :type dimensions: list[~$(python-base-namespace).v2021_02_preview.models.Dimension] + :param operator: The criteria operator. Relevant and required only for rules of the kind + LogAlert. Possible values include: "Equals", "GreaterThan", "GreaterThanOrEqual", "LessThan", + "LessThanOrEqual". + :type operator: str or ~$(python-base-namespace).v2021_02_preview.models.ConditionOperator + :param threshold: the criteria threshold value that activates the alert. Relevant and required + only for rules of the kind LogAlert. + :type threshold: float + :param failing_periods: The minimum number of violations required within the selected lookback + time window required to raise an alert. Relevant only for rules of the kind LogAlert. :type failing_periods: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ConditionFailingPeriods + ~$(python-base-namespace).v2021_02_preview.models.ConditionFailingPeriods + :param metric_name: The name of the metric to be sent. Relevant and required only for rules of + the kind LogToMetric. + :type metric_name: str """ - _validation = { - 'time_aggregation': {'required': True}, - 'operator': {'required': True}, - 'threshold': {'required': True}, - } - _attribute_map = { 'query': {'key': 'query', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, @@ -162,11 +73,15 @@ class Condition(Model): 'resource_id_column': {'key': 'resourceIdColumn', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, 'operator': {'key': 'operator', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'int'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, 'failing_periods': {'key': 'failingPeriods', 'type': 'ConditionFailingPeriods'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Condition, self).__init__(**kwargs) self.query = kwargs.get('query', None) self.time_aggregation = kwargs.get('time_aggregation', None) @@ -176,46 +91,46 @@ def __init__(self, **kwargs): self.operator = kwargs.get('operator', None) self.threshold = kwargs.get('threshold', None) self.failing_periods = kwargs.get('failing_periods', None) + self.metric_name = kwargs.get('metric_name', None) -class ConditionFailingPeriods(Model): - """The minimum number of violations required within the selected lookback time - window required to raise an alert. +class ConditionFailingPeriods(msrest.serialization.Model): + """The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert. - :param number_of_evaluation_periods: The number of aggregated lookback - points. The lookback time window is calculated based on the aggregation - granularity (windowSize) and the selected number of aggregated points. - Default value is 1 - :type number_of_evaluation_periods: int - :param min_failing_periods_to_alert: The number of violations to trigger - an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default - value is 1 - :type min_failing_periods_to_alert: int + :param number_of_evaluation_periods: The number of aggregated lookback points. The lookback + time window is calculated based on the aggregation granularity (windowSize) and the selected + number of aggregated points. Default value is 1. + :type number_of_evaluation_periods: long + :param min_failing_periods_to_alert: The number of violations to trigger an alert. Should be + smaller or equal to numberOfEvaluationPeriods. Default value is 1. + :type min_failing_periods_to_alert: long """ _attribute_map = { - 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'int'}, - 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'int'}, + 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'long'}, + 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'long'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ConditionFailingPeriods, self).__init__(**kwargs) - self.number_of_evaluation_periods = kwargs.get('number_of_evaluation_periods', None) - self.min_failing_periods_to_alert = kwargs.get('min_failing_periods_to_alert', None) + self.number_of_evaluation_periods = kwargs.get('number_of_evaluation_periods', 1) + self.min_failing_periods_to_alert = kwargs.get('min_failing_periods_to_alert', 1) -class Dimension(Model): +class Dimension(msrest.serialization.Model): """Dimension splitting and filtering definition. All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the dimension + :param name: Required. Name of the dimension. :type name: str - :param operator: Required. Operator for dimension values. Possible values - include: 'Include', 'Exclude' - :type operator: str or - ~azure.mgmt.monitor.v2020_05_01_preview.models.DimensionOperator - :param values: Required. List of dimension values + :param operator: Required. Operator for dimension values. Possible values include: "Include", + "Exclude". + :type operator: str or ~$(python-base-namespace).v2021_02_preview.models.DimensionOperator + :param values: Required. List of dimension values. :type values: list[str] """ @@ -231,23 +146,25 @@ class Dimension(Model): 'values': {'key': 'values', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.operator = kwargs.get('operator', None) - self.values = kwargs.get('values', None) + self.name = kwargs['name'] + self.operator = kwargs['operator'] + self.values = kwargs['values'] -class ErrorAdditionalInfo(Model): +class ErrorAdditionalInfo(msrest.serialization.Model): """The resource management error additional info. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -260,45 +177,38 @@ class ErrorAdditionalInfo(Model): 'info': {'key': 'info', 'type': 'object'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None -class ErrorContract(Model): +class ErrorContract(msrest.serialization.Model): """Describes the format of Error response. :param error: The error details. - :type error: ~azure.mgmt.monitor.v2020_05_01_preview.models.ErrorResponse + :type error: ~$(python-base-namespace).v2021_02_preview.models.ErrorResponse """ _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorResponse'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ErrorContract, self).__init__(**kwargs) self.error = kwargs.get('error', None) -class ErrorContractException(HttpOperationError): - """Server responsed with exception of type: 'ErrorContract'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorContractException, self).__init__(deserialize, response, 'ErrorContract', *args) - +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). -class ErrorResponse(Model): - """The resource management error response. - - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar code: The error code. :vartype code: str @@ -307,11 +217,10 @@ class ErrorResponse(Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.ErrorResponse] + :vartype details: list[~$(python-base-namespace).v2021_02_preview.models.ErrorResponse] :ivar additional_info: The error additional info. :vartype additional_info: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.ErrorAdditionalInfo] + list[~$(python-base-namespace).v2021_02_preview.models.ErrorAdditionalInfo] """ _validation = { @@ -330,7 +239,10 @@ class ErrorResponse(Model): 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None @@ -339,20 +251,18 @@ def __init__(self, **kwargs): self.additional_info = None -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: The name of the resource + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -368,47 +278,53 @@ class ProxyResource(Resource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): - super(ProxyResource, self).__init__(**kwargs) + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class ScheduledQueryRuleCriteria(Model): +class ScheduledQueryRuleCriteria(msrest.serialization.Model): """The rule criteria that defines the conditions of the scheduled query rule. - :param all_of: A list of conditions to evaluate against the specified - scopes - :type all_of: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.Condition] + :param all_of: A list of conditions to evaluate against the specified scopes. + :type all_of: list[~$(python-base-namespace).v2021_02_preview.models.Condition] """ _attribute_map = { 'all_of': {'key': 'allOf', 'type': '[Condition]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduledQueryRuleCriteria, self).__init__(**kwargs) self.all_of = kwargs.get('all_of', None) class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: The name of the resource + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives. :type location: str """ @@ -427,65 +343,97 @@ class TrackedResource(Resource): 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(TrackedResource, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) + self.location = kwargs['location'] class ScheduledQueryRuleResource(TrackedResource): """The scheduled query rule resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: The name of the resource + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives. :type location: str + :param kind: Indicates the type of scheduled query rule. The default is LogAlert. Possible + values include: "LogAlert", "LogToMetric". + :type kind: str or ~$(python-base-namespace).v2021_02_preview.models.Kind + :ivar etag: The etag field is *not* required. If it is provided in the response body, it must + also be provided as a header per the normal etag convention. Entity tags are used for + comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in + the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range + (section 14.27) header fields. + :vartype etag: str + :ivar system_data: SystemData of ScheduledQueryRule. + :vartype system_data: ~$(python-base-namespace).v2021_02_preview.models.SystemData + :ivar created_with_api_version: The api-version used when creating this alert rule. + :vartype created_with_api_version: str + :ivar is_legacy_log_analytics_rule: True if alert rule is legacy Log Analytic rule. + :vartype is_legacy_log_analytics_rule: bool :param description: The description of the scheduled query rule. :type description: str - :param severity: Severity of the alert. Should be an integer between - [0-4]. Value of 0 is severest - :type severity: int - :param enabled: The flag which indicates whether this scheduled query rule - is enabled. Value should be true or false + :param display_name: The display name of the alert rule. + :type display_name: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Relevant and required only for rules of the kind LogAlert. Possible values include: + 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2021_02_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. :type enabled: bool - :param scopes: The list of resource id's that this scheduled query rule is - scoped to. + :param scopes: The list of resource id's that this scheduled query rule is scoped to. :type scopes: list[str] - :param evaluation_frequency: How often the scheduled query rule is - evaluated represented in ISO 8601 duration format. - :type evaluation_frequency: timedelta - :param window_size: The period of time (in ISO 8601 duration format) on - which the Alert query will be executed (bin size). - :type window_size: timedelta - :param target_resource_types: List of resource type of the target - resource(s) on which the alert is created/updated. For example if the - scope is a resource group and targetResourceTypes is - Microsoft.Compute/virtualMachines, then a different alert will be fired - for each virtual machine in the resource group which meet the alert - criteria + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. Relevant and required only for rules of the kind LogAlert. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). Relevant and required only for rules of the kind LogAlert. + :type window_size: ~datetime.timedelta + :param override_query_time_range: If specified then overrides the query time range (default is + WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + :type override_query_time_range: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. Relevant only for rules of the + kind LogAlert. :type target_resource_types: list[str] - :param criteria: The rule criteria that defines the conditions of the - scheduled query rule. - :type criteria: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleCriteria - :param mute_actions_duration: Mute actions for the chosen period of time - (in ISO 8601 duration format) after the alert is fired. - :type mute_actions_duration: timedelta - :param actions: - :type actions: list[~azure.mgmt.monitor.v2020_05_01_preview.models.Action] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. Relevant only for rules of the kind LogAlert. + :type mute_actions_duration: ~datetime.timedelta + :param actions: Actions to invoke when the alert fires. + :type actions: any + :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled + query rule has been configured to be stored in the customer's storage. The default is false. + :vartype is_workspace_alerts_storage_configured: bool + :param check_workspace_alerts_storage_configured: The flag which indicates whether this + scheduled query rule should be stored in the customer's storage. The default is false. Relevant + only for rules of the kind LogAlert. + :type check_workspace_alerts_storage_configured: bool + :param skip_query_validation: The flag which indicates whether the provided query should be + validated or not. The default is false. Relevant only for rules of the kind LogAlert. + :type skip_query_validation: bool + :param auto_mitigate: The flag that indicates whether the alert should be automatically + resolved or not. The default is true. Relevant only for rules of the kind LogAlert. + :type auto_mitigate: bool """ _validation = { @@ -493,6 +441,11 @@ class ScheduledQueryRuleResource(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'created_with_api_version': {'readonly': True}, + 'is_legacy_log_analytics_rule': {'readonly': True}, + 'is_workspace_alerts_storage_configured': {'readonly': True}, } _attribute_map = { @@ -501,96 +454,228 @@ class ScheduledQueryRuleResource(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'created_with_api_version': {'key': 'properties.createdWithApiVersion', 'type': 'str'}, + 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'override_query_time_range': {'key': 'properties.overrideQueryTimeRange', 'type': 'duration'}, 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduledQueryRuleResource, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.etag = None + self.system_data = None + self.created_with_api_version = None + self.is_legacy_log_analytics_rule = None self.description = kwargs.get('description', None) + self.display_name = kwargs.get('display_name', None) self.severity = kwargs.get('severity', None) self.enabled = kwargs.get('enabled', None) self.scopes = kwargs.get('scopes', None) self.evaluation_frequency = kwargs.get('evaluation_frequency', None) self.window_size = kwargs.get('window_size', None) + self.override_query_time_range = kwargs.get('override_query_time_range', None) self.target_resource_types = kwargs.get('target_resource_types', None) self.criteria = kwargs.get('criteria', None) self.mute_actions_duration = kwargs.get('mute_actions_duration', None) self.actions = kwargs.get('actions', None) + self.is_workspace_alerts_storage_configured = None + self.check_workspace_alerts_storage_configured = kwargs.get('check_workspace_alerts_storage_configured', None) + self.skip_query_validation = kwargs.get('skip_query_validation', None) + self.auto_mitigate = kwargs.get('auto_mitigate', None) -class ScheduledQueryRuleResourcePatch(Model): +class ScheduledQueryRuleResourceCollection(msrest.serialization.Model): + """Represents a collection of scheduled query rule resources. + + :param value: The values for the scheduled query rule resources. + :type value: list[~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScheduledQueryRuleResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledQueryRuleResourceCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): """The scheduled query rule resource for patch operations. - :param tags: Resource tags + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :ivar created_with_api_version: The api-version used when creating this alert rule. + :vartype created_with_api_version: str + :ivar is_legacy_log_analytics_rule: True if alert rule is legacy Log Analytic rule. + :vartype is_legacy_log_analytics_rule: bool :param description: The description of the scheduled query rule. :type description: str - :param severity: Severity of the alert. Should be an integer between - [0-4]. Value of 0 is severest - :type severity: int - :param enabled: The flag which indicates whether this scheduled query rule - is enabled. Value should be true or false + :param display_name: The display name of the alert rule. + :type display_name: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Relevant and required only for rules of the kind LogAlert. Possible values include: + 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2021_02_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. :type enabled: bool - :param scopes: The list of resource id's that this scheduled query rule is - scoped to. + :param scopes: The list of resource id's that this scheduled query rule is scoped to. :type scopes: list[str] - :param evaluation_frequency: How often the scheduled query rule is - evaluated represented in ISO 8601 duration format. - :type evaluation_frequency: timedelta - :param window_size: The period of time (in ISO 8601 duration format) on - which the Alert query will be executed (bin size). - :type window_size: timedelta - :param target_resource_types: List of resource type of the target - resource(s) on which the alert is created/updated. For example if the - scope is a resource group and targetResourceTypes is - Microsoft.Compute/virtualMachines, then a different alert will be fired - for each virtual machine in the resource group which meet the alert - criteria + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. Relevant and required only for rules of the kind LogAlert. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). Relevant and required only for rules of the kind LogAlert. + :type window_size: ~datetime.timedelta + :param override_query_time_range: If specified then overrides the query time range (default is + WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + :type override_query_time_range: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. Relevant only for rules of the + kind LogAlert. :type target_resource_types: list[str] - :param criteria: The rule criteria that defines the conditions of the - scheduled query rule. - :type criteria: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleCriteria - :param mute_actions_duration: Mute actions for the chosen period of time - (in ISO 8601 duration format) after the alert is fired. - :type mute_actions_duration: timedelta - :param actions: - :type actions: list[~azure.mgmt.monitor.v2020_05_01_preview.models.Action] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. Relevant only for rules of the kind LogAlert. + :type mute_actions_duration: ~datetime.timedelta + :param actions: Actions to invoke when the alert fires. + :type actions: any + :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled + query rule has been configured to be stored in the customer's storage. The default is false. + :vartype is_workspace_alerts_storage_configured: bool + :param check_workspace_alerts_storage_configured: The flag which indicates whether this + scheduled query rule should be stored in the customer's storage. The default is false. Relevant + only for rules of the kind LogAlert. + :type check_workspace_alerts_storage_configured: bool + :param skip_query_validation: The flag which indicates whether the provided query should be + validated or not. The default is false. Relevant only for rules of the kind LogAlert. + :type skip_query_validation: bool + :param auto_mitigate: The flag that indicates whether the alert should be automatically + resolved or not. The default is true. Relevant only for rules of the kind LogAlert. + :type auto_mitigate: bool """ + _validation = { + 'created_with_api_version': {'readonly': True}, + 'is_legacy_log_analytics_rule': {'readonly': True}, + 'is_workspace_alerts_storage_configured': {'readonly': True}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'created_with_api_version': {'key': 'properties.createdWithApiVersion', 'type': 'str'}, + 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'override_query_time_range': {'key': 'properties.overrideQueryTimeRange', 'type': 'duration'}, 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ScheduledQueryRuleResourcePatch, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.created_with_api_version = None + self.is_legacy_log_analytics_rule = None self.description = kwargs.get('description', None) + self.display_name = kwargs.get('display_name', None) self.severity = kwargs.get('severity', None) self.enabled = kwargs.get('enabled', None) self.scopes = kwargs.get('scopes', None) self.evaluation_frequency = kwargs.get('evaluation_frequency', None) self.window_size = kwargs.get('window_size', None) + self.override_query_time_range = kwargs.get('override_query_time_range', None) self.target_resource_types = kwargs.get('target_resource_types', None) self.criteria = kwargs.get('criteria', None) self.mute_actions_duration = kwargs.get('mute_actions_duration', None) self.actions = kwargs.get('actions', None) + self.is_workspace_alerts_storage_configured = None + self.check_workspace_alerts_storage_configured = kwargs.get('check_workspace_alerts_storage_configured', None) + self.skip_query_validation = kwargs.get('skip_query_validation', None) + self.auto_mitigate = kwargs.get('auto_mitigate', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~$(python-base-namespace).v2021_02_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~$(python-base-namespace).v2021_02_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py index e9d2d107998..62dc476ac67 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py @@ -1,160 +1,79 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import datetime +from typing import Any, Dict, List, Optional, Union +from azure.core.exceptions import HttpResponseError +import msrest.serialization -class Action(Model): - """Actions to invoke when the alert fires. - - :param action_group_id: Action Group resource Id to invoke when the alert - fires. - :type action_group_id: str - :param web_hook_properties: The properties of a webhook object. - :type web_hook_properties: dict[str, str] - """ - - _attribute_map = { - 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, - 'web_hook_properties': {'key': 'webHookProperties', 'type': '{str}'}, - } +from ._monitor_management_client_enums import * - def __init__(self, *, action_group_id: str=None, web_hook_properties=None, **kwargs) -> None: - super(Action, self).__init__(**kwargs) - self.action_group_id = action_group_id - self.web_hook_properties = web_hook_properties +class Actions(msrest.serialization.Model): + """Actions to invoke when the alert fires. -class Resource(Model): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str + :param action_groups: Action Group resource Ids to invoke when the alert fires. + :type action_groups: list[str] + :param custom_properties: The properties of an alert payload. + :type custom_properties: dict[str, str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'action_groups': {'key': 'actionGroups', 'type': '[str]'}, + 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, } - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ + def __init__( + self, + *, + action_groups: Optional[List[str]] = None, + custom_properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Actions, self).__init__(**kwargs) + self.action_groups = action_groups + self.custom_properties = custom_properties - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None - - -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class Condition(Model): +class Condition(msrest.serialization.Model): """A condition of the scheduled query rule. - All required parameters must be populated in order to send to Azure. - - :param query: Log query alert + :param query: Log query alert. :type query: str - :param time_aggregation: Required. Aggregation type. Possible values - include: 'Count', 'Average', 'Minimum', 'Maximum', 'Total' + :param time_aggregation: Aggregation type. Relevant and required only for rules of the kind + LogAlert. Possible values include: "Count", "Average", "Minimum", "Maximum", "Total". :type time_aggregation: str or - ~azure.mgmt.monitor.v2020_05_01_preview.models.TimeAggregation - :param metric_measure_column: The column containing the metric measure - number. + ~$(python-base-namespace).v2021_02_preview.models.TimeAggregation + :param metric_measure_column: The column containing the metric measure number. Relevant only + for rules of the kind LogAlert. :type metric_measure_column: str - :param resource_id_column: The column containing the resource id. The - content of the column must be a uri formatted as resource id + :param resource_id_column: The column containing the resource id. The content of the column + must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. :type resource_id_column: str - :param dimensions: List of Dimensions conditions - :type dimensions: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.Dimension] - :param operator: Required. The criteria operator. Possible values include: - 'Equals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', - 'LessThanOrEqual' - :type operator: str or - ~azure.mgmt.monitor.v2020_05_01_preview.models.ConditionOperator - :param threshold: Required. the criteria threshold value that activates - the alert. - :type threshold: int - :param failing_periods: The minimum number of violations required within - the selected lookback time window required to raise an alert. + :param dimensions: List of Dimensions conditions. + :type dimensions: list[~$(python-base-namespace).v2021_02_preview.models.Dimension] + :param operator: The criteria operator. Relevant and required only for rules of the kind + LogAlert. Possible values include: "Equals", "GreaterThan", "GreaterThanOrEqual", "LessThan", + "LessThanOrEqual". + :type operator: str or ~$(python-base-namespace).v2021_02_preview.models.ConditionOperator + :param threshold: the criteria threshold value that activates the alert. Relevant and required + only for rules of the kind LogAlert. + :type threshold: float + :param failing_periods: The minimum number of violations required within the selected lookback + time window required to raise an alert. Relevant only for rules of the kind LogAlert. :type failing_periods: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ConditionFailingPeriods + ~$(python-base-namespace).v2021_02_preview.models.ConditionFailingPeriods + :param metric_name: The name of the metric to be sent. Relevant and required only for rules of + the kind LogToMetric. + :type metric_name: str """ - _validation = { - 'time_aggregation': {'required': True}, - 'operator': {'required': True}, - 'threshold': {'required': True}, - } - _attribute_map = { 'query': {'key': 'query', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, @@ -162,11 +81,25 @@ class Condition(Model): 'resource_id_column': {'key': 'resourceIdColumn', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, 'operator': {'key': 'operator', 'type': 'str'}, - 'threshold': {'key': 'threshold', 'type': 'int'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, 'failing_periods': {'key': 'failingPeriods', 'type': 'ConditionFailingPeriods'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, } - def __init__(self, *, time_aggregation, operator, threshold: int, query: str=None, metric_measure_column: str=None, resource_id_column: str=None, dimensions=None, failing_periods=None, **kwargs) -> None: + def __init__( + self, + *, + query: Optional[str] = None, + time_aggregation: Optional[Union[str, "TimeAggregation"]] = None, + metric_measure_column: Optional[str] = None, + resource_id_column: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + operator: Optional[Union[str, "ConditionOperator"]] = None, + threshold: Optional[float] = None, + failing_periods: Optional["ConditionFailingPeriods"] = None, + metric_name: Optional[str] = None, + **kwargs + ): super(Condition, self).__init__(**kwargs) self.query = query self.time_aggregation = time_aggregation @@ -176,46 +109,49 @@ def __init__(self, *, time_aggregation, operator, threshold: int, query: str=Non self.operator = operator self.threshold = threshold self.failing_periods = failing_periods + self.metric_name = metric_name -class ConditionFailingPeriods(Model): - """The minimum number of violations required within the selected lookback time - window required to raise an alert. +class ConditionFailingPeriods(msrest.serialization.Model): + """The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert. - :param number_of_evaluation_periods: The number of aggregated lookback - points. The lookback time window is calculated based on the aggregation - granularity (windowSize) and the selected number of aggregated points. - Default value is 1 - :type number_of_evaluation_periods: int - :param min_failing_periods_to_alert: The number of violations to trigger - an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default - value is 1 - :type min_failing_periods_to_alert: int + :param number_of_evaluation_periods: The number of aggregated lookback points. The lookback + time window is calculated based on the aggregation granularity (windowSize) and the selected + number of aggregated points. Default value is 1. + :type number_of_evaluation_periods: long + :param min_failing_periods_to_alert: The number of violations to trigger an alert. Should be + smaller or equal to numberOfEvaluationPeriods. Default value is 1. + :type min_failing_periods_to_alert: long """ _attribute_map = { - 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'int'}, - 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'int'}, + 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'long'}, + 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'long'}, } - def __init__(self, *, number_of_evaluation_periods: int=None, min_failing_periods_to_alert: int=None, **kwargs) -> None: + def __init__( + self, + *, + number_of_evaluation_periods: Optional[int] = 1, + min_failing_periods_to_alert: Optional[int] = 1, + **kwargs + ): super(ConditionFailingPeriods, self).__init__(**kwargs) self.number_of_evaluation_periods = number_of_evaluation_periods self.min_failing_periods_to_alert = min_failing_periods_to_alert -class Dimension(Model): +class Dimension(msrest.serialization.Model): """Dimension splitting and filtering definition. All required parameters must be populated in order to send to Azure. - :param name: Required. Name of the dimension + :param name: Required. Name of the dimension. :type name: str - :param operator: Required. Operator for dimension values. Possible values - include: 'Include', 'Exclude' - :type operator: str or - ~azure.mgmt.monitor.v2020_05_01_preview.models.DimensionOperator - :param values: Required. List of dimension values + :param operator: Required. Operator for dimension values. Possible values include: "Include", + "Exclude". + :type operator: str or ~$(python-base-namespace).v2021_02_preview.models.DimensionOperator + :param values: Required. List of dimension values. :type values: list[str] """ @@ -231,23 +167,29 @@ class Dimension(Model): 'values': {'key': 'values', 'type': '[str]'}, } - def __init__(self, *, name: str, operator, values, **kwargs) -> None: + def __init__( + self, + *, + name: str, + operator: Union[str, "DimensionOperator"], + values: List[str], + **kwargs + ): super(Dimension, self).__init__(**kwargs) self.name = name self.operator = operator self.values = values -class ErrorAdditionalInfo(Model): +class ErrorAdditionalInfo(msrest.serialization.Model): """The resource management error additional info. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -260,45 +202,40 @@ class ErrorAdditionalInfo(Model): 'info': {'key': 'info', 'type': 'object'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None -class ErrorContract(Model): +class ErrorContract(msrest.serialization.Model): """Describes the format of Error response. :param error: The error details. - :type error: ~azure.mgmt.monitor.v2020_05_01_preview.models.ErrorResponse + :type error: ~$(python-base-namespace).v2021_02_preview.models.ErrorResponse """ _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorResponse'}, } - def __init__(self, *, error=None, **kwargs) -> None: + def __init__( + self, + *, + error: Optional["ErrorResponse"] = None, + **kwargs + ): super(ErrorContract, self).__init__(**kwargs) self.error = error -class ErrorContractException(HttpOperationError): - """Server responsed with exception of type: 'ErrorContract'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - super(ErrorContractException, self).__init__(deserialize, response, 'ErrorContract', *args) - - -class ErrorResponse(Model): - """The resource management error response. - - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar code: The error code. :vartype code: str @@ -307,11 +244,10 @@ class ErrorResponse(Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.ErrorResponse] + :vartype details: list[~$(python-base-namespace).v2021_02_preview.models.ErrorResponse] :ivar additional_info: The error additional info. :vartype additional_info: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.ErrorAdditionalInfo] + list[~$(python-base-namespace).v2021_02_preview.models.ErrorAdditionalInfo] """ _validation = { @@ -330,7 +266,10 @@ class ErrorResponse(Model): 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(ErrorResponse, self).__init__(**kwargs) self.code = None self.message = None @@ -339,20 +278,18 @@ def __init__(self, **kwargs) -> None: self.additional_info = None -class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: The name of the resource + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -368,47 +305,55 @@ class ProxyResource(Resource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class ScheduledQueryRuleCriteria(Model): +class ScheduledQueryRuleCriteria(msrest.serialization.Model): """The rule criteria that defines the conditions of the scheduled query rule. - :param all_of: A list of conditions to evaluate against the specified - scopes - :type all_of: - list[~azure.mgmt.monitor.v2020_05_01_preview.models.Condition] + :param all_of: A list of conditions to evaluate against the specified scopes. + :type all_of: list[~$(python-base-namespace).v2021_02_preview.models.Condition] """ _attribute_map = { 'all_of': {'key': 'allOf', 'type': '[Condition]'}, } - def __init__(self, *, all_of=None, **kwargs) -> None: + def __init__( + self, + *, + all_of: Optional[List["Condition"]] = None, + **kwargs + ): super(ScheduledQueryRuleCriteria, self).__init__(**kwargs) self.all_of = all_of class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: The name of the resource + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives. :type location: str """ @@ -427,7 +372,13 @@ class TrackedResource(Resource): 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TrackedResource, self).__init__(**kwargs) self.tags = tags self.location = location @@ -436,56 +387,85 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ScheduledQueryRuleResource(TrackedResource): """The scheduled query rule resource. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar name: The name of the resource + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives + :param location: Required. The geo-location where the resource lives. :type location: str + :param kind: Indicates the type of scheduled query rule. The default is LogAlert. Possible + values include: "LogAlert", "LogToMetric". + :type kind: str or ~$(python-base-namespace).v2021_02_preview.models.Kind + :ivar etag: The etag field is *not* required. If it is provided in the response body, it must + also be provided as a header per the normal etag convention. Entity tags are used for + comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in + the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range + (section 14.27) header fields. + :vartype etag: str + :ivar system_data: SystemData of ScheduledQueryRule. + :vartype system_data: ~$(python-base-namespace).v2021_02_preview.models.SystemData + :ivar created_with_api_version: The api-version used when creating this alert rule. + :vartype created_with_api_version: str + :ivar is_legacy_log_analytics_rule: True if alert rule is legacy Log Analytic rule. + :vartype is_legacy_log_analytics_rule: bool :param description: The description of the scheduled query rule. :type description: str - :param severity: Severity of the alert. Should be an integer between - [0-4]. Value of 0 is severest - :type severity: int - :param enabled: The flag which indicates whether this scheduled query rule - is enabled. Value should be true or false + :param display_name: The display name of the alert rule. + :type display_name: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Relevant and required only for rules of the kind LogAlert. Possible values include: + 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2021_02_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. :type enabled: bool - :param scopes: The list of resource id's that this scheduled query rule is - scoped to. + :param scopes: The list of resource id's that this scheduled query rule is scoped to. :type scopes: list[str] - :param evaluation_frequency: How often the scheduled query rule is - evaluated represented in ISO 8601 duration format. - :type evaluation_frequency: timedelta - :param window_size: The period of time (in ISO 8601 duration format) on - which the Alert query will be executed (bin size). - :type window_size: timedelta - :param target_resource_types: List of resource type of the target - resource(s) on which the alert is created/updated. For example if the - scope is a resource group and targetResourceTypes is - Microsoft.Compute/virtualMachines, then a different alert will be fired - for each virtual machine in the resource group which meet the alert - criteria + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. Relevant and required only for rules of the kind LogAlert. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). Relevant and required only for rules of the kind LogAlert. + :type window_size: ~datetime.timedelta + :param override_query_time_range: If specified then overrides the query time range (default is + WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + :type override_query_time_range: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. Relevant only for rules of the + kind LogAlert. :type target_resource_types: list[str] - :param criteria: The rule criteria that defines the conditions of the - scheduled query rule. - :type criteria: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleCriteria - :param mute_actions_duration: Mute actions for the chosen period of time - (in ISO 8601 duration format) after the alert is fired. - :type mute_actions_duration: timedelta - :param actions: - :type actions: list[~azure.mgmt.monitor.v2020_05_01_preview.models.Action] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. Relevant only for rules of the kind LogAlert. + :type mute_actions_duration: ~datetime.timedelta + :param actions: Actions to invoke when the alert fires. + :type actions: any + :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled + query rule has been configured to be stored in the customer's storage. The default is false. + :vartype is_workspace_alerts_storage_configured: bool + :param check_workspace_alerts_storage_configured: The flag which indicates whether this + scheduled query rule should be stored in the customer's storage. The default is false. Relevant + only for rules of the kind LogAlert. + :type check_workspace_alerts_storage_configured: bool + :param skip_query_validation: The flag which indicates whether the provided query should be + validated or not. The default is false. Relevant only for rules of the kind LogAlert. + :type skip_query_validation: bool + :param auto_mitigate: The flag that indicates whether the alert should be automatically + resolved or not. The default is true. Relevant only for rules of the kind LogAlert. + :type auto_mitigate: bool """ _validation = { @@ -493,6 +473,11 @@ class ScheduledQueryRuleResource(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'etag': {'readonly': True}, + 'system_data': {'readonly': True}, + 'created_with_api_version': {'readonly': True}, + 'is_legacy_log_analytics_rule': {'readonly': True}, + 'is_workspace_alerts_storage_configured': {'readonly': True}, } _attribute_map = { @@ -501,96 +486,273 @@ class ScheduledQueryRuleResource(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'created_with_api_version': {'key': 'properties.createdWithApiVersion', 'type': 'str'}, + 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'override_query_time_range': {'key': 'properties.overrideQueryTimeRange', 'type': 'duration'}, 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, } - def __init__(self, *, location: str, tags=None, description: str=None, severity: int=None, enabled: bool=None, scopes=None, evaluation_frequency=None, window_size=None, target_resource_types=None, criteria=None, mute_actions_duration=None, actions=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kind: Optional[Union[str, "Kind"]] = None, + description: Optional[str] = None, + display_name: Optional[str] = None, + severity: Optional[Union[float, "AlertSeverity"]] = None, + enabled: Optional[bool] = None, + scopes: Optional[List[str]] = None, + evaluation_frequency: Optional[datetime.timedelta] = None, + window_size: Optional[datetime.timedelta] = None, + override_query_time_range: Optional[datetime.timedelta] = None, + target_resource_types: Optional[List[str]] = None, + criteria: Optional["ScheduledQueryRuleCriteria"] = None, + mute_actions_duration: Optional[datetime.timedelta] = None, + actions: Optional[Any] = None, + check_workspace_alerts_storage_configured: Optional[bool] = None, + skip_query_validation: Optional[bool] = None, + auto_mitigate: Optional[bool] = None, + **kwargs + ): super(ScheduledQueryRuleResource, self).__init__(tags=tags, location=location, **kwargs) + self.kind = kind + self.etag = None + self.system_data = None + self.created_with_api_version = None + self.is_legacy_log_analytics_rule = None self.description = description + self.display_name = display_name self.severity = severity self.enabled = enabled self.scopes = scopes self.evaluation_frequency = evaluation_frequency self.window_size = window_size + self.override_query_time_range = override_query_time_range self.target_resource_types = target_resource_types self.criteria = criteria self.mute_actions_duration = mute_actions_duration self.actions = actions + self.is_workspace_alerts_storage_configured = None + self.check_workspace_alerts_storage_configured = check_workspace_alerts_storage_configured + self.skip_query_validation = skip_query_validation + self.auto_mitigate = auto_mitigate -class ScheduledQueryRuleResourcePatch(Model): +class ScheduledQueryRuleResourceCollection(msrest.serialization.Model): + """Represents a collection of scheduled query rule resources. + + :param value: The values for the scheduled query rule resources. + :type value: list[~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScheduledQueryRuleResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["ScheduledQueryRuleResource"]] = None, + **kwargs + ): + super(ScheduledQueryRuleResourceCollection, self).__init__(**kwargs) + self.value = value + + +class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): """The scheduled query rule resource for patch operations. - :param tags: Resource tags + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :ivar created_with_api_version: The api-version used when creating this alert rule. + :vartype created_with_api_version: str + :ivar is_legacy_log_analytics_rule: True if alert rule is legacy Log Analytic rule. + :vartype is_legacy_log_analytics_rule: bool :param description: The description of the scheduled query rule. :type description: str - :param severity: Severity of the alert. Should be an integer between - [0-4]. Value of 0 is severest - :type severity: int - :param enabled: The flag which indicates whether this scheduled query rule - is enabled. Value should be true or false + :param display_name: The display name of the alert rule. + :type display_name: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Relevant and required only for rules of the kind LogAlert. Possible values include: + 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2021_02_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. :type enabled: bool - :param scopes: The list of resource id's that this scheduled query rule is - scoped to. + :param scopes: The list of resource id's that this scheduled query rule is scoped to. :type scopes: list[str] - :param evaluation_frequency: How often the scheduled query rule is - evaluated represented in ISO 8601 duration format. - :type evaluation_frequency: timedelta - :param window_size: The period of time (in ISO 8601 duration format) on - which the Alert query will be executed (bin size). - :type window_size: timedelta - :param target_resource_types: List of resource type of the target - resource(s) on which the alert is created/updated. For example if the - scope is a resource group and targetResourceTypes is - Microsoft.Compute/virtualMachines, then a different alert will be fired - for each virtual machine in the resource group which meet the alert - criteria + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. Relevant and required only for rules of the kind LogAlert. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). Relevant and required only for rules of the kind LogAlert. + :type window_size: ~datetime.timedelta + :param override_query_time_range: If specified then overrides the query time range (default is + WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + :type override_query_time_range: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. Relevant only for rules of the + kind LogAlert. :type target_resource_types: list[str] - :param criteria: The rule criteria that defines the conditions of the - scheduled query rule. - :type criteria: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleCriteria - :param mute_actions_duration: Mute actions for the chosen period of time - (in ISO 8601 duration format) after the alert is fired. - :type mute_actions_duration: timedelta - :param actions: - :type actions: list[~azure.mgmt.monitor.v2020_05_01_preview.models.Action] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. Relevant only for rules of the kind LogAlert. + :type mute_actions_duration: ~datetime.timedelta + :param actions: Actions to invoke when the alert fires. + :type actions: any + :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled + query rule has been configured to be stored in the customer's storage. The default is false. + :vartype is_workspace_alerts_storage_configured: bool + :param check_workspace_alerts_storage_configured: The flag which indicates whether this + scheduled query rule should be stored in the customer's storage. The default is false. Relevant + only for rules of the kind LogAlert. + :type check_workspace_alerts_storage_configured: bool + :param skip_query_validation: The flag which indicates whether the provided query should be + validated or not. The default is false. Relevant only for rules of the kind LogAlert. + :type skip_query_validation: bool + :param auto_mitigate: The flag that indicates whether the alert should be automatically + resolved or not. The default is true. Relevant only for rules of the kind LogAlert. + :type auto_mitigate: bool """ + _validation = { + 'created_with_api_version': {'readonly': True}, + 'is_legacy_log_analytics_rule': {'readonly': True}, + 'is_workspace_alerts_storage_configured': {'readonly': True}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'created_with_api_version': {'key': 'properties.createdWithApiVersion', 'type': 'str'}, + 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'override_query_time_range': {'key': 'properties.overrideQueryTimeRange', 'type': 'duration'}, 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, + 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, } - def __init__(self, *, tags=None, description: str=None, severity: int=None, enabled: bool=None, scopes=None, evaluation_frequency=None, window_size=None, target_resource_types=None, criteria=None, mute_actions_duration=None, actions=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + display_name: Optional[str] = None, + severity: Optional[Union[float, "AlertSeverity"]] = None, + enabled: Optional[bool] = None, + scopes: Optional[List[str]] = None, + evaluation_frequency: Optional[datetime.timedelta] = None, + window_size: Optional[datetime.timedelta] = None, + override_query_time_range: Optional[datetime.timedelta] = None, + target_resource_types: Optional[List[str]] = None, + criteria: Optional["ScheduledQueryRuleCriteria"] = None, + mute_actions_duration: Optional[datetime.timedelta] = None, + actions: Optional[Any] = None, + check_workspace_alerts_storage_configured: Optional[bool] = None, + skip_query_validation: Optional[bool] = None, + auto_mitigate: Optional[bool] = None, + **kwargs + ): super(ScheduledQueryRuleResourcePatch, self).__init__(**kwargs) self.tags = tags + self.created_with_api_version = None + self.is_legacy_log_analytics_rule = None self.description = description + self.display_name = display_name self.severity = severity self.enabled = enabled self.scopes = scopes self.evaluation_frequency = evaluation_frequency self.window_size = window_size + self.override_query_time_range = override_query_time_range self.target_resource_types = target_resource_types self.criteria = criteria self.mute_actions_duration = mute_actions_duration self.actions = actions + self.is_workspace_alerts_storage_configured = None + self.check_workspace_alerts_storage_configured = check_workspace_alerts_storage_configured + self.skip_query_validation = skip_query_validation + self.auto_mitigate = auto_mitigate + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~$(python-base-namespace).v2021_02_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~$(python-base-namespace).v2021_02_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_client_enums.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_client_enums.py deleted file mode 100644 index 93fa54eb856..00000000000 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_client_enums.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum - - -class TimeAggregation(str, Enum): - - count = "Count" - average = "Average" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" - - -class DimensionOperator(str, Enum): - - include = "Include" - exclude = "Exclude" - - -class ConditionOperator(str, Enum): - - equals = "Equals" - greater_than = "GreaterThan" - greater_than_or_equal = "GreaterThanOrEqual" - less_than = "LessThan" - less_than_or_equal = "LessThanOrEqual" diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py new file mode 100644 index 00000000000..161a4ad83b7 --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, float, Enum)): + """Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and + required only for rules of the kind LogAlert. + """ + + ZERO = 0 + ONE = 1 + TWO = 2 + THREE = 3 + FOUR = 4 + +class ConditionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The criteria operator. Relevant and required only for rules of the kind LogAlert. + """ + + EQUALS = "Equals" + GREATER_THAN = "GreaterThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN = "LessThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DimensionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operator for dimension values + """ + + INCLUDE = "Include" + EXCLUDE = "Exclude" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of scheduled query rule. The default is LogAlert. + """ + + LOG_ALERT = "LogAlert" + LOG_TO_METRIC = "LogToMetric" + +class TimeAggregation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Aggregation type. Relevant and required only for rules of the kind LogAlert. + """ + + COUNT = "Count" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_paged_models.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_paged_models.py deleted file mode 100644 index f84d254075a..00000000000 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_paged_models.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ScheduledQueryRuleResourcePaged(Paged): - """ - A paging container for iterating over a list of :class:`ScheduledQueryRuleResource ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ScheduledQueryRuleResource]'} - } - - def __init__(self, *args, **kwargs): - - super(ScheduledQueryRuleResourcePaged, self).__init__(*args, **kwargs) diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/__init__.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/__init__.py index c8cedc13e4d..f677702ed3d 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/__init__.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._scheduled_query_rules_operations import ScheduledQueryRulesOperations diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/_scheduled_query_rules_operations.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/_scheduled_query_rules_operations.py index 448838fbdc5..00f969c1dae 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/_scheduled_query_rules_operations.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/operations/_scheduled_query_rules_operations.py @@ -1,423 +1,443 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ScheduledQueryRulesOperations(object): """ScheduledQueryRulesOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2021_02_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-05-01-preview". """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-05-01-preview" - - self.config = config + self._config = config def list_by_subscription( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ScheduledQueryRuleResourceCollection"] """Retrieve a scheduled query rule definitions in a subscription. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ScheduledQueryRuleResource - :rtype: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResourcePaged[~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResource] - :raises: - :class:`ErrorContractException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_by_subscription.metadata['url'] + url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.ErrorContractException(self._deserialize, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ScheduledQueryRuleResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'} + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ScheduledQueryRuleResourceCollection"] """Retrieve scheduled query rule definitions in a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ScheduledQueryRuleResource - :rtype: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResourcePaged[~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResource] - :raises: - :class:`ErrorContractException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL - url = self.list_by_resource_group.metadata['url'] + url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): request = prepare_request(next_link) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.ErrorContractException(self._deserialize, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ScheduledQueryRuleResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore def get( - self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ScheduledQueryRuleResource" """Retrieve an scheduled query rule definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param rule_name: The name of the rule. :type rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ScheduledQueryRuleResource or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResource - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorContractException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.ErrorContractException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ScheduledQueryRuleResource', response) + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore def create_or_update( - self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + rule_name, # type: str + parameters, # type: "_models.ScheduledQueryRuleResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.ScheduledQueryRuleResource" """Creates or updates a scheduled query rule. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param rule_name: The name of the rule. :type rule_name: str :param parameters: The parameters of the rule to create or update. - :type parameters: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResource - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ScheduledQueryRuleResource or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResource - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorContractException` + :type parameters: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResource') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200, 201]: - raise models.ErrorContractException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ScheduledQueryRuleResource', response) + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ScheduledQueryRuleResource', response) + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore def update( - self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + rule_name, # type: str + parameters, # type: "_models.ScheduledQueryRuleResourcePatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.ScheduledQueryRuleResource" """Update a scheduled query rule. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param rule_name: The name of the rule. :type rule_name: str :param parameters: The parameters of the rule to update. - :type parameters: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResourcePatch - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ScheduledQueryRuleResource or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.monitor.v2020_05_01_preview.models.ScheduledQueryRuleResource - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorContractException` + :type parameters: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2021_02_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.update.metadata['url'] + url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResourcePatch') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResourcePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - raise models.ErrorContractException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ScheduledQueryRuleResource', response) + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore def delete( - self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None """Deletes a scheduled query rule. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param rule_name: The name of the rule. :type rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorContractException` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str') + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200, 204]: - raise models.ErrorContractException(self._deserialize, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore From 70826995370d1927dd2d212530011c7923b02516 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Mon, 9 Aug 2021 16:35:39 +0800 Subject: [PATCH 2/9] parameter --- src/scheduled-query/HISTORY.rst | 7 + .../azext_scheduled_query/__init__.py | 3 +- .../azext_scheduled_query/_actions.py | 19 +- .../azext_scheduled_query/_client_factory.py | 4 +- .../azext_scheduled_query/_help.py | 6 - .../azext_scheduled_query/_params.py | 14 +- .../azext_scheduled_query/_validators.py | 28 + .../azext_scheduled_query/custom.py | 93 ++- .../recordings/test_scheduled_query.yaml | 708 +++++++++--------- .../latest/test_scheduled_query_scenario.py | 13 +- .../models/_models.py | 12 +- .../models/_models_py3.py | 22 +- .../_monitor_management_client_enums.py | 2 +- src/scheduled-query/setup.py | 2 +- 14 files changed, 531 insertions(+), 402 deletions(-) create mode 100644 src/scheduled-query/azext_scheduled_query/_validators.py diff --git a/src/scheduled-query/HISTORY.rst b/src/scheduled-query/HISTORY.rst index caadcc38744..012716cda5f 100644 --- a/src/scheduled-query/HISTORY.rst +++ b/src/scheduled-query/HISTORY.rst @@ -2,6 +2,13 @@ Release History =============== +0.3.2 +++++++ +* Add `--skip-query-validation` parameter +* Add `--check-ws-alerts-storage` parameter +* Add `--auto-mitigate` parameter +* `--actions` are split into `--action-groups` and `--custom-properties` + 0.3.1 ++++++ * Support query placeholder for `--condition` parameter. diff --git a/src/scheduled-query/azext_scheduled_query/__init__.py b/src/scheduled-query/azext_scheduled_query/__init__.py index d7894bdc735..c716523418d 100644 --- a/src/scheduled-query/azext_scheduled_query/__init__.py +++ b/src/scheduled-query/azext_scheduled_query/__init__.py @@ -16,8 +16,7 @@ def __init__(self, cli_ctx=None): scheduled_query_custom = CliCommandType( operations_tmpl='azext_scheduled_query.custom#{}', client_factory=cf_scheduled_query) - super(ScheduledQueryCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=scheduled_query_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=scheduled_query_custom) def load_command_table(self, args): from azext_scheduled_query.commands import load_command_table diff --git a/src/scheduled-query/azext_scheduled_query/_actions.py b/src/scheduled-query/azext_scheduled_query/_actions.py index 9417edfb8eb..5bb28b881d1 100644 --- a/src/scheduled-query/azext_scheduled_query/_actions.py +++ b/src/scheduled-query/azext_scheduled_query/_actions.py @@ -39,12 +39,9 @@ def __call__(self, parser, namespace, values, option_string=None): for item in ['time_aggregation', 'threshold', 'operator']: if not getattr(scheduled_query_condition, item, None): raise InvalidArgumentValueError(usage) - except (AttributeError, TypeError, KeyError): - raise InvalidArgumentValueError(usage) - super(ScheduleQueryConditionAction, self).__call__(parser, - namespace, - scheduled_query_condition, - option_string) + except (AttributeError, TypeError, KeyError) as e: + raise InvalidArgumentValueError(usage) from e + super().__call__(parser, namespace, scheduled_query_condition, option_string) class ScheduleQueryConditionQueryAction(argparse.Action): @@ -65,9 +62,9 @@ def __call__(self, parser, namespace, values, option_string=None): class ScheduleQueryAddAction(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): - from azext_scheduled_query.vendored_sdks.azure_mgmt_scheduled_query.models import Action - action = Action( - action_group_id=values[0], - web_hook_properties=dict(x.split('=', 1) for x in values[1:]) if len(values) > 1 else None + from azext_scheduled_query.vendored_sdks.azure_mgmt_scheduled_query.models import Actions + action = Actions( + action_groups=values[0], + custom_properties=dict(x.split('=', 1) for x in values[1:]) if len(values) > 1 else None ) - super(ScheduleQueryAddAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) diff --git a/src/scheduled-query/azext_scheduled_query/_client_factory.py b/src/scheduled-query/azext_scheduled_query/_client_factory.py index 736646ac843..9063ba9edc9 100644 --- a/src/scheduled-query/azext_scheduled_query/_client_factory.py +++ b/src/scheduled-query/azext_scheduled_query/_client_factory.py @@ -6,5 +6,5 @@ def cf_scheduled_query(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client - from .vendored_sdks.azure_mgmt_scheduled_query._monitor_client import MonitorClient - return get_mgmt_service_client(cli_ctx, MonitorClient).scheduled_query_rules + from .vendored_sdks.azure_mgmt_scheduled_query._monitor_management_client import MonitorManagementClient + return get_mgmt_service_client(cli_ctx, MonitorManagementClient).scheduled_query_rules diff --git a/src/scheduled-query/azext_scheduled_query/_help.py b/src/scheduled-query/azext_scheduled_query/_help.py index f68aa7f4dbc..d1d61a45eae 100644 --- a/src/scheduled-query/azext_scheduled_query/_help.py +++ b/src/scheduled-query/azext_scheduled_query/_help.py @@ -16,12 +16,6 @@ type: command short-summary: Create a scheduled query. parameters: - - name: --action -a - short-summary: Add an action group and optional webhook properties to fire when the alert is triggered. - long-summary: | - Usage: --action ACTION_GROUP_NAME_OR_ID [KEY=VAL [KEY=VAL ...]] - - Multiple action groups can be specified by using more than one `--action` argument. - name: --condition short-summary: The condition which triggers the rule. long-summary: | diff --git a/src/scheduled-query/azext_scheduled_query/_params.py b/src/scheduled-query/azext_scheduled_query/_params.py index 6ac9b1c3d79..6fb268f5d57 100644 --- a/src/scheduled-query/azext_scheduled_query/_params.py +++ b/src/scheduled-query/azext_scheduled_query/_params.py @@ -6,7 +6,7 @@ from azure.cli.core.commands.parameters import tags_type, get_three_state_flag from azure.cli.command_modules.monitor.actions import get_period_type -from azure.cli.command_modules.monitor.validators import get_action_group_validator +from azext_scheduled_query._validators import get_action_group_validator from knack.arguments import CLIArgumentType from ._actions import ScheduleQueryConditionAction, ScheduleQueryAddAction, ScheduleQueryConditionQueryAction @@ -35,4 +35,14 @@ def load_arguments(self, _): c.argument('mute_actions_duration', type=get_period_type(as_timedelta=True), options_list=['--mute-actions-duration', '--mad'], help='Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired.') - c.argument('actions', options_list=['--action', '-a'], action=ScheduleQueryAddAction, nargs='+', validator=get_action_group_validator('actions')) + c.argument('actions', options_list=['--action', '-a'], action=ScheduleQueryAddAction, nargs='+', + validator=get_action_group_validator('actions'), deprecate_info=c.deprecate(redirect='--actions', hide=True)) + c.argument('action_groups', options_list=['--action-groups'], nargs='+', help='Action Group resource Ids to invoke when the alert fires.') + c.argument('custom_properties', options_list=['--custom-properties'], nargs='*', help='The properties of an alert payload.') + c.argument('auto_mitigate', arg_type=get_three_state_flag(), + help='The flag that indicates whether the alert should be automatically resolved or not. The default is true.') + c.argument('skip_query_validation', arg_type=get_three_state_flag(), + help='The flag which indicates whether the provided query should be validated or not.') + c.argument('check_workspace_alerts_storage', options_list=['--check-ws-alerts-storage', '--cwas'], + arg_type=get_three_state_flag(), + help="The flag which indicates whether this scheduled query rule should be stored in the customer's storage.") diff --git a/src/scheduled-query/azext_scheduled_query/_validators.py b/src/scheduled-query/azext_scheduled_query/_validators.py new file mode 100644 index 00000000000..89b6324a452 --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/_validators.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def get_action_group_validator(dest): + def validate_action_groups(cmd, namespace): + action_groups = getattr(namespace, dest, None) + + if not action_groups: + return + + from msrestazure.tools import is_valid_resource_id, resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + + subscription = get_subscription_id(cmd.cli_ctx) + resource_group = namespace.resource_group_name + for group in action_groups: + if not is_valid_resource_id(group.action_groups): + group.action_groups = resource_id( + subscription=subscription, + resource_group=resource_group, + namespace='microsoft.insights', + type='actionGroups', + name=group.action_groups + ) + return validate_action_groups diff --git a/src/scheduled-query/azext_scheduled_query/custom.py b/src/scheduled-query/azext_scheduled_query/custom.py index 105eaaa40a1..538a5776f12 100644 --- a/src/scheduled-query/azext_scheduled_query/custom.py +++ b/src/scheduled-query/azext_scheduled_query/custom.py @@ -25,27 +25,52 @@ def _build_criteria(condition, condition_query): return ScheduledQueryRuleCriteria(all_of=condition) -def create_scheduled_query(client, resource_group_name, rule_name, scopes, condition, condition_query=None, - disabled=False, description=None, tags=None, location=None, - actions=None, severity=2, window_size='5m', evaluation_frequency='5m', - target_resource_type=None, mute_actions_duration='PT30M'): - from .vendored_sdks.azure_mgmt_scheduled_query.models import ScheduledQueryRuleResource +def create_scheduled_query(client, + resource_group_name, + rule_name, + scopes, + condition, + action_groups=None, + custom_properties=None, + condition_query=None, + disabled=False, + description=None, + tags=None, + location=None, + severity=2, + window_size='5m', + evaluation_frequency='5m', + target_resource_type=None, + mute_actions_duration=None, + auto_mitigate=True, + skip_query_validation=False, + check_workspace_alerts_storage=False): criteria = _build_criteria(condition, condition_query) - kwargs = { - 'description': description, - 'severity': severity, - 'enabled': not disabled, - 'scopes': scopes, - 'evaluation_frequency': evaluation_frequency, - 'window_size': window_size, - 'criteria': criteria, - 'target_resource_types': [target_resource_type] if target_resource_type else None, - 'actions': actions, - 'tags': tags, - 'location': location, - 'mute_actions_duration': mute_actions_duration - } - return client.create_or_update(resource_group_name, rule_name, ScheduledQueryRuleResource(**kwargs)) + parameters = {} + actions = {} + actions['action_groups'] = action_groups if action_groups is not None else [] + actions['custom_properties'] = custom_properties if custom_properties is not None else {} + parameters['actions'] = actions + parameters['scopes'] = scopes + parameters['criteria'] = criteria + if actions is not None: + parameters['actions'] = actions + parameters['enabled'] = not disabled + if description is not None: + parameters['description'] = description + if tags is not None: + parameters['tags'] = tags + if location is not None: + parameters['location'] = location + parameters['severity'] = severity + parameters['window_size'] = window_size + parameters['evaluation_frequency'] = evaluation_frequency + parameters['target_resource_types'] = [target_resource_type] if target_resource_type else None + parameters['mute_actions_duration'] = mute_actions_duration + parameters['auto_mitigate'] = auto_mitigate + parameters['skip_query_validation'] = skip_query_validation + parameters['check_workspace_alerts_storage_configured'] = check_workspace_alerts_storage + return client.create_or_update(resource_group_name=resource_group_name, rule_name=rule_name, parameters=parameters) def list_scheduled_query(client, resource_group_name=None): @@ -54,9 +79,23 @@ def list_scheduled_query(client, resource_group_name=None): return client.list_by_subscription() -def update_scheduled_query(cmd, instance, tags=None, disabled=False, condition=None, condition_query=None, - description=None, actions=None, severity=None, window_size=None, - evaluation_frequency=None, mute_actions_duration=None): +def update_scheduled_query(cmd, + instance, + tags=None, + disabled=None, + condition=None, + actions=None, + condition_query=None, + description=None, + severity=None, + window_size=None, + evaluation_frequency=None, + mute_actions_duration=None, + target_resource_type=None, + auto_mitigate=None, + skip_query_validation=None, + check_workspace_alerts_storage=None + ): with cmd.update_context(instance) as c: c.set_param('tags', tags) c.set_param('enabled', not disabled) @@ -66,7 +105,15 @@ def update_scheduled_query(cmd, instance, tags=None, disabled=False, condition=N c.set_param('window_size', window_size) c.set_param('evaluation_frequency', evaluation_frequency) c.set_param('mute_actions_duration', mute_actions_duration) + c.set_param('target_resource_type', target_resource_type) + c.set_param('auto_mitigate', auto_mitigate) + c.set_param('skip_query_validation', skip_query_validation) + c.set_param('check_workspace_alerts_storage_configured', check_workspace_alerts_storage) if condition is not None: criteria = _build_criteria(condition, condition_query) c.set_param('criteria', criteria) + if disabled is not None: + c.set_param('enabled', not disabled) + if auto_mitigate is not None: + c.set_param('auto_mitigate', auto_mitigate) return instance diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml index d4dd10b823f..e0315179262 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml @@ -13,12 +13,12 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-06-22T12:23:28Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:23:32 GMT + - Mon, 09 Aug 2021 08:15:29 GMT expires: - '-1' pragma: @@ -62,34 +62,35 @@ interactions: \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n \ \"sku\": \"7.5\",\n \"version\": \"latest\"\n },\n - \ \"CoreOS\": {\n \"publisher\": \"CoreOS\",\n \"offer\": - \"CoreOS\",\n \"sku\": \"Stable\",\n \"version\": \"latest\"\n - \ },\n \"Debian\": {\n \"publisher\": \"Debian\",\n - \ \"offer\": \"debian-10\",\n \"sku\": \"10\",\n \"version\": - \"latest\"\n },\n \"openSUSE-Leap\": {\n \"publisher\": - \"SUSE\",\n \"offer\": \"openSUSE-Leap\",\n \"sku\": - \"42.3\",\n \"version\": \"latest\"\n },\n \"RHEL\": - {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\",\n - \ \"sku\": \"7-LVM\",\n \"version\": \"latest\"\n },\n - \ \"SLES\": {\n \"publisher\": \"SUSE\",\n \"offer\": - \"SLES\",\n \"sku\": \"15\",\n \"version\": \"latest\"\n - \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\",\n - \ \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\",\n - \ \"version\": \"latest\"\n }\n },\n \"Windows\": - {\n \"Win2019Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n - \ \"offer\": \"WindowsServer\",\n \"sku\": \"2019-Datacenter\",\n - \ \"version\": \"latest\"\n },\n \"Win2016Datacenter\": - {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": - \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \"version\": - \"latest\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \ \"Debian\": {\n \"publisher\": \"Debian\",\n \"offer\": + \"debian-10\",\n \"sku\": \"10\",\n \"version\": \"latest\"\n + \ },\n \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n + \ \"offer\": \"flatcar-container-linux-free\",\n \"sku\": + \"stable\",\n \"version\": \"latest\"\n },\n \"openSUSE-Leap\": + {\n \"publisher\": \"SUSE\",\n \"offer\": \"openSUSE-Leap\",\n + \ \"sku\": \"42.3\",\n \"version\": \"latest\"\n },\n + \ \"RHEL\": {\n \"publisher\": \"RedHat\",\n \"offer\": + \"RHEL\",\n \"sku\": \"7-LVM\",\n \"version\": \"latest\"\n + \ },\n \"SLES\": {\n \"publisher\": \"SUSE\",\n + \ \"offer\": \"SLES\",\n \"sku\": \"15\",\n \"version\": + \"latest\"\n },\n \"UbuntuLTS\": {\n \"publisher\": + \"Canonical\",\n \"offer\": \"UbuntuServer\",\n \"sku\": + \"18.04-LTS\",\n \"version\": \"latest\"\n }\n },\n + \ \"Windows\": {\n \"Win2019Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": - \"2012-R2-Datacenter\",\n \"version\": \"latest\"\n },\n - \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n - \ \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\",\n - \ \"version\": \"latest\"\n },\n \"Win2008R2SP1\": + \"2019-Datacenter\",\n \"version\": \"latest\"\n },\n + \ \"Win2016Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n + \ \"offer\": \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n + \ \"version\": \"latest\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": - \"WindowsServer\",\n \"sku\": \"2008-R2-SP1\",\n \"version\": - \"latest\"\n }\n }\n }\n }\n }\n}\n" + \"WindowsServer\",\n \"sku\": \"2012-R2-Datacenter\",\n \"version\": + \"latest\"\n },\n \"Win2012Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-Datacenter\",\n \"version\": \"latest\"\n },\n + \ \"Win2008R2SP1\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n + \ \"offer\": \"WindowsServer\",\n \"sku\": \"2008-R2-SP1\",\n + \ \"version\": \"latest\"\n }\n }\n }\n }\n + \ }\n}\n" headers: accept-ranges: - bytes @@ -100,19 +101,19 @@ interactions: connection: - keep-alive content-length: - - '2501' + - '2525' content-security-policy: - default-src 'none'; style-src 'unsafe-inline'; sandbox content-type: - text/plain; charset=utf-8 date: - - Tue, 22 Jun 2021 12:23:33 GMT + - Mon, 09 Aug 2021 08:15:30 GMT etag: - - W/"540044b4084c3c314537f1baa1770f248628b2bc9ba0328f1004c33862e049da" + - W/"54bceef15b892f2aa7f4c2145a49f1b5e33608722acdbb47933d7b6cbebbd7f4" expires: - - Tue, 22 Jun 2021 12:28:33 GMT + - Mon, 09 Aug 2021 08:20:30 GMT source-age: - - '31' + - '165' strict-transport-security: - max-age=31536000 vary: @@ -126,15 +127,15 @@ interactions: x-content-type-options: - nosniff x-fastly-request-id: - - 4030a858348c937d58268cde3d0fdcfc1c57974b + - 1908b01ba88a3972fc9383e5d4b36cbcf8b5618e x-frame-options: - deny x-github-request-id: - - B4A2:34FC:2EE16:54047:60D16694 + - F9FC:458D:5EA525:75BC2A:6110BD7D x-served-by: - - cache-qpg1282-QPG + - cache-qpg1251-QPG x-timer: - - S1624364613.024995,VS0,VE1 + - S1628496930.151542,VS0,VE1 x-xss-protection: - 1; mode=block status: @@ -154,7 +155,7 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks?api-version=2018-01-01 response: @@ -168,7 +169,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:23:33 GMT + - Mon, 09 Aug 2021 08:15:30 GMT expires: - '-1' pragma: @@ -196,9 +197,9 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-10-01 response: body: string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.OperationalInsights/workspaces/clitest000002'' @@ -212,7 +213,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:23:34 GMT + - Mon, 09 Aug 2021 08:15:31 GMT expires: - '-1' pragma: @@ -240,12 +241,12 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-06-22T12:23:28Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -254,7 +255,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:23:35 GMT + - Mon, 09 Aug 2021 08:15:31 GMT expires: - '-1' pragma: @@ -288,22 +289,22 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-10-01 response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"35ba1cf4-f518-439d-9ee8-dc9382fdabbb\",\r\n \"provisioningState\": \"Creating\",\r\n + \"b14a3ed3-a748-465a-b344-b889661debde\",\r\n \"provisioningState\": \"Creating\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": - \"Tue, 22 Jun 2021 12:23:40 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \"Mon, 09 Aug 2021 08:15:37 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": - \"Wed, 23 Jun 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \"Tue, 10 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": - \"Enabled\",\r\n \"createdDate\": \"Tue, 22 Jun 2021 12:23:40 GMT\",\r\n - \ \"modifiedDate\": \"Tue, 22 Jun 2021 12:23:40 GMT\"\r\n },\r\n \"id\": + \"Enabled\",\r\n \"createdDate\": \"Mon, 09 Aug 2021 08:15:37 GMT\",\r\n + \ \"modifiedDate\": \"Mon, 09 Aug 2021 08:15:37 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\"\r\n}" @@ -315,7 +316,7 @@ interactions: content-type: - application/json date: - - Tue, 22 Jun 2021 12:23:41 GMT + - Mon, 09 Aug 2021 08:15:38 GMT pragma: - no-cache server: @@ -326,7 +327,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET - ASP.NET @@ -347,22 +348,22 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-10-01 response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"35ba1cf4-f518-439d-9ee8-dc9382fdabbb\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \"b14a3ed3-a748-465a-b344-b889661debde\",\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": - \"Tue, 22 Jun 2021 12:23:40 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \"Mon, 09 Aug 2021 08:15:37 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": - \"Wed, 23 Jun 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \"Tue, 10 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": - \"Enabled\",\r\n \"createdDate\": \"Tue, 22 Jun 2021 12:23:40 GMT\",\r\n - \ \"modifiedDate\": \"Tue, 22 Jun 2021 12:23:40 GMT\"\r\n },\r\n \"id\": + \"Enabled\",\r\n \"createdDate\": \"Mon, 09 Aug 2021 08:15:37 GMT\",\r\n + \ \"modifiedDate\": \"Mon, 09 Aug 2021 08:15:38 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\"\r\n}" @@ -374,7 +375,7 @@ interactions: content-type: - application/json date: - - Tue, 22 Jun 2021 12:24:12 GMT + - Mon, 09 Aug 2021 08:16:08 GMT pragma: - no-cache server: @@ -429,10 +430,10 @@ interactions: "fromImage", "name": null, "caching": "ReadWrite", "managedDisk": {"storageAccountType": null}}, "imageReference": {"publisher": "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": "latest"}}, "osProfile": {"computerName": "myvm1", - "adminUsername": "kairu", "linuxConfiguration": {"disablePasswordAuthentication": - true, "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC/+4SveJW8Wn+vIMzgKgDIauOhF2XRwqR4RJSrjQX8qodZntJ49dQSuaPT0AweyDVPS9TPXCXeGZMN+H+Y54Xj0Mgriau+Y4jPi2mUMKW0R93T5/Y1285JdE1YuXtnv27Xgc1g1lIfHJ5luWOi3sfC47j3AZvhE1NE69alemjIcQCIWlU0SyoZM1K+5hO3mBmZhR4BwuMJO9ruWITXx1t1GAvJgu+xtJNcVXW1ryTt6PvYk1OU5pNyIyNEFxD1Hhw8qOJ/R/jNcZ9wcjnykSqOI/NzNczz3GG2tLdu8gWEBZrpXy4vu9FoSamu3k+ADE6ArH06RM40FaSCNSegivEI4Y6HAjy3svPEU6Y+WvuGUfr0Lphefi7tFHZaEW08U0e6ERmwpFLtfMRWfdhn30ZRtiFDF/Gi4psXuTNPQrGyqc+KgmwCxEIVue8a3TAAVTaoK1JZXA/08IcUGNdhl6INAfHxXbaS15ptTXkqhO3rVL2ambJt8GxU3UTTymq3P20= - kairu@microsoft.com\n", "path": "/home/kairu/.ssh/authorized_keys"}]}}}}}], - "outputs": {}}, "parameters": {"workspaceId": {"value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002"}}, + "adminUsername": "v-jingszhang", "linuxConfiguration": {"disablePasswordAuthentication": + true, "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL2PtV5sp++a43U/dRJ2Fyjso9qDFNbWEnbYk7mA4CfXy0gvxm65oYVd90JysNmGBF/89hIvCTN3ul4aEIuPkzywozRbdyWiJngSd/7OrNBJzpQQSjsGXwoVNDRAJSzlvuQVUR2vwBHeN2xMIvufSvzO3LGI3xcSIWIYlSvU9urnV+Pefd4T6x/OXgTpE02AgMWOspdZTzg0ZKsSU3sG5nYSNoq+8qrHQSXLbLLdWzz5lYKe8p64fQC/xhXrNa3/Nw5vy8YGsyqGueM/Rj6gCI+ivgBlQg908Aa50yQLvwsMLIKxhgPlj73Am8zm27PS3DKVjkr0nTjbEp/3FzZnyB", + "path": "/home/v-jingszhang/.ssh/authorized_keys"}]}}}}}], "outputs": {}}, "parameters": + {"workspaceId": {"value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002"}}, "mode": "incremental"}}' headers: Accept: @@ -444,21 +445,21 @@ interactions: Connection: - keep-alive Content-Length: - - '4593' + - '4413' Content-Type: - application/json ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_dl5eDTjXsAqdigGu5xqwYnWNh6EfH5nT","name":"vm_deploy_dl5eDTjXsAqdigGu5xqwYnWNh6EfH5nT","type":"Microsoft.Resources/deployments","properties":{"templateHash":"2425683351354235518","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-06-22T12:24:19.3172755Z","duration":"PT3.3838123S","correlationId":"290921a9-e8e4-4ba2-8629-13a4b3490599","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","name":"vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5225003549316136960","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-08-09T08:16:14.7260715Z","duration":"PT2.9640029S","correlationId":"11035b2b-8de6-4e37-a339-cb5974a44355","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_dl5eDTjXsAqdigGu5xqwYnWNh6EfH5nT/operationStatuses/08585772422295441888?api-version=2020-10-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz/operationStatuses/08585731099137155791?api-version=2021-04-01 cache-control: - no-cache content-length: @@ -466,7 +467,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:24:20 GMT + - Mon, 09 Aug 2021 08:16:15 GMT expires: - '-1' pragma: @@ -476,7 +477,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1195' status: code: 201 message: Created @@ -494,9 +495,9 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585772422295441888?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585731099137155791?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -508,7 +509,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:24:51 GMT + - Mon, 09 Aug 2021 08:16:46 GMT expires: - '-1' pragma: @@ -536,9 +537,9 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585772422295441888?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585731099137155791?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -550,7 +551,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:25:21 GMT + - Mon, 09 Aug 2021 08:17:16 GMT expires: - '-1' pragma: @@ -578,93 +579,9 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585772422295441888?api-version=2020-10-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 22 Jun 2021 12:25:53 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - vm create - Connection: - - keep-alive - ParameterSetName: - - -n -g --image --nsg-rule --workspace --generate-ssh-keys - User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585772422295441888?api-version=2020-10-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 22 Jun 2021 12:26:24 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - vm create - Connection: - - keep-alive - ParameterSetName: - - -n -g --image --nsg-rule --workspace --generate-ssh-keys - User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585772422295441888?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585731099137155791?api-version=2021-04-01 response: body: string: '{"status":"Succeeded"}' @@ -676,7 +593,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:54 GMT + - Mon, 09 Aug 2021 08:17:47 GMT expires: - '-1' pragma: @@ -704,12 +621,12 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_dl5eDTjXsAqdigGu5xqwYnWNh6EfH5nT","name":"vm_deploy_dl5eDTjXsAqdigGu5xqwYnWNh6EfH5nT","type":"Microsoft.Resources/deployments","properties":{"templateHash":"2425683351354235518","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-06-22T12:26:46.9011249Z","duration":"PT2M30.9676617S","correlationId":"290921a9-e8e4-4ba2-8629-13a4b3490599","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","name":"vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5225003549316136960","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-08-09T08:17:44.3395847Z","duration":"PT1M32.5775161S","correlationId":"11035b2b-8de6-4e37-a339-cb5974a44355","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' headers: cache-control: - no-cache @@ -718,7 +635,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:55 GMT + - Mon, 09 Aug 2021 08:17:48 GMT expires: - '-1' pragma: @@ -746,52 +663,51 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-compute/21.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-compute/22.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1?$expand=instanceView&api-version=2021-03-01 response: body: string: "{\r\n \"name\": \"myvm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1\",\r\n \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"02fb914c-ccce-41e3-9775-5b08c3e03cab\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"5d9e351b-7bfb-4717-9915-ebf031e09366\",\r\n \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n \"version\": \"latest\",\r\n \"exactVersion\": - \"18.04.202106040\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": - \"Linux\",\r\n \"name\": \"myvm1_OsDisk_1_c63982fccf394540bcff719448dd5d09\",\r\n + \"18.04.202107200\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"Linux\",\r\n \"name\": \"myvm1_disk1_26e202a743864d8cbab529030567bf09\",\r\n \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/disks/myvm1_OsDisk_1_c63982fccf394540bcff719448dd5d09\"\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/disks/myvm1_disk1_26e202a743864d8cbab529030567bf09\"\r\n \ },\r\n \"diskSizeGB\": 30,\r\n \"deleteOption\": \"Detach\"\r\n \ },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n - \ \"computerName\": \"myvm1\",\r\n \"adminUsername\": \"kairu\",\r\n + \ \"computerName\": \"myvm1\",\r\n \"adminUsername\": \"v-jingszhang\",\r\n \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n - \ \"path\": \"/home/kairu/.ssh/authorized_keys\",\r\n \"keyData\": - \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC/+4SveJW8Wn+vIMzgKgDIauOhF2XRwqR4RJSrjQX8qodZntJ49dQSuaPT0AweyDVPS9TPXCXeGZMN+H+Y54Xj0Mgriau+Y4jPi2mUMKW0R93T5/Y1285JdE1YuXtnv27Xgc1g1lIfHJ5luWOi3sfC47j3AZvhE1NE69alemjIcQCIWlU0SyoZM1K+5hO3mBmZhR4BwuMJO9ruWITXx1t1GAvJgu+xtJNcVXW1ryTt6PvYk1OU5pNyIyNEFxD1Hhw8qOJ/R/jNcZ9wcjnykSqOI/NzNczz3GG2tLdu8gWEBZrpXy4vu9FoSamu3k+ADE6ArH06RM40FaSCNSegivEI4Y6HAjy3svPEU6Y+WvuGUfr0Lphefi7tFHZaEW08U0e6ERmwpFLtfMRWfdhn30ZRtiFDF/Gi4psXuTNPQrGyqc+KgmwCxEIVue8a3TAAVTaoK1JZXA/08IcUGNdhl6INAfHxXbaS15ptTXkqhO3rVL2ambJt8GxU3UTTymq3P20= - kairu@microsoft.com\\n\"\r\n }\r\n ]\r\n },\r\n - \ \"provisionVMAgent\": true,\r\n \"patchSettings\": {\r\n \"patchMode\": - \"ImageDefault\",\r\n \"assessmentMode\": \"ImageDefault\"\r\n }\r\n - \ },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": - true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": - {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\"}]},\r\n + \ \"path\": \"/home/v-jingszhang/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL2PtV5sp++a43U/dRJ2Fyjso9qDFNbWEnbYk7mA4CfXy0gvxm65oYVd90JysNmGBF/89hIvCTN3ul4aEIuPkzywozRbdyWiJngSd/7OrNBJzpQQSjsGXwoVNDRAJSzlvuQVUR2vwBHeN2xMIvufSvzO3LGI3xcSIWIYlSvU9urnV+Pefd4T6x/OXgTpE02AgMWOspdZTzg0ZKsSU3sG5nYSNoq+8qrHQSXLbLLdWzz5lYKe8p64fQC/xhXrNa3/Nw5vy8YGsyqGueM/Rj6gCI+ivgBlQg908Aa50yQLvwsMLIKxhgPlj73Am8zm27PS3DKVjkr0nTjbEp/3FzZnyB\"\r\n + \ }\r\n ]\r\n },\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n }\r\n },\r\n + \ \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": + true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\"}]},\r\n \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": \"myvm1\",\r\n \"osName\": \"ubuntu\",\r\n \"osVersion\": \"18.04\",\r\n - \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.3.0.2\",\r\n \"statuses\": + \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.3.1.1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \"message\": \"Guest Agent is running\",\r\n \"time\": - \"2021-06-22T12:26:44+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + \"2021-08-09T08:17:38+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \ \"typeHandlerVersion\": \"1.13.35\",\r\n \"status\": {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \"message\": \"Plugin enabled\"\r\n }\r\n }\r\n ]\r\n },\r\n - \ \"disks\": [\r\n {\r\n \"name\": \"myvm1_OsDisk_1_c63982fccf394540bcff719448dd5d09\",\r\n + \ \"disks\": [\r\n {\r\n \"name\": \"myvm1_disk1_26e202a743864d8cbab529030567bf09\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-06-22T12:25:11.8400599+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-08-09T08:16:36.9071621+00:00\"\r\n \ }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\n \"name\": \"OmsAgentForLinux\",\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \"typeHandlerVersion\": @@ -802,7 +718,7 @@ interactions: \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n - \ \"time\": \"2021-06-22T12:26:45.1682789+00:00\"\r\n },\r\n + \ \"time\": \"2021-08-09T08:17:42.8451276+00:00\"\r\n },\r\n \ {\r\n \"code\": \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n }\r\n \ ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\n \"name\": @@ -811,17 +727,17 @@ interactions: \"eastus\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\",\r\n \"publisher\": \"Microsoft.EnterpriseCloud.Monitoring\",\r\n \"type\": \"OmsAgentForLinux\",\r\n - \ \"typeHandlerVersion\": \"1.0\",\r\n \"settings\": {\"workspaceId\":\"35ba1cf4-f518-439d-9ee8-dc9382fdabbb\",\"stopOnMultipleConnections\":\"true\"}\r\n + \ \"typeHandlerVersion\": \"1.0\",\r\n \"settings\": {\"workspaceId\":\"b14a3ed3-a748-465a-b344-b889661debde\",\"stopOnMultipleConnections\":\"true\"}\r\n \ }\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '5722' + - '5533' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:56 GMT + - Mon, 09 Aug 2021 08:17:49 GMT expires: - '-1' pragma: @@ -838,7 +754,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31986 + - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31969 status: code: 200 message: OK @@ -856,18 +772,18 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic?api-version=2018-01-01 response: body: string: "{\r\n \"name\": \"myvm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\",\r\n - \ \"etag\": \"W/\\\"54dc4102-b1de-416e-aba0-ed866a170a85\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"a7775114-c4bb-4262-ba07-814795772f53\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"04de21a8-c23e-4667-80d3-a0d242db536e\",\r\n + \"Succeeded\",\r\n \"resourceGuid\": \"20f5a66f-e5b5-48ae-b2c0-eafa2daa19da\",\r\n \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigmyvm1\",\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\",\r\n - \ \"etag\": \"W/\\\"54dc4102-b1de-416e-aba0-ed866a170a85\\\"\",\r\n + \ \"etag\": \"W/\\\"a7775114-c4bb-4262-ba07-814795772f53\\\"\",\r\n \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -876,8 +792,8 @@ interactions: \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": - \"tdflqwqukrqefob1z444paacmd.bx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": - \"00-0D-3A-9B-84-A4\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \"lfrmq0n2wbnezjizv5dwucatze.bx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-0D-3A-54-98-71\",\r\n \"enableAcceleratedNetworking\": false,\r\n \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG\"\r\n \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": @@ -891,9 +807,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:57 GMT + - Mon, 09 Aug 2021 08:17:50 GMT etag: - - W/"54dc4102-b1de-416e-aba0-ed866a170a85" + - W/"a7775114-c4bb-4262-ba07-814795772f53" expires: - '-1' pragma: @@ -910,7 +826,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 83677822-ae1a-40bb-b3eb-1c0f8d7f2ece + - d3843776-5915-4730-8b8f-41f601373fd5 status: code: 200 message: OK @@ -928,16 +844,16 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-network/19.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP?api-version=2018-01-01 response: body: string: "{\r\n \"name\": \"myvm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP\",\r\n - \ \"etag\": \"W/\\\"2872af45-b116-4a83-82d7-a71719dac4cc\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"a35c8adb-dda7-4b96-8048-69fdeb0b5a50\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"79a1adab-f126-4ab7-a97c-2d989436dcf1\",\r\n - \ \"ipAddress\": \"40.121.109.44\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n + \"Succeeded\",\r\n \"resourceGuid\": \"0e21542c-bfb3-42b7-9282-be83a4c7c46f\",\r\n + \ \"ipAddress\": \"52.168.93.96\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\"\r\n \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n @@ -946,13 +862,13 @@ interactions: cache-control: - no-cache content-length: - - '1005' + - '1004' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:58 GMT + - Mon, 09 Aug 2021 08:17:50 GMT etag: - - W/"2872af45-b116-4a83-82d7-a71719dac4cc" + - W/"a35c8adb-dda7-4b96-8048-69fdeb0b5a50" expires: - '-1' pragma: @@ -969,7 +885,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - eb699540-a7a2-4541-8396-be13f0917c88 + - 5533a04c-6313-44fb-aa0f-2d202556415f status: code: 200 message: OK @@ -991,12 +907,12 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2021-06-22T12%3A26%3A59.2405092Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2021-08-09T08%3A17%3A51.7319018Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1005,7 +921,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:59 GMT + - Mon, 09 Aug 2021 08:17:51 GMT expires: - '-1' pragma: @@ -1048,14 +964,14 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002?api-version=2020-08-01 response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Memory","performanceCounters":[{"counterName":"Available MBytes Memory"},{"counterName":"% Used Memory"},{"counterName":"% Used Swap - Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2021-06-22T12%3A26%3A59.9539568Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2021-08-09T08%3A17%3A52.3297901Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1064,7 +980,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:26:59 GMT + - Mon, 09 Aug 2021 08:17:52 GMT expires: - '-1' pragma: @@ -1106,13 +1022,13 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003?api-version=2020-08-01 response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Processor","performanceCounters":[{"counterName":"% - Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2021-06-22T12%3A27%3A00.6418054Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2021-08-09T08%3A17%3A52.9533361Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1121,7 +1037,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:27:00 GMT + - Mon, 09 Aug 2021 08:17:52 GMT expires: - '-1' pragma: @@ -1165,7 +1081,7 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004?api-version=2020-08-01 response: @@ -1173,7 +1089,7 @@ interactions: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Logical Disk","performanceCounters":[{"counterName":"% Used Inodes"},{"counterName":"Free Megabytes"},{"counterName":"% Used Space"},{"counterName":"Disk Transfers/sec"},{"counterName":"Disk - Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2021-06-22T12%3A27%3A01.3669794Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2021-08-09T08%3A17%3A53.6843641Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1182,7 +1098,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:27:01 GMT + - Mon, 09 Aug 2021 08:17:53 GMT expires: - '-1' pragma: @@ -1224,13 +1140,13 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005?api-version=2020-08-01 response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Network","performanceCounters":[{"counterName":"Total - Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2021-06-22T12%3A27%3A03.2755453Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2021-08-09T08%3A17%3A54.3809313Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1239,7 +1155,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:27:03 GMT + - Mon, 09 Aug 2021 08:17:54 GMT expires: - '-1' pragma: @@ -1279,12 +1195,12 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2021-06-22T12%3A27%3A04.0435457Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2021-08-09T08%3A17%3A55.0886352Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1293,7 +1209,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:27:04 GMT + - Mon, 09 Aug 2021 08:17:55 GMT expires: - '-1' pragma: @@ -1334,12 +1250,12 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.25.0 azsdk-python-mgmt-loganalytics/8.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-mgmt-loganalytics/11.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2021-06-22T12%3A27%3A04.8035166Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2021-08-09T08%3A17%3A55.9793238Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1348,7 +1264,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:27:04 GMT + - Mon, 09 Aug 2021 08:17:56 GMT expires: - '-1' pragma: @@ -1384,12 +1300,12 @@ interactions: ParameterSetName: - -g -n --scopes --condition --condition-query --description User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-06-22T12:23:28Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1398,7 +1314,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:06 GMT + - Mon, 09 Aug 2021 08:20:56 GMT expires: - '-1' pragma: @@ -1417,9 +1333,10 @@ interactions: 2, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"], "evaluationFrequency": "PT5M", "windowSize": "PT5M", "criteria": {"allOf": [{"query": "union Event, Syslog | where TimeGenerated > ago(1h)", "timeAggregation": "Count", - "dimensions": [], "operator": "GreaterThan", "threshold": 360, "failingPeriods": - {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": 1}}]}, "muteActionsDuration": - "PT30M"}}' + "dimensions": [], "operator": "GreaterThan", "threshold": 360.0, "failingPeriods": + {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": 1}}]}, "actions": + {"actionGroups": [], "customProperties": {}}, "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": false, "autoMitigate": true}}' headers: Accept: - application/json @@ -1430,32 +1347,29 @@ interactions: Connection: - keep-alive Content-Length: - - '656' + - '783' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -g -n --scopes --condition --condition-query --description User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:02.9063216Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"muteActionsDuration":"PT30M"}}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: cache-control: - no-cache content-length: - - '891' + - '1199' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:20 GMT + - Mon, 09 Aug 2021 08:21:08 GMT expires: - '-1' pragma: @@ -1468,6 +1382,12 @@ interactions: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2021-08-09T08:22:02.9148731Z' status: code: 201 message: Created @@ -1485,12 +1405,12 @@ interactions: ParameterSetName: - -g -n --scopes --condition --description User-Agent: - - AZURECLI/2.25.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.10 (Windows-10-10.0.19043-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2020-10-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-06-22T12:23:28Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1499,7 +1419,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:22 GMT + - Mon, 09 Aug 2021 08:21:09 GMT expires: - '-1' pragma: @@ -1519,8 +1439,9 @@ interactions: "evaluationFrequency": "PT5M", "windowSize": "PT5M", "criteria": {"allOf": [{"query": "union Event, Syslog | where TimeGenerated > ago(1h)", "timeAggregation": "Count", "resourceIdColumn": "_ResourceId", "dimensions": [], "operator": "GreaterThan", - "threshold": 360, "failingPeriods": {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": - 1}}]}, "muteActionsDuration": "PT30M"}}' + "threshold": 360.0, "failingPeriods": {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": + 1}}]}, "actions": {"actionGroups": [], "customProperties": {}}, "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": false, "autoMitigate": true}}' headers: Accept: - application/json @@ -1531,32 +1452,29 @@ interactions: Connection: - keep-alive Content-Length: - - '641' + - '768' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -g -n --scopes --condition --description User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq02?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq02?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:14.9448475Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:14.9448475Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"muteActionsDuration":"PT30M"}}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: cache-control: - no-cache content-length: - - '874' + - '1182' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:35 GMT + - Mon, 09 Aug 2021 08:21:20 GMT expires: - '-1' pragma: @@ -1569,6 +1487,12 @@ interactions: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2021-08-09T08:22:15.0218886Z' status: code: 201 message: Created @@ -1587,26 +1511,23 @@ interactions: - -g -n --condition --condition-query --description --severity --disabled --evaluation-frequency --window-size User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:02.9063216Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"muteActionsDuration":"PT30M"}}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: cache-control: - no-cache content-length: - - '891' + - '1199' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:36 GMT + - Mon, 09 Aug 2021 08:21:21 GMT expires: - '-1' pragma: @@ -1630,8 +1551,9 @@ interactions: "evaluationFrequency": "PT10M", "windowSize": "PT10M", "criteria": {"allOf": [{"query": "union Event | where TimeGenerated > ago(2h)", "timeAggregation": "Count", "resourceIdColumn": "_ResourceId", "dimensions": [], "operator": "LessThan", - "threshold": 260, "failingPeriods": {"numberOfEvaluationPeriods": 3, "minFailingPeriodsToAlert": - 2}}]}, "muteActionsDuration": "PT30M"}}' + "threshold": 260.0, "failingPeriods": {"numberOfEvaluationPeriods": 3, "minFailingPeriodsToAlert": + 2}}]}, "checkWorkspaceAlertsStorageConfigured": false, "skipQueryValidation": + false, "autoMitigate": true}}' headers: Accept: - application/json @@ -1642,33 +1564,145 @@ interactions: Connection: - keep-alive Content-Length: - - '685' + - '755' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -g -n --condition --condition-query --description --severity --disabled --evaluation-frequency --window-size User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:22.6801046Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"muteActionsDuration":"PT30M"}}' + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: cache-control: - no-cache content-length: - - '918' + - '1226' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:41 GMT + - Mon, 09 Aug 2021 08:21:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2021-08-09T08:22:22.6846374Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query update + Connection: + - keep-alive + ParameterSetName: + - -g -n --mad --auto-mitigate --skip-query-validation + User-Agent: + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:22.6801046Z"},"properties":{"description":"Test + rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1226' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 09 Aug 2021 08:21:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"description": "Test rule 2", "severity": + 4, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"], + "evaluationFrequency": "PT10M", "windowSize": "PT10M", "criteria": {"allOf": + [{"query": "union Event | where TimeGenerated > ago(2h)", "timeAggregation": + "Count", "resourceIdColumn": "_ResourceId", "dimensions": [], "operator": "LessThan", + "threshold": 260.0, "failingPeriods": {"numberOfEvaluationPeriods": 3, "minFailingPeriodsToAlert": + 2}}]}, "muteActionsDuration": "PT30M", "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": true, "autoMitigate": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query update + Connection: + - keep-alive + Content-Length: + - '786' + Content-Type: + - application/json + ParameterSetName: + - -g -n --mad --auto-mitigate --skip-query-validation + User-Agent: + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}}' + headers: + cache-control: + - no-cache + content-length: + - '1255' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 09 Aug 2021 08:21:30 GMT expires: - '-1' pragma: @@ -1685,6 +1719,12 @@ interactions: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1198' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2021-08-09T08:22:28.9334437Z' status: code: 200 message: OK @@ -1702,26 +1742,23 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test - rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"muteActionsDuration":"PT30M"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}}' headers: cache-control: - no-cache content-length: - - '918' + - '1255' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:42 GMT + - Mon, 09 Aug 2021 08:21:30 GMT expires: - '-1' pragma: @@ -1753,28 +1790,25 @@ interactions: ParameterSetName: - -g User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules?api-version=2021-02-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test - rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"muteActionsDuration":"PT30M"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:14.9448475Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:14.9448475Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"muteActionsDuration":"PT30M"}}]}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' headers: cache-control: - no-cache content-length: - - '1805' + - '2450' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:44 GMT + - Mon, 09 Aug 2021 08:21:31 GMT expires: - '-1' pragma: @@ -1804,29 +1838,37 @@ interactions: Connection: - keep-alive User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/scheduledQueryRules?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/scheduledQueryRules?api-version=2021-02-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test - rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"muteActionsDuration":"PT30M"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","properties":{"description":"Test + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq1","name":"sq1","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T05:42:50.6351555Z"},"properties":{"description":"Test + rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq2","name":"sq2","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T04:52:27.5193087Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq3","name":"sq3","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T06:35:10.1893613Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq4","name":"sq4","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T06:05:43.9144999Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq5","name":"sq5","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:09:46.6790486Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq6","name":"sq6","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T07:31:45.8695596Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T07:34:45.2039879Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:14.9448475Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:14.9448475Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"muteActionsDuration":"PT30M"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/microsoft.insights/scheduledqueryrules/zhoxing-test","name":"zhoxing-test","type":"microsoft.insights/scheduledqueryrules","location":"centralus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testece/providers/Microsoft.OperationalInsights/workspaces/mmeum-analytics-workspace-testece":""},"properties":{"displayName":"zhoxing-test","description":"","severity":3,"enabled":false,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/microsoft.insights/components/zhoxing-test"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"requests - | where resultCode == \"500\"","timeAggregation":"Count","metricMeasureColumn":"","operator":"GreaterThan","threshold":5.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"actions":[{"actionGroupId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/default-activitylogalerts/providers/microsoft.insights/actiongroups/zhoxing-test"}]}}]}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' headers: cache-control: - no-cache content-length: - - '2944' + - '8286' content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:45 GMT + - Mon, 09 Aug 2021 08:21:32 GMT expires: - '-1' pragma: @@ -1860,12 +1902,9 @@ interactions: ParameterSetName: - -g -n -y User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: string: '' @@ -1875,7 +1914,7 @@ interactions: content-length: - '0' date: - - Tue, 22 Jun 2021 12:30:54 GMT + - Mon, 09 Aug 2021 08:21:43 GMT expires: - '-1' pragma: @@ -1905,12 +1944,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - python/3.8.10 (Windows-10-10.0.19043-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-monitor/2020-05-01-preview Azure-SDK-For-Python AZURECLI/2.25.0 - accept-language: - - en-US + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2020-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Insights/scheduledqueryrules/sq01'' @@ -1924,7 +1960,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 12:30:56 GMT + - Mon, 09 Aug 2021 08:21:43 GMT expires: - '-1' pragma: diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py b/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py index de247fe28e1..fd3c51f78a4 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py @@ -46,7 +46,12 @@ def test_scheduled_query(self, resource_group): self.check('criteria.allOf[0].timeAggregation', 'Count'), self.check('criteria.allOf[0].operator', 'GreaterThan'), self.check('criteria.allOf[0].failingPeriods.minFailingPeriodsToAlert', 1), - self.check('criteria.allOf[0].failingPeriods.numberOfEvaluationPeriods', 1) + self.check('criteria.allOf[0].failingPeriods.numberOfEvaluationPeriods', 1), + self.check('criteria.allOf[0].failingPeriods.minFailingPeriodsToAlert', 1), + self.check('criteria.allOf[0].failingPeriods.numberOfEvaluationPeriods', 1), + self.check('autoMitigate', True), + self.check('skipQueryValidation', False), + self.check('checkWorkspaceAlertsStorageConfigured', False) ]) self.cmd('monitor scheduled-query create -g {rg} -n {name2} --scopes {rg_id} --condition "count \'union Event, Syslog | where TimeGenerated > ago(1h)\' > 360 resource id _ResourceId" --description "Test rule"', checks=[ @@ -68,6 +73,12 @@ def test_scheduled_query(self, resource_group): self.check('criteria.allOf[0].failingPeriods.minFailingPeriodsToAlert', 2), self.check('criteria.allOf[0].failingPeriods.numberOfEvaluationPeriods', 3) ]) + self.cmd('monitor scheduled-query update -g {rg} -n {name1} --mad PT30M --auto-mitigate False --skip-query-validation True', + checks=[ + self.check('skipQueryValidation', True), + self.check('muteActionsDuration', '0:30:00'), + self.check('autoMitigate', False) + ]) self.cmd('monitor scheduled-query show -g {rg} -n {name1}', checks=[ self.check('name', '{name1}') diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py index 24620517cf2..ba9ddba3519 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models.py @@ -420,7 +420,7 @@ class ScheduledQueryRuleResource(TrackedResource): format) after the alert is fired. Relevant only for rules of the kind LogAlert. :type mute_actions_duration: ~datetime.timedelta :param actions: Actions to invoke when the alert fires. - :type actions: any + :type actions: ~$(python-base-namespace).v2021_02_preview.models.Actions :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. :vartype is_workspace_alerts_storage_configured: bool @@ -461,7 +461,7 @@ class ScheduledQueryRuleResource(TrackedResource): 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, @@ -470,7 +470,7 @@ class ScheduledQueryRuleResource(TrackedResource): 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'actions': {'key': 'properties.actions', 'type': 'Actions'}, 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, @@ -569,7 +569,7 @@ class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): format) after the alert is fired. Relevant only for rules of the kind LogAlert. :type mute_actions_duration: ~datetime.timedelta :param actions: Actions to invoke when the alert fires. - :type actions: any + :type actions: ~$(python-base-namespace).v2021_02_preview.models.Actions :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. :vartype is_workspace_alerts_storage_configured: bool @@ -597,7 +597,7 @@ class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, @@ -606,7 +606,7 @@ class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'actions': {'key': 'properties.actions', 'type': 'Actions'}, 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py index 62dc476ac67..2bf58582dfe 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Any, Dict, List, Optional, Union +from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -452,7 +452,7 @@ class ScheduledQueryRuleResource(TrackedResource): format) after the alert is fired. Relevant only for rules of the kind LogAlert. :type mute_actions_duration: ~datetime.timedelta :param actions: Actions to invoke when the alert fires. - :type actions: any + :type actions: ~$(python-base-namespace).v2021_02_preview.models.Actions :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. :vartype is_workspace_alerts_storage_configured: bool @@ -493,7 +493,7 @@ class ScheduledQueryRuleResource(TrackedResource): 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, @@ -502,7 +502,7 @@ class ScheduledQueryRuleResource(TrackedResource): 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'actions': {'key': 'properties.actions', 'type': 'Actions'}, 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, @@ -517,7 +517,7 @@ def __init__( kind: Optional[Union[str, "Kind"]] = None, description: Optional[str] = None, display_name: Optional[str] = None, - severity: Optional[Union[float, "AlertSeverity"]] = None, + severity: Optional[Union[int, "AlertSeverity"]] = None, enabled: Optional[bool] = None, scopes: Optional[List[str]] = None, evaluation_frequency: Optional[datetime.timedelta] = None, @@ -526,7 +526,7 @@ def __init__( target_resource_types: Optional[List[str]] = None, criteria: Optional["ScheduledQueryRuleCriteria"] = None, mute_actions_duration: Optional[datetime.timedelta] = None, - actions: Optional[Any] = None, + actions: Optional["Actions"] = None, check_workspace_alerts_storage_configured: Optional[bool] = None, skip_query_validation: Optional[bool] = None, auto_mitigate: Optional[bool] = None, @@ -622,7 +622,7 @@ class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): format) after the alert is fired. Relevant only for rules of the kind LogAlert. :type mute_actions_duration: ~datetime.timedelta :param actions: Actions to invoke when the alert fires. - :type actions: any + :type actions: ~$(python-base-namespace).v2021_02_preview.models.Actions :ivar is_workspace_alerts_storage_configured: The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false. :vartype is_workspace_alerts_storage_configured: bool @@ -650,7 +650,7 @@ class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): 'is_legacy_log_analytics_rule': {'key': 'properties.isLegacyLogAnalyticsRule', 'type': 'bool'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, @@ -659,7 +659,7 @@ class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, - 'actions': {'key': 'properties.actions', 'type': 'object'}, + 'actions': {'key': 'properties.actions', 'type': 'Actions'}, 'is_workspace_alerts_storage_configured': {'key': 'properties.isWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'check_workspace_alerts_storage_configured': {'key': 'properties.checkWorkspaceAlertsStorageConfigured', 'type': 'bool'}, 'skip_query_validation': {'key': 'properties.skipQueryValidation', 'type': 'bool'}, @@ -672,7 +672,7 @@ def __init__( tags: Optional[Dict[str, str]] = None, description: Optional[str] = None, display_name: Optional[str] = None, - severity: Optional[Union[float, "AlertSeverity"]] = None, + severity: Optional[Union[int, "AlertSeverity"]] = None, enabled: Optional[bool] = None, scopes: Optional[List[str]] = None, evaluation_frequency: Optional[datetime.timedelta] = None, @@ -681,7 +681,7 @@ def __init__( target_resource_types: Optional[List[str]] = None, criteria: Optional["ScheduledQueryRuleCriteria"] = None, mute_actions_duration: Optional[datetime.timedelta] = None, - actions: Optional[Any] = None, + actions: Optional["Actions"] = None, check_workspace_alerts_storage_configured: Optional[bool] = None, skip_query_validation: Optional[bool] = None, auto_mitigate: Optional[bool] = None, diff --git a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py index 161a4ad83b7..89555e1c18b 100644 --- a/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py +++ b/src/scheduled-query/azext_scheduled_query/vendored_sdks/azure_mgmt_scheduled_query/models/_monitor_management_client_enums.py @@ -26,7 +26,7 @@ def __getattr__(cls, name): raise AttributeError(name) -class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, float, Enum)): +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): """Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert. """ diff --git a/src/scheduled-query/setup.py b/src/scheduled-query/setup.py index b8ff2e55dd0..8dbd5d9a62e 100644 --- a/src/scheduled-query/setup.py +++ b/src/scheduled-query/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.3.1' +VERSION = '0.3.2' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From a963ff6a548b7faf59e3255fed9704b5b05a53fb Mon Sep 17 00:00:00 2001 From: songlu <37168047+PARADISSEEKR@users.noreply.github.com> Date: Wed, 11 Aug 2021 17:45:11 +0800 Subject: [PATCH 3/9] Update src/scheduled-query/HISTORY.rst Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> --- src/scheduled-query/HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheduled-query/HISTORY.rst b/src/scheduled-query/HISTORY.rst index 012716cda5f..38c538cea18 100644 --- a/src/scheduled-query/HISTORY.rst +++ b/src/scheduled-query/HISTORY.rst @@ -7,7 +7,7 @@ Release History * Add `--skip-query-validation` parameter * Add `--check-ws-alerts-storage` parameter * Add `--auto-mitigate` parameter -* `--actions` are split into `--action-groups` and `--custom-properties` +* [Breaking Change] `--actions` are split into `--action-groups` and `--custom-properties` 0.3.1 ++++++ From b76d85700ae0bf7365bae08e74cb19c463e5fa52 Mon Sep 17 00:00:00 2001 From: songlu <37168047+PARADISSEEKR@users.noreply.github.com> Date: Wed, 11 Aug 2021 17:45:19 +0800 Subject: [PATCH 4/9] Update src/scheduled-query/HISTORY.rst Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> --- src/scheduled-query/HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheduled-query/HISTORY.rst b/src/scheduled-query/HISTORY.rst index 38c538cea18..fc2c58c00cf 100644 --- a/src/scheduled-query/HISTORY.rst +++ b/src/scheduled-query/HISTORY.rst @@ -2,7 +2,7 @@ Release History =============== -0.3.2 +0.4.0 ++++++ * Add `--skip-query-validation` parameter * Add `--check-ws-alerts-storage` parameter From eff67e46d41a13083e08b639cff0c8cde5202798 Mon Sep 17 00:00:00 2001 From: songlu <37168047+PARADISSEEKR@users.noreply.github.com> Date: Wed, 11 Aug 2021 17:45:32 +0800 Subject: [PATCH 5/9] Update src/scheduled-query/setup.py Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> --- src/scheduled-query/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheduled-query/setup.py b/src/scheduled-query/setup.py index 8dbd5d9a62e..d2a0e6f04dd 100644 --- a/src/scheduled-query/setup.py +++ b/src/scheduled-query/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.3.2' +VERSION = '0.4.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From dd1d437f9f69783f134ef5791e0789bd41618db9 Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Thu, 12 Aug 2021 15:33:40 +0800 Subject: [PATCH 6/9] update --- .../azext_scheduled_query/_help.py | 20 +- .../azext_scheduled_query/_params.py | 14 +- .../azext_scheduled_query/_validators.py | 32 +- .../azext_scheduled_query/custom.py | 6 +- .../recordings/test_scheduled_query.yaml | 638 ++++++++++++++---- .../latest/test_scheduled_query_scenario.py | 21 +- 6 files changed, 560 insertions(+), 171 deletions(-) diff --git a/src/scheduled-query/azext_scheduled_query/_help.py b/src/scheduled-query/azext_scheduled_query/_help.py index d1d61a45eae..dfbbe52c19f 100644 --- a/src/scheduled-query/azext_scheduled_query/_help.py +++ b/src/scheduled-query/azext_scheduled_query/_help.py @@ -16,6 +16,14 @@ type: command short-summary: Create a scheduled query. parameters: + - name: --action-groups + short-summary: Action Group resource Ids to invoke when the alert fires. + long-summary: | + Usage: --action-groups ACTION_GROUP_NAME_OR_ID [NAME_OR_ID,...] + - name: --custom-properties + short-summary: The properties of an alert payload. + long-summary: | + Usage: --custom-properties ALERT_PAYLOAD_PROPERTIES [KEY=VAL,KEY=VAL ...] - name: --condition short-summary: The condition which triggers the rule. long-summary: | @@ -38,12 +46,14 @@ type: command short-summary: Update a scheduled query. parameters: - - name: --action -a - short-summary: Add an action group and optional webhook properties to fire when the alert is triggered. + - name: --action-groups + short-summary: Action Group resource Ids to invoke when the alert fires. long-summary: | - Usage: --action ACTION_GROUP_NAME_OR_ID [KEY=VAL [KEY=VAL ...]] - - Multiple action groups can be specified by using more than one `--action` argument. + Usage: --action-groups ACTION_GROUP_NAME_OR_ID [NAME_OR_ID,...] + - name: --custom-properties + short-summary: The properties of an alert payload. + long-summary: | + Usage: --custom-properties ALERT_PAYLOAD_PROPERTIES [KEY=VAL,KEY=VAL ...] - name: --condition short-summary: The condition which triggers the rule. long-summary: | diff --git a/src/scheduled-query/azext_scheduled_query/_params.py b/src/scheduled-query/azext_scheduled_query/_params.py index 6fb268f5d57..c1896dab0d4 100644 --- a/src/scheduled-query/azext_scheduled_query/_params.py +++ b/src/scheduled-query/azext_scheduled_query/_params.py @@ -6,9 +6,9 @@ from azure.cli.core.commands.parameters import tags_type, get_three_state_flag from azure.cli.command_modules.monitor.actions import get_period_type -from azext_scheduled_query._validators import get_action_group_validator +from azext_scheduled_query._validators import validate_custom_properties from knack.arguments import CLIArgumentType -from ._actions import ScheduleQueryConditionAction, ScheduleQueryAddAction, ScheduleQueryConditionQueryAction +from ._actions import ScheduleQueryConditionAction, ScheduleQueryConditionQueryAction def load_arguments(self, _): @@ -16,6 +16,11 @@ def load_arguments(self, _): from azure.cli.core.commands.validators import get_default_location_from_resource_group name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME') + custom_properties_arg_type = CLIArgumentType( + validator=validate_custom_properties, + options_list=['--custom-properties'], + nargs='*', + help='The properties of an alert payload.') with self.argument_context('monitor scheduled-query') as c: c.argument('rule_name', name_arg_type, id_part='name', help='Name of the scheduled query rule.') c.argument('location', validator=get_default_location_from_resource_group) @@ -35,10 +40,9 @@ def load_arguments(self, _): c.argument('mute_actions_duration', type=get_period_type(as_timedelta=True), options_list=['--mute-actions-duration', '--mad'], help='Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired.') - c.argument('actions', options_list=['--action', '-a'], action=ScheduleQueryAddAction, nargs='+', - validator=get_action_group_validator('actions'), deprecate_info=c.deprecate(redirect='--actions', hide=True)) + c.argument('actions', options_list=['--action', '-a'], nargs='+', deprecate_info=c.deprecate(redirect='--actions', hide=True)) c.argument('action_groups', options_list=['--action-groups'], nargs='+', help='Action Group resource Ids to invoke when the alert fires.') - c.argument('custom_properties', options_list=['--custom-properties'], nargs='*', help='The properties of an alert payload.') + c.argument('custom_properties', custom_properties_arg_type) c.argument('auto_mitigate', arg_type=get_three_state_flag(), help='The flag that indicates whether the alert should be automatically resolved or not. The default is true.') c.argument('skip_query_validation', arg_type=get_three_state_flag(), diff --git a/src/scheduled-query/azext_scheduled_query/_validators.py b/src/scheduled-query/azext_scheduled_query/_validators.py index 89b6324a452..aa59a43b97b 100644 --- a/src/scheduled-query/azext_scheduled_query/_validators.py +++ b/src/scheduled-query/azext_scheduled_query/_validators.py @@ -4,25 +4,17 @@ # -------------------------------------------------------------------------------------------- -def get_action_group_validator(dest): - def validate_action_groups(cmd, namespace): - action_groups = getattr(namespace, dest, None) +def validate_tag(string): + result = {} + if string: + comps = string.split('=', 1) + result = {comps[0]: comps[1]} if len(comps) > 1 else {string: ''} + return result - if not action_groups: - return - from msrestazure.tools import is_valid_resource_id, resource_id - from azure.cli.core.commands.client_factory import get_subscription_id - - subscription = get_subscription_id(cmd.cli_ctx) - resource_group = namespace.resource_group_name - for group in action_groups: - if not is_valid_resource_id(group.action_groups): - group.action_groups = resource_id( - subscription=subscription, - resource_group=resource_group, - namespace='microsoft.insights', - type='actionGroups', - name=group.action_groups - ) - return validate_action_groups +def validate_custom_properties(ns): + if isinstance(ns.custom_properties, list): + custom_properties_dict = {} + for item in ns.custom_properties: + custom_properties_dict.update(validate_tag(item)) + ns.custom_properties = custom_properties_dict diff --git a/src/scheduled-query/azext_scheduled_query/custom.py b/src/scheduled-query/azext_scheduled_query/custom.py index 538a5776f12..2dc739c53a6 100644 --- a/src/scheduled-query/azext_scheduled_query/custom.py +++ b/src/scheduled-query/azext_scheduled_query/custom.py @@ -84,7 +84,8 @@ def update_scheduled_query(cmd, tags=None, disabled=None, condition=None, - actions=None, + action_groups=None, + custom_properties=None, condition_query=None, description=None, severity=None, @@ -100,7 +101,8 @@ def update_scheduled_query(cmd, c.set_param('tags', tags) c.set_param('enabled', not disabled) c.set_param('description', description) - c.set_param('actions', actions) + c.set_param('actions.action_groups', action_groups) + c.set_param('actions.custom_properties', custom_properties) c.set_param('severity', severity) c.set_param('window_size', window_size) c.set_param('evaluation_frequency', evaluation_frequency) diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml index e0315179262..098a19f90d0 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml @@ -18,7 +18,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:15:29 GMT + - Thu, 12 Aug 2021 07:15:47 GMT expires: - '-1' pragma: @@ -107,13 +107,13 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Mon, 09 Aug 2021 08:15:30 GMT + - Thu, 12 Aug 2021 07:15:48 GMT etag: - W/"54bceef15b892f2aa7f4c2145a49f1b5e33608722acdbb47933d7b6cbebbd7f4" expires: - - Mon, 09 Aug 2021 08:20:30 GMT + - Thu, 12 Aug 2021 07:20:48 GMT source-age: - - '165' + - '252' strict-transport-security: - max-age=31536000 vary: @@ -127,15 +127,15 @@ interactions: x-content-type-options: - nosniff x-fastly-request-id: - - 1908b01ba88a3972fc9383e5d4b36cbcf8b5618e + - cf163426f240f0f7bfa6665794ed72789b350496 x-frame-options: - deny x-github-request-id: - - F9FC:458D:5EA525:75BC2A:6110BD7D + - 798A:2D50:863A0:9AC27:61143736 x-served-by: - - cache-qpg1251-QPG + - cache-qpg1237-QPG x-timer: - - S1628496930.151542,VS0,VE1 + - S1628752548.321137,VS0,VE0 x-xss-protection: - 1; mode=block status: @@ -169,7 +169,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:15:30 GMT + - Thu, 12 Aug 2021 07:15:48 GMT expires: - '-1' pragma: @@ -213,7 +213,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:15:31 GMT + - Thu, 12 Aug 2021 07:15:48 GMT expires: - '-1' pragma: @@ -246,7 +246,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -255,7 +255,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:15:31 GMT + - Thu, 12 Aug 2021 07:15:49 GMT expires: - '-1' pragma: @@ -295,16 +295,16 @@ interactions: response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"b14a3ed3-a748-465a-b344-b889661debde\",\r\n \"provisioningState\": \"Creating\",\r\n + \"f0c2e1f3-a0b8-4c41-b8ab-a5834bc52878\",\r\n \"provisioningState\": \"Creating\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": - \"Mon, 09 Aug 2021 08:15:37 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \"Thu, 12 Aug 2021 07:15:57 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": - \"Tue, 10 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \"Fri, 13 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": - \"Enabled\",\r\n \"createdDate\": \"Mon, 09 Aug 2021 08:15:37 GMT\",\r\n - \ \"modifiedDate\": \"Mon, 09 Aug 2021 08:15:37 GMT\"\r\n },\r\n \"id\": + \"Enabled\",\r\n \"createdDate\": \"Thu, 12 Aug 2021 07:15:57 GMT\",\r\n + \ \"modifiedDate\": \"Thu, 12 Aug 2021 07:15:57 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\"\r\n}" @@ -316,7 +316,7 @@ interactions: content-type: - application/json date: - - Mon, 09 Aug 2021 08:15:38 GMT + - Thu, 12 Aug 2021 07:15:58 GMT pragma: - no-cache server: @@ -327,7 +327,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-powered-by: - ASP.NET - ASP.NET @@ -354,16 +354,16 @@ interactions: response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"b14a3ed3-a748-465a-b344-b889661debde\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \"f0c2e1f3-a0b8-4c41-b8ab-a5834bc52878\",\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": - \"Mon, 09 Aug 2021 08:15:37 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \"Thu, 12 Aug 2021 07:15:57 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": - \"Tue, 10 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \"Fri, 13 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": - \"Enabled\",\r\n \"createdDate\": \"Mon, 09 Aug 2021 08:15:37 GMT\",\r\n - \ \"modifiedDate\": \"Mon, 09 Aug 2021 08:15:38 GMT\"\r\n },\r\n \"id\": + \"Enabled\",\r\n \"createdDate\": \"Thu, 12 Aug 2021 07:15:57 GMT\",\r\n + \ \"modifiedDate\": \"Thu, 12 Aug 2021 07:15:59 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\"\r\n}" @@ -375,7 +375,7 @@ interactions: content-type: - application/json date: - - Mon, 09 Aug 2021 08:16:08 GMT + - Thu, 12 Aug 2021 07:16:28 GMT pragma: - no-cache server: @@ -422,7 +422,7 @@ interactions: "protectedSettings": {"workspaceKey": "[listKeys(parameters(''workspaceId''), ''2015-11-01-preview'').primarySharedKey]"}}, "name": "myvm1/OmsAgentForLinux", "location": "eastus", "dependsOn": ["Microsoft.Compute/virtualMachines/myvm1"]}, - {"apiVersion": "2021-03-01", "type": "Microsoft.Compute/virtualMachines", "name": + {"apiVersion": "2021-04-01", "type": "Microsoft.Compute/virtualMachines", "name": "myvm1", "location": "eastus", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/myvm1VMNic"], "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic", @@ -456,18 +456,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","name":"vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5225003549316136960","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-08-09T08:16:14.7260715Z","duration":"PT2.9640029S","correlationId":"11035b2b-8de6-4e37-a339-cb5974a44355","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","name":"vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","type":"Microsoft.Resources/deployments","properties":{"templateHash":"528526692898584574","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-08-12T07:16:34.7732141Z","duration":"PT3.1611033S","correlationId":"d7065d4e-462e-4d94-92d5-d736211fdb27","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz/operationStatuses/08585731099137155791?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh/operationStatuses/08585728542938655341?api-version=2021-04-01 cache-control: - no-cache content-length: - - '4226' + - '4225' content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:16:15 GMT + - Thu, 12 Aug 2021 07:16:36 GMT expires: - '-1' pragma: @@ -477,7 +477,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1198' status: code: 201 message: Created @@ -497,7 +497,49 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585731099137155791?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:17:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -509,7 +551,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:16:46 GMT + - Thu, 12 Aug 2021 07:17:37 GMT expires: - '-1' pragma: @@ -539,7 +581,7 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585731099137155791?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -551,7 +593,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:16 GMT + - Thu, 12 Aug 2021 07:18:07 GMT expires: - '-1' pragma: @@ -581,7 +623,7 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585731099137155791?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 response: body: string: '{"status":"Succeeded"}' @@ -593,7 +635,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:47 GMT + - Thu, 12 Aug 2021 07:18:38 GMT expires: - '-1' pragma: @@ -626,16 +668,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","name":"vm_deploy_LAgUiMw5oQQBTLlE4W4sR884kmZ82jJz","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5225003549316136960","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-08-09T08:17:44.3395847Z","duration":"PT1M32.5775161S","correlationId":"11035b2b-8de6-4e37-a339-cb5974a44355","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","name":"vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","type":"Microsoft.Resources/deployments","properties":{"templateHash":"528526692898584574","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-08-12T07:18:11.2563798Z","duration":"PT1M39.644269S","correlationId":"d7065d4e-462e-4d94-92d5-d736211fdb27","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' headers: cache-control: - no-cache content-length: - - '5533' + - '5531' content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:48 GMT + - Thu, 12 Aug 2021 07:18:38 GMT expires: - '-1' pragma: @@ -663,23 +705,23 @@ interactions: ParameterSetName: - -n -g --image --nsg-rule --workspace --generate-ssh-keys User-Agent: - - AZURECLI/2.27.0 azsdk-python-azure-mgmt-compute/22.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1?$expand=instanceView&api-version=2021-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1?$expand=instanceView&api-version=2021-04-01 response: body: string: "{\r\n \"name\": \"myvm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1\",\r\n \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"5d9e351b-7bfb-4717-9915-ebf031e09366\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"694eb79b-45cc-413b-b91e-2818780e36b5\",\r\n \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202107200\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": - \"Linux\",\r\n \"name\": \"myvm1_disk1_26e202a743864d8cbab529030567bf09\",\r\n + \"Linux\",\r\n \"name\": \"myvm1_disk1_ecd766cb463940b994ab2c19b9dfdd46\",\r\n \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/disks/myvm1_disk1_26e202a743864d8cbab529030567bf09\"\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/disks/myvm1_disk1_ecd766cb463940b994ab2c19b9dfdd46\"\r\n \ },\r\n \"diskSizeGB\": 30,\r\n \"deleteOption\": \"Detach\"\r\n \ },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \ \"computerName\": \"myvm1\",\r\n \"adminUsername\": \"v-jingszhang\",\r\n @@ -698,16 +740,16 @@ interactions: [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \"message\": \"Guest Agent is running\",\r\n \"time\": - \"2021-08-09T08:17:38+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + \"2021-08-12T07:18:08+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \ \"typeHandlerVersion\": \"1.13.35\",\r\n \"status\": {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \"message\": \"Plugin enabled\"\r\n }\r\n }\r\n ]\r\n },\r\n - \ \"disks\": [\r\n {\r\n \"name\": \"myvm1_disk1_26e202a743864d8cbab529030567bf09\",\r\n + \ \"disks\": [\r\n {\r\n \"name\": \"myvm1_disk1_ecd766cb463940b994ab2c19b9dfdd46\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-08-09T08:16:36.9071621+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-08-12T07:17:02.4425898+00:00\"\r\n \ }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\n \"name\": \"OmsAgentForLinux\",\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \"typeHandlerVersion\": @@ -718,7 +760,7 @@ interactions: \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n - \ \"time\": \"2021-08-09T08:17:42.8451276+00:00\"\r\n },\r\n + \ \"time\": \"2021-08-12T07:18:09.6149842+00:00\"\r\n },\r\n \ {\r\n \"code\": \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n }\r\n \ ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\n \"name\": @@ -727,7 +769,7 @@ interactions: \"eastus\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\",\r\n \"publisher\": \"Microsoft.EnterpriseCloud.Monitoring\",\r\n \"type\": \"OmsAgentForLinux\",\r\n - \ \"typeHandlerVersion\": \"1.0\",\r\n \"settings\": {\"workspaceId\":\"b14a3ed3-a748-465a-b344-b889661debde\",\"stopOnMultipleConnections\":\"true\"}\r\n + \ \"typeHandlerVersion\": \"1.0\",\r\n \"settings\": {\"workspaceId\":\"f0c2e1f3-a0b8-4c41-b8ab-a5834bc52878\",\"stopOnMultipleConnections\":\"true\"}\r\n \ }\r\n }\r\n ]\r\n}" headers: cache-control: @@ -737,7 +779,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:49 GMT + - Thu, 12 Aug 2021 07:18:39 GMT expires: - '-1' pragma: @@ -754,7 +796,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31969 + - Microsoft.Compute/LowCostGet3Min;3989,Microsoft.Compute/LowCostGet30Min;31975 status: code: 200 message: OK @@ -778,12 +820,12 @@ interactions: response: body: string: "{\r\n \"name\": \"myvm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\",\r\n - \ \"etag\": \"W/\\\"a7775114-c4bb-4262-ba07-814795772f53\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"34f8edfd-a63a-4fed-b64e-7fb14946c0fa\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"20f5a66f-e5b5-48ae-b2c0-eafa2daa19da\",\r\n + \"Succeeded\",\r\n \"resourceGuid\": \"c85ed092-e6a9-4645-91e8-5c976f2fa1cc\",\r\n \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigmyvm1\",\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\",\r\n - \ \"etag\": \"W/\\\"a7775114-c4bb-4262-ba07-814795772f53\\\"\",\r\n + \ \"etag\": \"W/\\\"34f8edfd-a63a-4fed-b64e-7fb14946c0fa\\\"\",\r\n \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -792,8 +834,8 @@ interactions: \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": - \"lfrmq0n2wbnezjizv5dwucatze.bx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": - \"00-0D-3A-54-98-71\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \"qducb03k50bephaohnmy1u32af.bx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-20-0A-ED\",\r\n \"enableAcceleratedNetworking\": false,\r\n \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG\"\r\n \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": @@ -807,9 +849,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:50 GMT + - Thu, 12 Aug 2021 07:18:40 GMT etag: - - W/"a7775114-c4bb-4262-ba07-814795772f53" + - W/"34f8edfd-a63a-4fed-b64e-7fb14946c0fa" expires: - '-1' pragma: @@ -826,7 +868,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d3843776-5915-4730-8b8f-41f601373fd5 + - 16d7ac70-5369-403c-a882-63d178df1d0c status: code: 200 message: OK @@ -850,11 +892,11 @@ interactions: response: body: string: "{\r\n \"name\": \"myvm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP\",\r\n - \ \"etag\": \"W/\\\"a35c8adb-dda7-4b96-8048-69fdeb0b5a50\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"32dc11bb-718d-4719-81a5-bb1d6b4a4299\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"0e21542c-bfb3-42b7-9282-be83a4c7c46f\",\r\n - \ \"ipAddress\": \"52.168.93.96\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n - \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": + \"Succeeded\",\r\n \"resourceGuid\": \"dc6c48ea-92e1-4235-9d75-a4f115b5af4a\",\r\n + \ \"ipAddress\": \"52.152.221.138\",\r\n \"publicIPAddressVersion\": + \"IPv4\",\r\n \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\"\r\n \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n \ \"sku\": {\r\n \"name\": \"Basic\"\r\n }\r\n}" @@ -862,13 +904,13 @@ interactions: cache-control: - no-cache content-length: - - '1004' + - '1006' content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:50 GMT + - Thu, 12 Aug 2021 07:18:41 GMT etag: - - W/"a35c8adb-dda7-4b96-8048-69fdeb0b5a50" + - W/"32dc11bb-718d-4719-81a5-bb1d6b4a4299" expires: - '-1' pragma: @@ -885,7 +927,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5533a04c-6313-44fb-aa0f-2d202556415f + - 07cbbfaf-db54-4a4f-bd34-82d1c0284ea8 status: code: 200 message: OK @@ -912,7 +954,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2021-08-09T08%3A17%3A51.7319018Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2021-08-12T07%3A18%3A43.5159275Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -921,7 +963,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:51 GMT + - Thu, 12 Aug 2021 07:18:43 GMT expires: - '-1' pragma: @@ -937,7 +979,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -971,7 +1013,7 @@ interactions: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Memory","performanceCounters":[{"counterName":"Available MBytes Memory"},{"counterName":"% Used Memory"},{"counterName":"% Used Swap - Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2021-08-09T08%3A17%3A52.3297901Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2021-08-12T07%3A18%3A44.3407856Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -980,7 +1022,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:52 GMT + - Thu, 12 Aug 2021 07:18:44 GMT expires: - '-1' pragma: @@ -996,7 +1038,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' x-powered-by: - ASP.NET status: @@ -1028,7 +1070,7 @@ interactions: response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Processor","performanceCounters":[{"counterName":"% - Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2021-08-09T08%3A17%3A52.9533361Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2021-08-12T07%3A18%3A44.9925089Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1037,7 +1079,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:52 GMT + - Thu, 12 Aug 2021 07:18:45 GMT expires: - '-1' pragma: @@ -1053,7 +1095,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1196' x-powered-by: - ASP.NET status: @@ -1089,7 +1131,7 @@ interactions: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Logical Disk","performanceCounters":[{"counterName":"% Used Inodes"},{"counterName":"Free Megabytes"},{"counterName":"% Used Space"},{"counterName":"Disk Transfers/sec"},{"counterName":"Disk - Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2021-08-09T08%3A17%3A53.6843641Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2021-08-12T07%3A18%3A45.6797935Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1098,7 +1140,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:53 GMT + - Thu, 12 Aug 2021 07:18:45 GMT expires: - '-1' pragma: @@ -1114,7 +1156,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1195' x-powered-by: - ASP.NET status: @@ -1146,7 +1188,7 @@ interactions: response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Network","performanceCounters":[{"counterName":"Total - Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2021-08-09T08%3A17%3A54.3809313Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2021-08-12T07%3A18%3A46.4093676Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1155,7 +1197,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:54 GMT + - Thu, 12 Aug 2021 07:18:46 GMT expires: - '-1' pragma: @@ -1171,7 +1213,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1194' x-powered-by: - ASP.NET status: @@ -1200,7 +1242,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2021-08-09T08%3A17%3A55.0886352Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2021-08-12T07%3A18%3A47.2158215Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1209,7 +1251,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:55 GMT + - Thu, 12 Aug 2021 07:18:47 GMT expires: - '-1' pragma: @@ -1225,7 +1267,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1194' + - '1193' x-powered-by: - ASP.NET status: @@ -1255,7 +1297,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2021-08-09T08%3A17%3A55.9793238Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2021-08-12T07%3A18%3A48.1070482Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1264,7 +1306,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:17:56 GMT + - Thu, 12 Aug 2021 07:18:48 GMT expires: - '-1' pragma: @@ -1280,7 +1322,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1192' x-powered-by: - ASP.NET status: @@ -1305,7 +1347,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1314,7 +1356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:20:56 GMT + - Thu, 12 Aug 2021 07:21:49 GMT expires: - '-1' pragma: @@ -1358,7 +1400,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:02.9063216Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:21:54.0551514Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1369,7 +1411,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:08 GMT + - Thu, 12 Aug 2021 07:22:00 GMT expires: - '-1' pragma: @@ -1381,13 +1423,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-09T08:22:02.9148731Z' + - '2021-08-12T07:22:54.0599966Z' status: code: 201 message: Created @@ -1410,7 +1452,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-09T08:15:26Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1419,7 +1461,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:09 GMT + - Thu, 12 Aug 2021 07:22:01 GMT expires: - '-1' pragma: @@ -1463,7 +1505,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq02?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:14.9448475Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:14.9448475Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:04.9750986Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:04.9750986Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1474,7 +1516,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:20 GMT + - Thu, 12 Aug 2021 07:22:08 GMT expires: - '-1' pragma: @@ -1486,13 +1528,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-09T08:22:15.0218886Z' + - '2021-08-12T07:23:04.9810758Z' status: code: 201 message: Created @@ -1516,7 +1558,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:02.9063216Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:21:54.0551514Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1527,7 +1569,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:21 GMT + - Thu, 12 Aug 2021 07:22:09 GMT expires: - '-1' pragma: @@ -1576,7 +1618,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:22.6801046Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:10.1820983Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1587,7 +1629,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:26 GMT + - Thu, 12 Aug 2021 07:22:14 GMT expires: - '-1' pragma: @@ -1603,13 +1645,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-09T08:22:22.6846374Z' + - '2021-08-12T07:23:10.2972849Z' status: code: 200 message: OK @@ -1632,7 +1674,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:22.6801046Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:10.1820983Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1643,7 +1685,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:26 GMT + - Thu, 12 Aug 2021 07:22:15 GMT expires: - '-1' pragma: @@ -1691,7 +1733,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}}' headers: @@ -1702,7 +1744,333 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:30 GMT + - Thu, 12 Aug 2021 07:22:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2021-08-12T07:23:16.1794999Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "global", "properties": {"groupShortName": "clitestaxmye", + "enabled": true, "emailReceivers": [], "smsReceivers": [], "webhookReceivers": + [], "itsmReceivers": [], "azureAppPushReceivers": [], "automationRunbookReceivers": + [], "voiceReceivers": [], "logicAppReceivers": [], "azureFunctionReceivers": + [], "armRoleReceivers": []}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor action-group create + Connection: + - keep-alive + Content-Length: + - '340' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003","type":"Microsoft.Insights/ActionGroups","name":"clitest000003","location":"Global","kind":null,"tags":null,"properties":{"groupShortName":"clitestaxmye","enabled":true,"emailReceivers":[],"smsReceivers":[],"webhookReceivers":[],"itsmReceivers":[],"azureAppPushReceivers":[],"automationRunbookReceivers":[],"voiceReceivers":[],"logicAppReceivers":[],"azureFunctionReceivers":[],"armRoleReceivers":[]},"identity":null}' + headers: + cache-control: + - no-cache + content-length: + - '638' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:22:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '24' + status: + code: 201 + message: Created +- request: + body: '{"location": "global", "properties": {"groupShortName": "clitestbrqdf", + "enabled": true, "emailReceivers": [], "smsReceivers": [], "webhookReceivers": + [], "itsmReceivers": [], "azureAppPushReceivers": [], "automationRunbookReceivers": + [], "voiceReceivers": [], "logicAppReceivers": [], "azureFunctionReceivers": + [], "armRoleReceivers": []}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor action-group create + Connection: + - keep-alive + Content-Length: + - '340' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-monitor/2.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004","type":"Microsoft.Insights/ActionGroups","name":"clitest000004","location":"Global","kind":null,"tags":null,"properties":{"groupShortName":"clitestbrqdf","enabled":true,"emailReceivers":[],"smsReceivers":[],"webhookReceivers":[],"itsmReceivers":[],"azureAppPushReceivers":[],"automationRunbookReceivers":[],"voiceReceivers":[],"logicAppReceivers":[],"azureFunctionReceivers":[],"armRoleReceivers":[]},"identity":null}' + headers: + cache-control: + - no-cache + content-length: + - '638' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:22:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '23' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query create + Connection: + - keep-alive + ParameterSetName: + - -g -n --scopes --condition --description --action-groups --custom-properties + User-Agent: + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:22:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"description": "Test rule", "severity": + 2, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"], + "evaluationFrequency": "PT5M", "windowSize": "PT5M", "criteria": {"allOf": [{"query": + "union Event, Syslog | where TimeGenerated > ago(1h)", "timeAggregation": "Count", + "resourceIdColumn": "_ResourceId", "dimensions": [], "operator": "GreaterThan", + "threshold": 360.0, "failingPeriods": {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": + 1}}]}, "actions": {"actionGroups": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003"], + "customProperties": {"k1": "v1"}}, "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": false, "autoMitigate": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query create + Connection: + - keep-alive + Content-Length: + - '985' + Content-Type: + - application/json + ParameterSetName: + - -g -n --scopes --condition --description --action-groups --custom-properties + User-Agent: + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq03?api-version=2021-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:39.0308227Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003"],"customProperties":{"k1":"v1"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1450' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:22:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2021-08-12T07:23:39.0949822Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query update + Connection: + - keep-alive + ParameterSetName: + - -g -n --action-groups --custom-properties + User-Agent: + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq03?api-version=2021-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:39.0308227Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003"],"customProperties":{"k1":"v1"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1450' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:22:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"description": "Test rule", "severity": + 2, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"], + "evaluationFrequency": "PT5M", "windowSize": "PT5M", "criteria": {"allOf": [{"query": + "union Event, Syslog | where TimeGenerated > ago(1h)", "timeAggregation": "Count", + "resourceIdColumn": "_ResourceId", "dimensions": [], "operator": "GreaterThan", + "threshold": 360.0, "failingPeriods": {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": + 1}}]}, "actions": {"actionGroups": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"], + "customProperties": {"k2": "v2"}}, "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": false, "autoMitigate": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query update + Connection: + - keep-alive + Content-Length: + - '985' + Content-Type: + - application/json + ParameterSetName: + - -g -n --action-groups --custom-properties + User-Agent: + - AZURECLI/2.27.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq03?api-version=2021-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:46.5848223Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"],"customProperties":{"k2":"v2"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1450' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 12 Aug 2021 07:22:51 GMT expires: - '-1' pragma: @@ -1724,7 +2092,7 @@ interactions: x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-09T08:22:28.9334437Z' + - '2021-08-12T07:23:46.5942531Z' status: code: 200 message: OK @@ -1747,7 +2115,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}}' headers: @@ -1758,7 +2126,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:30 GMT + - Thu, 12 Aug 2021 07:22:52 GMT expires: - '-1' pragma: @@ -1795,20 +2163,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules?api-version=2021-02-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:14.9448475Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:14.9448475Z"},"properties":{"description":"Test + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:04.9750986Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:04.9750986Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:46.5848223Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"],"customProperties":{"k2":"v2"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' headers: cache-control: - no-cache content-length: - - '2450' + - '3901' content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:31 GMT + - Thu, 12 Aug 2021 07:22:53 GMT expires: - '-1' pragma: @@ -1843,32 +2213,26 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/scheduledQueryRules?api-version=2021-02-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq1","name":"sq1","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T05:42:50.6351555Z"},"properties":{"description":"Test - rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq2","name":"sq2","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T04:52:27.5193087Z"},"properties":{"description":"Test - rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq3","name":"sq3","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T06:35:10.1893613Z"},"properties":{"description":"Test - rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq4","name":"sq4","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T06:05:43.9144999Z"},"properties":{"description":"Test + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq5","name":"sq5","type":"microsoft.insights/scheduledqueryrules","location":"eastus","tags":{"k2":"v22"},"systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T06:50:56.3368937Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq5","name":"sq5","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:09:46.6790486Z"},"properties":{"description":"Test + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["ag1"],"customProperties":{"k1":"v11"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq1","name":"sq1","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T06:50:36.6750367Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq6","name":"sq6","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T07:31:45.8695596Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T07:34:45.2039879Z"},"properties":{"description":"Test - rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:02.9063216Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:28.1058111Z"},"properties":{"description":"Test + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-09T08:21:14.9448475Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-09T08:21:14.9448475Z"},"properties":{"description":"Test + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:04.9750986Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:04.9750986Z"},"properties":{"description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:46.5848223Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"],"customProperties":{"k2":"v2"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' headers: cache-control: - no-cache content-length: - - '8286' + - '5892' content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:32 GMT + - Thu, 12 Aug 2021 07:22:53 GMT expires: - '-1' pragma: @@ -1914,7 +2278,7 @@ interactions: content-length: - '0' date: - - Mon, 09 Aug 2021 08:21:43 GMT + - Thu, 12 Aug 2021 07:23:02 GMT expires: - '-1' pragma: @@ -1960,7 +2324,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 09 Aug 2021 08:21:43 GMT + - Thu, 12 Aug 2021 07:23:04 GMT expires: - '-1' pragma: diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py b/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py index 92ca4dc25d9..d7d80909405 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py @@ -22,9 +22,12 @@ def test_scheduled_query(self, resource_group): self.kwargs.update({ 'name1': 'sq01', 'name2': 'sq02', + 'name3': 'sq03', 'rg': resource_group, 'vm': 'myvm1', - 'ws': self.create_random_name('clitest', 20) + 'ws': self.create_random_name('clitest', 20), + 'action_group1': self.create_random_name('clitest', 20), + 'action_group2': self.create_random_name('clitest', 20) }) with mock.patch('azure.cli.command_modules.vm.custom._gen_guid', side_effect=self.create_guid): vm = self.cmd('vm create -n {vm} -g {rg} --image UbuntuLTS --nsg-rule None --workspace {ws} --generate-ssh-keys').get_output_in_json() @@ -79,13 +82,27 @@ def test_scheduled_query(self, resource_group): self.check('muteActionsDuration', '0:30:00'), self.check('autoMitigate', False) ]) + action_group_1 = self.cmd('monitor action-group create -n {action_group1} -g {rg}').get_output_in_json() + action_group_2 = self.cmd('monitor action-group create -n {action_group2} -g {rg}').get_output_in_json() + self.kwargs.update({ + 'action_group_id_1': action_group_1['id'], + 'action_group_id_2': action_group_2['id'] + }) + self.cmd('monitor scheduled-query create -g {rg} -n {name3} --scopes {rg_id} --condition "count \'union Event, Syslog | where TimeGenerated > ago(1h)\' > 360 resource id _ResourceId" --description "Test rule" --action-groups {action_group_id_1} --custom-properties k1=v1', checks=[ + self.check('actions.actionGroups', [action_group_1['id']]), + self.check('actions.customProperties', {'k1':'v1'}) + ]) + self.cmd('monitor scheduled-query update -g {rg} -n {name3} --action-groups {action_group_id_2} --custom-properties k2=v2', checks=[ + self.check('actions.actionGroups', [action_group_2['id']]), + self.check('actions.customProperties', {'k2':'v2'}) + ]) self.cmd('monitor scheduled-query show -g {rg} -n {name1}', checks=[ self.check('name', '{name1}') ]) self.cmd('monitor scheduled-query list -g {rg}', checks=[ - self.check('length(@)', 2) + self.check('length(@)', 3) ]) self.cmd('monitor scheduled-query list', checks=[ From da581389f0231aefb04e657eafc627072a8a6a2f Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 13 Aug 2021 10:58:35 +0800 Subject: [PATCH 7/9] Update test_scheduled_query.yaml --- .../recordings/test_scheduled_query.yaml | 326 ++++++++++-------- 1 file changed, 182 insertions(+), 144 deletions(-) diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml index 098a19f90d0..ec3a359df3b 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query.yaml @@ -18,7 +18,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-13T02:27:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:15:47 GMT + - Fri, 13 Aug 2021 02:27:28 GMT expires: - '-1' pragma: @@ -107,13 +107,13 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Thu, 12 Aug 2021 07:15:48 GMT + - Fri, 13 Aug 2021 02:27:29 GMT etag: - W/"54bceef15b892f2aa7f4c2145a49f1b5e33608722acdbb47933d7b6cbebbd7f4" expires: - - Thu, 12 Aug 2021 07:20:48 GMT + - Fri, 13 Aug 2021 02:32:29 GMT source-age: - - '252' + - '270' strict-transport-security: - max-age=31536000 vary: @@ -127,15 +127,15 @@ interactions: x-content-type-options: - nosniff x-fastly-request-id: - - cf163426f240f0f7bfa6665794ed72789b350496 + - ad890af6384503585aebf0b6809659de3ea28531 x-frame-options: - deny x-github-request-id: - - 798A:2D50:863A0:9AC27:61143736 + - DF62:256E:3681:A077:6115C90F x-served-by: - - cache-qpg1237-QPG + - cache-qpg1280-QPG x-timer: - - S1628752548.321137,VS0,VE0 + - S1628821649.123927,VS0,VE1 x-xss-protection: - 1; mode=block status: @@ -169,7 +169,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:15:48 GMT + - Fri, 13 Aug 2021 02:27:28 GMT expires: - '-1' pragma: @@ -213,7 +213,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:15:48 GMT + - Fri, 13 Aug 2021 02:27:30 GMT expires: - '-1' pragma: @@ -246,7 +246,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-13T02:27:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -255,7 +255,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:15:49 GMT + - Fri, 13 Aug 2021 02:27:30 GMT expires: - '-1' pragma: @@ -295,16 +295,16 @@ interactions: response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"f0c2e1f3-a0b8-4c41-b8ab-a5834bc52878\",\r\n \"provisioningState\": \"Creating\",\r\n + \"b592e84d-2dc5-496a-8e88-645ee1f0ebff\",\r\n \"provisioningState\": \"Creating\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": - \"Thu, 12 Aug 2021 07:15:57 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \"Fri, 13 Aug 2021 02:27:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": - \"Fri, 13 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \"Fri, 13 Aug 2021 18:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": - \"Enabled\",\r\n \"createdDate\": \"Thu, 12 Aug 2021 07:15:57 GMT\",\r\n - \ \"modifiedDate\": \"Thu, 12 Aug 2021 07:15:57 GMT\"\r\n },\r\n \"id\": + \"Enabled\",\r\n \"createdDate\": \"Fri, 13 Aug 2021 02:27:39 GMT\",\r\n + \ \"modifiedDate\": \"Fri, 13 Aug 2021 02:27:39 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\"\r\n}" @@ -316,7 +316,7 @@ interactions: content-type: - application/json date: - - Thu, 12 Aug 2021 07:15:58 GMT + - Fri, 13 Aug 2021 02:27:40 GMT pragma: - no-cache server: @@ -354,16 +354,16 @@ interactions: response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": - \"f0c2e1f3-a0b8-4c41-b8ab-a5834bc52878\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \"b592e84d-2dc5-496a-8e88-645ee1f0ebff\",\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": - \"Thu, 12 Aug 2021 07:15:57 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \"Fri, 13 Aug 2021 02:27:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": - \"Fri, 13 Aug 2021 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \"Fri, 13 Aug 2021 18:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": - \"Enabled\",\r\n \"createdDate\": \"Thu, 12 Aug 2021 07:15:57 GMT\",\r\n - \ \"modifiedDate\": \"Thu, 12 Aug 2021 07:15:59 GMT\"\r\n },\r\n \"id\": + \"Enabled\",\r\n \"createdDate\": \"Fri, 13 Aug 2021 02:27:39 GMT\",\r\n + \ \"modifiedDate\": \"Fri, 13 Aug 2021 02:27:40 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \ \"location\": \"eastus\"\r\n}" @@ -375,7 +375,7 @@ interactions: content-type: - application/json date: - - Thu, 12 Aug 2021 07:16:28 GMT + - Fri, 13 Aug 2021 02:28:10 GMT pragma: - no-cache server: @@ -456,18 +456,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","name":"vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","type":"Microsoft.Resources/deployments","properties":{"templateHash":"528526692898584574","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-08-12T07:16:34.7732141Z","duration":"PT3.1611033S","correlationId":"d7065d4e-462e-4d94-92d5-d736211fdb27","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_VzhdXwfUsaPaPOjurqGAEXuPOiTkgvLv","name":"vm_deploy_VzhdXwfUsaPaPOjurqGAEXuPOiTkgvLv","type":"Microsoft.Resources/deployments","properties":{"templateHash":"14958276402317583836","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-08-13T02:28:16.8219031Z","duration":"PT2.8240266S","correlationId":"fa3022e9-2358-47b9-84b1-5a7a6cd22523","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh/operationStatuses/08585728542938655341?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_VzhdXwfUsaPaPOjurqGAEXuPOiTkgvLv/operationStatuses/08585727851914797639?api-version=2021-04-01 cache-control: - no-cache content-length: - - '4225' + - '4227' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:16:36 GMT + - Fri, 13 Aug 2021 02:28:17 GMT expires: - '-1' pragma: @@ -477,7 +477,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -497,7 +497,7 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585727851914797639?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -509,7 +509,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:17:07 GMT + - Fri, 13 Aug 2021 02:28:48 GMT expires: - '-1' pragma: @@ -539,7 +539,7 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585727851914797639?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -551,7 +551,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:17:37 GMT + - Fri, 13 Aug 2021 02:29:18 GMT expires: - '-1' pragma: @@ -581,7 +581,7 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585727851914797639?api-version=2021-04-01 response: body: string: '{"status":"Running"}' @@ -593,7 +593,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:07 GMT + - Fri, 13 Aug 2021 02:29:49 GMT expires: - '-1' pragma: @@ -623,7 +623,49 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585728542938655341?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585727851914797639?api-version=2021-04-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 13 Aug 2021 02:30:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.27.0 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585727851914797639?api-version=2021-04-01 response: body: string: '{"status":"Succeeded"}' @@ -635,7 +677,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:38 GMT + - Fri, 13 Aug 2021 02:30:50 GMT expires: - '-1' pragma: @@ -668,16 +710,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","name":"vm_deploy_YnSVCx08egZYXIekvAAGRpkdE2PzrZwh","type":"Microsoft.Resources/deployments","properties":{"templateHash":"528526692898584574","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-08-12T07:18:11.2563798Z","duration":"PT1M39.644269S","correlationId":"d7065d4e-462e-4d94-92d5-d736211fdb27","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Resources/deployments/vm_deploy_VzhdXwfUsaPaPOjurqGAEXuPOiTkgvLv","name":"vm_deploy_VzhdXwfUsaPaPOjurqGAEXuPOiTkgvLv","type":"Microsoft.Resources/deployments","properties":{"templateHash":"14958276402317583836","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-08-13T02:30:39.610909Z","duration":"PT2M25.6130325S","correlationId":"fa3022e9-2358-47b9-84b1-5a7a6cd22523","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.operationalinsights/workspaces/clitest000002","resourceType":"microsoft.operationalinsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' headers: cache-control: - no-cache content-length: - - '5531' + - '5533' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:38 GMT + - Fri, 13 Aug 2021 02:30:51 GMT expires: - '-1' pragma: @@ -707,21 +749,21 @@ interactions: User-Agent: - AZURECLI/2.27.0 azsdk-python-azure-mgmt-compute/22.1.0 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1?$expand=instanceView&api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1?$expand=instanceView&api-version=2021-03-01 response: body: string: "{\r\n \"name\": \"myvm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1\",\r\n \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"694eb79b-45cc-413b-b91e-2818780e36b5\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"bdc70fcf-8b00-469c-a24d-30518f579aff\",\r\n \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202107200\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": - \"Linux\",\r\n \"name\": \"myvm1_disk1_ecd766cb463940b994ab2c19b9dfdd46\",\r\n + \"Linux\",\r\n \"name\": \"myvm1_disk1_5ba5ab2fb25845e1908b787f7e07d82e\",\r\n \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/disks/myvm1_disk1_ecd766cb463940b994ab2c19b9dfdd46\"\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/disks/myvm1_disk1_5ba5ab2fb25845e1908b787f7e07d82e\"\r\n \ },\r\n \"diskSizeGB\": 30,\r\n \"deleteOption\": \"Detach\"\r\n \ },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n \ \"computerName\": \"myvm1\",\r\n \"adminUsername\": \"v-jingszhang\",\r\n @@ -740,16 +782,16 @@ interactions: [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ \"message\": \"Guest Agent is running\",\r\n \"time\": - \"2021-08-12T07:18:08+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + \"2021-08-13T02:30:35+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": [\r\n {\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \ \"typeHandlerVersion\": \"1.13.35\",\r\n \"status\": {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \"message\": \"Plugin enabled\"\r\n }\r\n }\r\n ]\r\n },\r\n - \ \"disks\": [\r\n {\r\n \"name\": \"myvm1_disk1_ecd766cb463940b994ab2c19b9dfdd46\",\r\n + \ \"disks\": [\r\n {\r\n \"name\": \"myvm1_disk1_5ba5ab2fb25845e1908b787f7e07d82e\",\r\n \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-08-12T07:17:02.4425898+00:00\"\r\n + succeeded\",\r\n \"time\": \"2021-08-13T02:28:42.8804033+00:00\"\r\n \ }\r\n ]\r\n }\r\n ],\r\n \"extensions\": [\r\n {\r\n \"name\": \"OmsAgentForLinux\",\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \"typeHandlerVersion\": @@ -760,7 +802,7 @@ interactions: \ \"hyperVGeneration\": \"V1\",\r\n \"statuses\": [\r\n {\r\n \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n - \ \"time\": \"2021-08-12T07:18:09.6149842+00:00\"\r\n },\r\n + \ \"time\": \"2021-08-13T02:30:38.006282+00:00\"\r\n },\r\n \ {\r\n \"code\": \"PowerState/running\",\r\n \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n }\r\n \ ]\r\n }\r\n },\r\n \"resources\": [\r\n {\r\n \"name\": @@ -769,17 +811,17 @@ interactions: \"eastus\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\",\r\n \"publisher\": \"Microsoft.EnterpriseCloud.Monitoring\",\r\n \"type\": \"OmsAgentForLinux\",\r\n - \ \"typeHandlerVersion\": \"1.0\",\r\n \"settings\": {\"workspaceId\":\"f0c2e1f3-a0b8-4c41-b8ab-a5834bc52878\",\"stopOnMultipleConnections\":\"true\"}\r\n + \ \"typeHandlerVersion\": \"1.0\",\r\n \"settings\": {\"workspaceId\":\"b592e84d-2dc5-496a-8e88-645ee1f0ebff\",\"stopOnMultipleConnections\":\"true\"}\r\n \ }\r\n }\r\n ]\r\n}" headers: cache-control: - no-cache content-length: - - '5533' + - '5532' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:39 GMT + - Fri, 13 Aug 2021 02:30:52 GMT expires: - '-1' pragma: @@ -796,7 +838,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3989,Microsoft.Compute/LowCostGet30Min;31975 + - Microsoft.Compute/LowCostGet3Min;3987,Microsoft.Compute/LowCostGet30Min;31959 status: code: 200 message: OK @@ -820,12 +862,12 @@ interactions: response: body: string: "{\r\n \"name\": \"myvm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\",\r\n - \ \"etag\": \"W/\\\"34f8edfd-a63a-4fed-b64e-7fb14946c0fa\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"6987e672-63cc-46cc-add0-e3ea9df536f4\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"c85ed092-e6a9-4645-91e8-5c976f2fa1cc\",\r\n + \"Succeeded\",\r\n \"resourceGuid\": \"c41ed55e-4998-4c89-bc86-2b6b8b4ccdb5\",\r\n \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigmyvm1\",\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\",\r\n - \ \"etag\": \"W/\\\"34f8edfd-a63a-4fed-b64e-7fb14946c0fa\\\"\",\r\n + \ \"etag\": \"W/\\\"6987e672-63cc-46cc-add0-e3ea9df536f4\\\"\",\r\n \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": @@ -834,8 +876,8 @@ interactions: \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": - \"qducb03k50bephaohnmy1u32af.bx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": - \"00-22-48-20-0A-ED\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \"g1jbnjcztsfehiwowli5jxlgig.bx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-1D-A2-3F\",\r\n \"enableAcceleratedNetworking\": false,\r\n \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG\"\r\n \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": @@ -849,9 +891,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:40 GMT + - Fri, 13 Aug 2021 02:30:53 GMT etag: - - W/"34f8edfd-a63a-4fed-b64e-7fb14946c0fa" + - W/"6987e672-63cc-46cc-add0-e3ea9df536f4" expires: - '-1' pragma: @@ -868,7 +910,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 16d7ac70-5369-403c-a882-63d178df1d0c + - 1133f0e9-8132-439b-8c3f-13785c9ecdab status: code: 200 message: OK @@ -892,11 +934,11 @@ interactions: response: body: string: "{\r\n \"name\": \"myvm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP\",\r\n - \ \"etag\": \"W/\\\"32dc11bb-718d-4719-81a5-bb1d6b4a4299\\\"\",\r\n \"location\": + \ \"etag\": \"W/\\\"0be9cfae-4aac-4961-a79b-7566d5a1cc4e\\\"\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"dc6c48ea-92e1-4235-9d75-a4f115b5af4a\",\r\n - \ \"ipAddress\": \"52.152.221.138\",\r\n \"publicIPAddressVersion\": - \"IPv4\",\r\n \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": + \"Succeeded\",\r\n \"resourceGuid\": \"63e43d99-2d03-4d1c-b30d-210ce0dce296\",\r\n + \ \"ipAddress\": \"20.185.37.136\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n + \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\"\r\n \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n \ \"sku\": {\r\n \"name\": \"Basic\"\r\n }\r\n}" @@ -904,13 +946,13 @@ interactions: cache-control: - no-cache content-length: - - '1006' + - '1005' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:41 GMT + - Fri, 13 Aug 2021 02:30:53 GMT etag: - - W/"32dc11bb-718d-4719-81a5-bb1d6b4a4299" + - W/"0be9cfae-4aac-4961-a79b-7566d5a1cc4e" expires: - '-1' pragma: @@ -927,7 +969,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 07cbbfaf-db54-4a4f-bd34-82d1c0284ea8 + - 237a24d3-401c-4877-bc8f-77d1b620917a status: code: 200 message: OK @@ -954,7 +996,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2021-08-12T07%3A18%3A43.5159275Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2021-08-13T02%3A30%3A54.9258500Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -963,7 +1005,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:43 GMT + - Fri, 13 Aug 2021 02:30:55 GMT expires: - '-1' pragma: @@ -1013,7 +1055,7 @@ interactions: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Memory","performanceCounters":[{"counterName":"Available MBytes Memory"},{"counterName":"% Used Memory"},{"counterName":"% Used Swap - Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2021-08-12T07%3A18%3A44.3407856Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2021-08-13T02%3A30%3A55.6702903Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1022,7 +1064,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:44 GMT + - Fri, 13 Aug 2021 02:30:55 GMT expires: - '-1' pragma: @@ -1070,7 +1112,7 @@ interactions: response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Processor","performanceCounters":[{"counterName":"% - Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2021-08-12T07%3A18%3A44.9925089Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2021-08-13T02%3A30%3A56.3579003Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1079,7 +1121,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:45 GMT + - Fri, 13 Aug 2021 02:30:56 GMT expires: - '-1' pragma: @@ -1131,7 +1173,7 @@ interactions: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Logical Disk","performanceCounters":[{"counterName":"% Used Inodes"},{"counterName":"Free Megabytes"},{"counterName":"% Used Space"},{"counterName":"Disk Transfers/sec"},{"counterName":"Disk - Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2021-08-12T07%3A18%3A45.6797935Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2021-08-13T02%3A30%3A57.0604291Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1140,7 +1182,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:45 GMT + - Fri, 13 Aug 2021 02:30:57 GMT expires: - '-1' pragma: @@ -1188,7 +1230,7 @@ interactions: response: body: string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Network","performanceCounters":[{"counterName":"Total - Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2021-08-12T07%3A18%3A46.4093676Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2021-08-13T02%3A30%3A57.7956829Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1197,7 +1239,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:46 GMT + - Fri, 13 Aug 2021 02:30:57 GMT expires: - '-1' pragma: @@ -1242,7 +1284,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2021-08-12T07%3A18%3A47.2158215Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2021-08-13T02%3A30%3A58.5189599Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1251,7 +1293,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:47 GMT + - Fri, 13 Aug 2021 02:30:58 GMT expires: - '-1' pragma: @@ -1297,7 +1339,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007?api-version=2020-08-01 response: body: - string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2021-08-12T07%3A18%3A48.1070482Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2021-08-13T02%3A30%3A59.2730824Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' headers: cache-control: - no-cache @@ -1306,7 +1348,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:18:48 GMT + - Fri, 13 Aug 2021 02:30:59 GMT expires: - '-1' pragma: @@ -1347,7 +1389,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-13T02:27:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1356,7 +1398,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:21:49 GMT + - Fri, 13 Aug 2021 02:34:00 GMT expires: - '-1' pragma: @@ -1400,7 +1442,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:21:54.0551514Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:06.7668957Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1411,7 +1453,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:00 GMT + - Fri, 13 Aug 2021 02:34:14 GMT expires: - '-1' pragma: @@ -1423,13 +1465,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-12T07:22:54.0599966Z' + - '2021-08-13T02:35:06.7749703Z' status: code: 201 message: Created @@ -1452,7 +1494,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-13T02:27:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1461,7 +1503,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:01 GMT + - Fri, 13 Aug 2021 02:34:15 GMT expires: - '-1' pragma: @@ -1505,7 +1547,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq02?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:04.9750986Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:04.9750986Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:18.3768984Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:18.3768984Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1516,7 +1558,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:08 GMT + - Fri, 13 Aug 2021 02:34:22 GMT expires: - '-1' pragma: @@ -1528,13 +1570,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-12T07:23:04.9810758Z' + - '2021-08-13T02:35:18.3837161Z' status: code: 201 message: Created @@ -1558,7 +1600,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:21:54.0551514Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:06.7668957Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1569,7 +1611,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:09 GMT + - Fri, 13 Aug 2021 02:34:23 GMT expires: - '-1' pragma: @@ -1618,18 +1660,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:10.1820983Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:24.411898Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: cache-control: - no-cache content-length: - - '1226' + - '1225' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:14 GMT + - Fri, 13 Aug 2021 02:34:25 GMT expires: - '-1' pragma: @@ -1649,9 +1691,9 @@ interactions: x-rate-limit-limit: - 1m x-rate-limit-remaining: - - '14' + - '13' x-rate-limit-reset: - - '2021-08-12T07:23:10.2972849Z' + - '2021-08-13T02:35:06.7749703Z' status: code: 200 message: OK @@ -1674,18 +1716,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:10.1820983Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:24.411898Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: cache-control: - no-cache content-length: - - '1226' + - '1225' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:15 GMT + - Fri, 13 Aug 2021 02:34:26 GMT expires: - '-1' pragma: @@ -1733,7 +1775,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:27.6640127Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}}' headers: @@ -1744,7 +1786,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:19 GMT + - Fri, 13 Aug 2021 02:34:31 GMT expires: - '-1' pragma: @@ -1760,18 +1802,18 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-12T07:23:16.1794999Z' + - '2021-08-13T02:35:28.2983691Z' status: code: 200 message: OK - request: - body: '{"location": "global", "properties": {"groupShortName": "clitestaxmye", + body: '{"location": "global", "properties": {"groupShortName": "clitest3gwg3", "enabled": true, "emailReceivers": [], "smsReceivers": [], "webhookReceivers": [], "itsmReceivers": [], "azureAppPushReceivers": [], "automationRunbookReceivers": [], "voiceReceivers": [], "logicAppReceivers": [], "azureFunctionReceivers": @@ -1797,7 +1839,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003?api-version=2019-06-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003","type":"Microsoft.Insights/ActionGroups","name":"clitest000003","location":"Global","kind":null,"tags":null,"properties":{"groupShortName":"clitestaxmye","enabled":true,"emailReceivers":[],"smsReceivers":[],"webhookReceivers":[],"itsmReceivers":[],"azureAppPushReceivers":[],"automationRunbookReceivers":[],"voiceReceivers":[],"logicAppReceivers":[],"azureFunctionReceivers":[],"armRoleReceivers":[]},"identity":null}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003","type":"Microsoft.Insights/ActionGroups","name":"clitest000003","location":"Global","kind":null,"tags":null,"properties":{"groupShortName":"clitest3gwg3","enabled":true,"emailReceivers":[],"smsReceivers":[],"webhookReceivers":[],"itsmReceivers":[],"azureAppPushReceivers":[],"automationRunbookReceivers":[],"voiceReceivers":[],"logicAppReceivers":[],"azureFunctionReceivers":[],"armRoleReceivers":[]},"identity":null}' headers: cache-control: - no-cache @@ -1806,7 +1848,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:28 GMT + - Fri, 13 Aug 2021 02:34:41 GMT expires: - '-1' pragma: @@ -1823,7 +1865,7 @@ interactions: code: 201 message: Created - request: - body: '{"location": "global", "properties": {"groupShortName": "clitestbrqdf", + body: '{"location": "global", "properties": {"groupShortName": "clitest3cfsd", "enabled": true, "emailReceivers": [], "smsReceivers": [], "webhookReceivers": [], "itsmReceivers": [], "azureAppPushReceivers": [], "automationRunbookReceivers": [], "voiceReceivers": [], "logicAppReceivers": [], "azureFunctionReceivers": @@ -1849,7 +1891,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004?api-version=2019-06-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004","type":"Microsoft.Insights/ActionGroups","name":"clitest000004","location":"Global","kind":null,"tags":null,"properties":{"groupShortName":"clitestbrqdf","enabled":true,"emailReceivers":[],"smsReceivers":[],"webhookReceivers":[],"itsmReceivers":[],"azureAppPushReceivers":[],"automationRunbookReceivers":[],"voiceReceivers":[],"logicAppReceivers":[],"azureFunctionReceivers":[],"armRoleReceivers":[]},"identity":null}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004","type":"Microsoft.Insights/ActionGroups","name":"clitest000004","location":"Global","kind":null,"tags":null,"properties":{"groupShortName":"clitest3cfsd","enabled":true,"emailReceivers":[],"smsReceivers":[],"webhookReceivers":[],"itsmReceivers":[],"azureAppPushReceivers":[],"automationRunbookReceivers":[],"voiceReceivers":[],"logicAppReceivers":[],"azureFunctionReceivers":[],"armRoleReceivers":[]},"identity":null}' headers: cache-control: - no-cache @@ -1858,7 +1900,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:33 GMT + - Fri, 13 Aug 2021 02:34:47 GMT expires: - '-1' pragma: @@ -1870,7 +1912,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '23' + - '24' status: code: 201 message: Created @@ -1893,7 +1935,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-12T07:15:43Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001","name":"cli_test_scheduled_query000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2021-08-13T02:27:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -1902,7 +1944,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:33 GMT + - Fri, 13 Aug 2021 02:34:48 GMT expires: - '-1' pragma: @@ -1947,7 +1989,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq03?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:39.0308227Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:55.7368901Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:55.7368901Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003"],"customProperties":{"k1":"v1"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -1958,7 +2000,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:44 GMT + - Fri, 13 Aug 2021 02:34:59 GMT expires: - '-1' pragma: @@ -1976,7 +2018,7 @@ interactions: x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-12T07:23:39.0949822Z' + - '2021-08-13T02:35:55.9873765Z' status: code: 201 message: Created @@ -1999,7 +2041,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq03?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:39.0308227Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:55.7368901Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:55.7368901Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000003"],"customProperties":{"k1":"v1"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -2010,7 +2052,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:45 GMT + - Fri, 13 Aug 2021 02:35:00 GMT expires: - '-1' pragma: @@ -2059,7 +2101,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq03?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:46.5848223Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:55.7368901Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:35:01.6019148Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"],"customProperties":{"k2":"v2"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' headers: @@ -2070,7 +2112,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:51 GMT + - Fri, 13 Aug 2021 02:35:03 GMT expires: - '-1' pragma: @@ -2086,13 +2128,13 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' x-rate-limit-limit: - 1m x-rate-limit-remaining: - '14' x-rate-limit-reset: - - '2021-08-12T07:23:46.5942531Z' + - '2021-08-13T02:36:01.6075341Z' status: code: 200 message: OK @@ -2115,7 +2157,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-02-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:27.6640127Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}}' headers: @@ -2126,7 +2168,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:52 GMT + - Fri, 13 Aug 2021 02:35:04 GMT expires: - '-1' pragma: @@ -2163,11 +2205,11 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Insights/scheduledQueryRules?api-version=2021-02-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:27.6640127Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:04.9750986Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:04.9750986Z"},"properties":{"description":"Test + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:18.3768984Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:18.3768984Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:46.5848223Z"},"properties":{"description":"Test + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:55.7368901Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:35:01.6019148Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"],"customProperties":{"k2":"v2"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' headers: @@ -2178,7 +2220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:53 GMT + - Fri, 13 Aug 2021 02:35:05 GMT expires: - '-1' pragma: @@ -2213,26 +2255,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/scheduledQueryRules?api-version=2021-02-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq5","name":"sq5","type":"microsoft.insights/scheduledqueryrules","location":"eastus","tags":{"k2":"v22"},"systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T06:50:56.3368937Z"},"properties":{"description":"Test - rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["ag1"],"customProperties":{"k1":"v11"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/microsoft.insights/scheduledqueryrules/sq1","name":"sq1","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T06:50:36.6750367Z"},"properties":{"description":"Test - rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqtest/providers/Microsoft.Compute/virtualMachines/sqvm"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:21:54.0551514Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:16.1728238Z"},"properties":{"description":"Test + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:06.7668957Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:27.6640127Z"},"properties":{"description":"Test rule 2","severity":4,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union - Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:04.9750986Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:04.9750986Z"},"properties":{"description":"Test + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"LessThan","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":3,"minFailingPeriodsToAlert":2}}]},"autoMitigate":false,"muteActionsDuration":"PT30M","checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":true}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq02","name":"sq02","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:18.3768984Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:34:18.3768984Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union - Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-12T07:22:39.0308227Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T07:22:46.5848223Z"},"properties":{"description":"Test + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/scheduledqueryrules/sq03","name":"sq03","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2021-08-13T02:34:55.7368901Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-13T02:35:01.6019148Z"},"properties":{"description":"Test rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"resourceIdColumn":"_ResourceId","operator":"GreaterThan","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"actions":{"actionGroups":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query000001/providers/microsoft.insights/actionGroups/clitest000004"],"customProperties":{"k2":"v2"}},"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}]}' headers: cache-control: - no-cache content-length: - - '5892' + - '3901' content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:22:53 GMT + - Fri, 13 Aug 2021 02:35:06 GMT expires: - '-1' pragma: @@ -2278,7 +2316,7 @@ interactions: content-length: - '0' date: - - Thu, 12 Aug 2021 07:23:02 GMT + - Fri, 13 Aug 2021 02:35:16 GMT expires: - '-1' pragma: @@ -2324,7 +2362,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 Aug 2021 07:23:04 GMT + - Fri, 13 Aug 2021 02:35:16 GMT expires: - '-1' pragma: From d7206d89bcff196fe4ce984bdad9618a9542eb2e Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 13 Aug 2021 11:54:58 +0800 Subject: [PATCH 8/9] Update _params.py --- src/scheduled-query/azext_scheduled_query/_params.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scheduled-query/azext_scheduled_query/_params.py b/src/scheduled-query/azext_scheduled_query/_params.py index c1896dab0d4..ffb8925b16c 100644 --- a/src/scheduled-query/azext_scheduled_query/_params.py +++ b/src/scheduled-query/azext_scheduled_query/_params.py @@ -40,7 +40,6 @@ def load_arguments(self, _): c.argument('mute_actions_duration', type=get_period_type(as_timedelta=True), options_list=['--mute-actions-duration', '--mad'], help='Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired.') - c.argument('actions', options_list=['--action', '-a'], nargs='+', deprecate_info=c.deprecate(redirect='--actions', hide=True)) c.argument('action_groups', options_list=['--action-groups'], nargs='+', help='Action Group resource Ids to invoke when the alert fires.') c.argument('custom_properties', custom_properties_arg_type) c.argument('auto_mitigate', arg_type=get_three_state_flag(), From b611640e37289d31eb8f635dd31558103b22c56c Mon Sep 17 00:00:00 2001 From: songlu <442586197@QQ.COM> Date: Fri, 13 Aug 2021 14:05:34 +0800 Subject: [PATCH 9/9] Update HISTORY.rst --- src/scheduled-query/HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scheduled-query/HISTORY.rst b/src/scheduled-query/HISTORY.rst index fc2c58c00cf..76e75c74ba9 100644 --- a/src/scheduled-query/HISTORY.rst +++ b/src/scheduled-query/HISTORY.rst @@ -8,6 +8,7 @@ Release History * Add `--check-ws-alerts-storage` parameter * Add `--auto-mitigate` parameter * [Breaking Change] `--actions` are split into `--action-groups` and `--custom-properties` +* [Breaking Change] the default value of `--mute-actions-duration` is changed to None 0.3.1 ++++++