azure.monitor.ingestion package

class azure.monitor.ingestion.LogsIngestionClient(endpoint: str, credential: TokenCredential, **kwargs: Any)[source]

Azure Monitor Data Collection Python Client.

Parameters
Keyword Arguments

api_version (str) – Api Version. Default value is “2021-11-01-preview”. Note that overriding this default value may result in unsupported behavior.

close()None
send_request(request: azure.core.rest._rest_py3.HttpRequest, **kwargs: Any)azure.core.rest._rest_py3.HttpResponse

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart

Parameters

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns

The response of your network call. Does not do error handling on your response.

Return type

HttpResponse

upload(rule_id: str, stream_name: str, logs: List[Any], *, max_concurrency: Optional[int] = None, **kwargs: Any)azure.monitor.ingestion._models.UploadLogsResult

Ingestion API used to directly ingest data using Data Collection Rules.

See error response code and error response message for more detail.

Parameters
  • rule_id (str) – The immutable Id of the Data Collection Rule resource.

  • stream_name (str) – The streamDeclaration name as defined in the Data Collection Rule.

  • logs (list[any]) – An array of objects matching the schema defined by the provided stream.

Keyword Arguments

max_concurrency (int) – Number of parallel threads to use when logs size is > 1mb.

Returns

UploadLogsResult

Return type

UploadLogsResult

Raises

~azure.core.exceptions.HttpResponseError

class azure.monitor.ingestion.MonitorIngestionClient(endpoint: str, credential: TokenCredential, **kwargs: Any)[source]

Azure Monitor Data Collection Python Client.

Parameters
Keyword Arguments

api_version (str) – Api Version. Default value is “2021-11-01-preview”. Note that overriding this default value may result in unsupported behavior.

close()None[source]
send_request(request: azure.core.rest._rest_py3.HttpRequest, **kwargs: Any)azure.core.rest._rest_py3.HttpResponse[source]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart

Parameters

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns

The response of your network call. Does not do error handling on your response.

Return type

HttpResponse

upload(rule_id: str, stream_name: str, logs: List[Any], *, max_concurrency: Optional[int] = None, **kwargs: Any)azure.monitor.ingestion._models.UploadLogsResult

Ingestion API used to directly ingest data using Data Collection Rules.

See error response code and error response message for more detail.

Parameters
  • rule_id (str) – The immutable Id of the Data Collection Rule resource.

  • stream_name (str) – The streamDeclaration name as defined in the Data Collection Rule.

  • logs (list[any]) – An array of objects matching the schema defined by the provided stream.

Keyword Arguments

max_concurrency (int) – Number of parallel threads to use when logs size is > 1mb.

Returns

UploadLogsResult

Return type

UploadLogsResult

Raises

~azure.core.exceptions.HttpResponseError

class azure.monitor.ingestion.UploadLogsResult(**kwargs)[source]

The response for send_logs API.

Variables
  • status (UploadLogsStatus) – Inditcates if the result is a success or a partial failure.

  • failed_logs (list) – If there is a failure, returns the request.

class azure.monitor.ingestion.UploadLogsStatus(value)[source]

An enumeration.

PARTIAL_FAILURE = 'PartialFailure'
SUCCESS = 'Success'