Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove audience #21097

Merged
merged 4 commits into from
Oct 6, 2021
Merged
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
1 change: 0 additions & 1 deletion sdk/monitor/azure-monitor-query/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- Added `LogsQueryStatus` Enum to describe the status of a result.
- Added a new `LogsTableRow` type that represents a single row in a table.
- Items in `metrics` list in `MetricsQueryResult` can now be accessed by metric names.
- Added `audience` keyword to support providing credential scope when creating clients.

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,18 @@ class LogsQueryClient(object):
:type credential: ~azure.core.credentials.TokenCredential
:keyword endpoint: The endpoint to connect to. Defaults to 'https://api.loganalytics.io'.
:paramtype endpoint: str
:keyword audience: URL to use for credential authentication with AAD.
:paramtype audience: str
"""

def __init__(self, credential, **kwargs):
# type: (TokenCredential, Any) -> None
audience = kwargs.pop("audience", None)
endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io/v1")
endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io")
if not endpoint.startswith("https://") and not endpoint.startswith("http://"):
endpoint = "https://" + endpoint
self._endpoint = endpoint
self._client = MonitorQueryClient(
credential=credential,
authentication_policy=get_authentication_policy(credential, audience),
base_url=self._endpoint,
authentication_policy=get_authentication_policy(credential, endpoint),
base_url=self._endpoint.rstrip('/') + "/v1",
**kwargs
)
self._query_op = self._client.query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class MetricsQueryClient(object):
:type credential: ~azure.core.credentials.TokenCredential
:keyword endpoint: The endpoint to connect to. Defaults to 'https://management.azure.com'.
:paramtype endpoint: str
:keyword audience: URL to use for credential authentication with AAD.
:paramtype audience: str
"""

def __init__(self, credential, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ class LogsQueryResult(object):
:vartype tables: list[~azure.monitor.query.LogsTable]
:ivar statistics: This will include a statistics property in the response that describes various
performance statistics such as query execution time and resource usage.
:vartype statistics: object
:vartype statistics: Mapping
:ivar visualization: This will include a visualization property in the response that specifies the type of
visualization selected by the query and any properties for that visualization.
:vartype visualization: object
:vartype visualization: Mapping
:ivar status: The status of the result.
Always 'Success' for an instance of a LogsQueryResult.
:vartype status: ~azure.monitor.query.LogsQueryStatus
Expand Down Expand Up @@ -585,10 +585,10 @@ class LogsQueryPartialResult(object):
:vartype partial_data: list[~azure.monitor.query.LogsTable]
:ivar statistics: This will include a statistics property in the response that describes various
performance statistics such as query execution time and resource usage.
:vartype statistics: object
:vartype statistics: Mapping
:ivar visualization: This will include a visualization property in the response that specifies the type of
visualization selected by the query and any properties for that visualization.
:vartype visualization: object
:vartype visualization: Mapping
:ivar partial_error: The partial errror info
:vartype partial_error: ~azure.monitor.query.LogsQueryError
:ivar status: The status of the result. Always 'PartialError' for an instance of a LogsQueryPartialResult.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,17 @@ class LogsQueryClient(object):
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:keyword endpoint: The endpoint to connect to. Defaults to 'https://api.loganalytics.io/v1'.
:paramtype endpoint: str
:keyword audience: URL to use for credential authentication with AAD.
:paramtype audience: str
"""

def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
audience = kwargs.pop("audience", None)
endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io/v1")
endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io")
if not endpoint.startswith("https://") and not endpoint.startswith("http://"):
endpoint = "https://" + endpoint
self._endpoint = endpoint
self._client = MonitorQueryClient(
credential=credential,
authentication_policy=get_authentication_policy(credential, audience),
base_url=self._endpoint,
authentication_policy=get_authentication_policy(credential, endpoint),
base_url=self._endpoint.rstrip('/') + "/v1",
**kwargs
)
self._query_op = self._client.query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class MetricsQueryClient(object):
:type credential: ~azure.core.credentials.TokenCredential
:keyword endpoint: The endpoint to connect to. Defaults to 'https://management.azure.com'.
:paramtype endpoint: str
:keyword audience: URL to use for credential authentication with AAD.
:paramtype audience: str
"""

def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
Expand Down