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-ingestion/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`.

## 1.1.0 (2025-07-18)

### Bugs Fixed
Expand Down
5 changes: 4 additions & 1 deletion sdk/monitor/azure-monitor-ingestion/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"apiVersion": "2023-01-01"
"apiVersion": "2023-01-01",
"apiVersions": {
"LogsIngestion": "2023-01-01"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
from azure.core.rest import HttpRequest, HttpResponse

from ._configuration import LogsIngestionClientConfiguration
from ._operations import LogsIngestionClientOperationsMixin
from ._operations import _LogsIngestionClientOperationsMixin
from ._utils.serialization import Deserializer, Serializer

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential


class LogsIngestionClient(LogsIngestionClientOperationsMixin):
class LogsIngestionClient(_LogsIngestionClientOperationsMixin):
"""Azure Monitor data collection client.

:param endpoint: The Data Collection Endpoint for the Data Collection Rule. For example,
Expand All @@ -31,8 +31,9 @@ class LogsIngestionClient(LogsIngestionClientOperationsMixin):
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is "2023-01-01".
Note that overriding this default value may result in unsupported behavior.
:keyword api_version: The API version to use for this operation. Known values are "2023-01-01".
Default value is "2023-01-01". Note that overriding this default value may result in
unsupported behavior.
:paramtype api_version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class LogsIngestionClientConfiguration: # pylint: disable=too-many-instance-att
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: The API version to use for this operation. Default value is "2023-01-01".
Note that overriding this default value may result in unsupported behavior.
:keyword api_version: The API version to use for this operation. Known values are "2023-01-01".
Default value is "2023-01-01". Note that overriding this default value may result in
unsupported behavior.
:paramtype api_version: str
"""

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

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

from ._patch import __all__ as _patch_all
from ._patch import *
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"LogsIngestionClientOperationsMixin",
]
__all__ = []
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from collections.abc import MutableMapping
from io import IOBase
import json
from typing import Any, Callable, Dict, IO, List, 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 @@ -30,7 +30,7 @@
from .._utils.utils import ClientMixinABC

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 All @@ -44,8 +44,6 @@ def build_logs_ingestion_upload_request(

content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-01-01"))
accept = _headers.pop("Accept", "application/json")

# Construct URL
_url = "/dataCollectionRules/{ruleId}/streams/{stream}"
path_format_arguments = {
Expand All @@ -63,12 +61,11 @@ def build_logs_ingestion_upload_request(
_headers["Content-Encoding"] = _SERIALIZER.header("content_encoding", content_encoding, "str")
if content_type is not None:
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)


class LogsIngestionClientOperationsMixin(
class _LogsIngestionClientOperationsMixin(
ClientMixinABC[PipelineClient[HttpRequest, HttpResponse], LogsIngestionClientConfiguration]
):

Expand All @@ -77,7 +74,7 @@ def _upload(
self,
rule_id: str,
stream_name: str,
body: List[Dict[str, Any]],
body: list[dict[str, Any]],
*,
content_encoding: Optional[str] = None,
content_type: str = "application/json",
Expand All @@ -100,7 +97,7 @@ def _upload( # pylint: disable=inconsistent-return-statements
self,
rule_id: str,
stream_name: str,
body: Union[List[Dict[str, Any]], IO[bytes]],
body: Union[list[dict[str, Any]], IO[bytes]],
*,
content_encoding: Optional[str] = None,
**kwargs: Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import sys
from typing import Callable, cast, List, Any, Optional, Union, IO

from ._operations import LogsIngestionClientOperationsMixin as GeneratedOps
from ._operations import _LogsIngestionClientOperationsMixin as GeneratedOps
from .._helpers import _create_gzip_requests, GZIP_MAGIC_NUMBER
from .._models import LogsUploadError

Expand All @@ -26,7 +26,7 @@
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object


class LogsIngestionClientOperationsMixin(GeneratedOps):
class _LogsIngestionClientOperationsMixin(GeneratedOps):
def upload(
self,
rule_id: str,
Expand Down Expand Up @@ -93,7 +93,7 @@ def upload(


__all__: List[str] = [
"LogsIngestionClientOperationsMixin"
"_LogsIngestionClientOperationsMixin"
] # Add all objects you want publicly available to users at this package level


Expand Down
Loading