Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/monitor/azure-monitor-query/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Bump minimum dependency on `azure-core` to `>=1.37.0`.

## 2.0.0 (2025-07-30)

### Breaking Changes
Expand Down
5 changes: 4 additions & 1 deletion sdk/monitor/azure-monitor-query/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"apiVersion": "v1"
"apiVersion": "v1",
"apiVersions": {
"MonitorQueryLogs": "v1"
}
}
4 changes: 1 addition & 3 deletions sdk/monitor/azure-monitor-query/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"CrossLanguagePackageId": "MonitorQueryLogs",
"CrossLanguageDefinitionId": {
"azure.monitor.query.models._ColumnType": "MonitorQueryLogs.ColumnDataType"
}
"CrossLanguageDefinitionId": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from azure.core.rest import HttpRequest, HttpResponse

from ._configuration import MonitorQueryLogsClientConfiguration
from ._operations._operations import _MonitorQueryLogsClientOperationsMixin
from ._operations import _MonitorQueryLogsClientOperationsMixin
from ._utils.serialization import Deserializer, Serializer

if TYPE_CHECKING:
Expand All @@ -30,8 +30,8 @@ class MonitorQueryLogsClient(_MonitorQueryLogsClientOperationsMixin):
:keyword endpoint: The Log Analytics service endpoint. Default value is
"https://api.loganalytics.io".
:paramtype endpoint: str
:keyword api_version: The service API version. Known values are "v1" and None. Default value is
"v1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: The service API version. Known values are "v1". Default value is "v1".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.monitor.query.models.Versions
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class MonitorQueryLogsClientConfiguration: # pylint: disable=too-many-instance-
:param endpoint: The Log Analytics service endpoint. Default value is
"https://api.loganalytics.io".
:type endpoint: str
:keyword api_version: The service API version. Known values are "v1" and None. Default value is
"v1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: The service API version. Known values are "v1". Default value is "v1".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.monitor.query.models.Versions
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._operations import _MonitorQueryLogsClientOperationsMixin # type: ignore # pylint: disable=unused-import

from ._patch import __all__ as _patch_all
from ._patch import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=protected-access
from collections.abc import MutableMapping
from io import IOBase
import json
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from typing import Any, Callable, IO, Optional, TypeVar, Union, overload

from azure.core import PipelineClient
from azure.core.exceptions import (
Expand All @@ -35,7 +34,7 @@

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]]

_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
Expand Down Expand Up @@ -156,9 +155,9 @@ def _execute(
) -> _models._models.QueryResults:
"""Execute an Analytics query.

Executes an Analytics query for data.
`Here <https://learn.microsoft.com/azure/azure-monitor/logs/api/request-format>`_
is an example for using POST with an Analytics query.
Executes an Analytics query for data. `Here
<https://learn.microsoft.com/azure/azure-monitor/logs/api/request-format>`_ is an example for
using POST with an Analytics query.

:param workspace_id: Primary Workspace ID of the query. This is the Workspace ID from the
Properties
Expand Down Expand Up @@ -211,6 +210,7 @@ def _execute(
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)

_decompress = kwargs.pop("decompress", True)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -225,11 +225,14 @@ def _execute(
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _failsafe_deserialize(_models._models.ErrorResponse, response.json())
error = _failsafe_deserialize(
_models._models.ErrorResponse, # pylint: disable=protected-access
response,
)
raise HttpResponseError(response=response, model=error)

if _stream:
deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()
else:
deserialized = _deserialize(
_models._models.QueryResults, response.json() # pylint: disable=protected-access
Expand Down Expand Up @@ -282,9 +285,9 @@ def _execute_with_resource_id(
) -> _models._models.QueryResults:
"""Execute an Analytics query using resource ID.

Executes an Analytics query for data in the context of a resource.
`Here <https://learn.microsoft.com/azure/azure-monitor/logs/api/azure-resource-queries>`_
is an example for using POST with an Analytics query.
Executes an Analytics query for data in the context of a resource. `Here
<https://learn.microsoft.com/azure/azure-monitor/logs/api/azure-resource-queries>`_ is an
example for using POST with an Analytics query.

:param resource_id: The identifier of the resource. Required.
:type resource_id: str
Expand Down Expand Up @@ -335,6 +338,7 @@ def _execute_with_resource_id(
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)

_decompress = kwargs.pop("decompress", True)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -349,11 +353,14 @@ def _execute_with_resource_id(
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _failsafe_deserialize(_models._models.ErrorResponse, response.json())
error = _failsafe_deserialize(
_models._models.ErrorResponse, # pylint: disable=protected-access
response,
)
raise HttpResponseError(response=response, model=error)

if _stream:
deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()
else:
deserialized = _deserialize(
_models._models.QueryResults, response.json() # pylint: disable=protected-access
Expand Down Expand Up @@ -383,9 +390,9 @@ def _batch(
) -> _models._models.BatchResponse:
"""Execute a batch of Analytics queries.

Executes a batch of Analytics queries for data.
`Here <https://learn.microsoft.com/azure/azure-monitor/logs/api/batch-queries>`_
is an example for using POST with an Analytics query.
Executes a batch of Analytics queries for data. `Here
<https://learn.microsoft.com/azure/azure-monitor/logs/api/batch-queries>`_ is an example for
using POST with an Analytics query.

:param body: The batch request body. Is one of the following types: BatchRequest, JSON,
IO[bytes] Required.
Expand Down Expand Up @@ -427,6 +434,7 @@ def _batch(
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)

_decompress = kwargs.pop("decompress", True)
_stream = kwargs.pop("stream", False)
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
Expand All @@ -441,11 +449,14 @@ def _batch(
except (StreamConsumedError, StreamClosedError):
pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = _failsafe_deserialize(_models._models.ErrorResponse, response.json())
error = _failsafe_deserialize(
_models._models.ErrorResponse, # pylint: disable=protected-access
response,
)
raise HttpResponseError(response=response, model=error)

if _stream:
deserialized = response.iter_bytes()
deserialized = response.iter_bytes() if _decompress else response.iter_raw()
else:
deserialized = _deserialize(
_models._models.BatchResponse, response.json() # pylint: disable=protected-access
Expand Down
Loading