Skip to content
Closed
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
3 changes: 0 additions & 3 deletions sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# --------------------------------------------------------------------------

from ._microsoft_datadog_client import MicrosoftDatadogClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['MicrosoftDatadogClient']

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
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

VERSION = "unknown"

class MicrosoftDatadogClientConfiguration(Configuration):
"""Configuration for MicrosoftDatadogClient.
Expand All @@ -29,7 +28,7 @@ class MicrosoftDatadogClientConfiguration(Configuration):

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -48,7 +47,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-02-01-preview"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-datadog/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2020-02-01-preview",
"total_api_version_list": ["2020-02-01-preview"],
"chosen_version": "2021-03-01",
"total_api_version_list": ["2021-03-01"],
"client": {
"name": "MicrosoftDatadogClient",
"filename": "_microsoft_datadog_client",
Expand All @@ -21,7 +21,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The Microsoft Azure subscription ID.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -35,7 +35,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The Microsoft Azure subscription ID.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MicrosoftDatadogClient(object):
:vartype single_sign_on_configurations: microsoft_datadog_client.operations.SingleSignOnConfigurationsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
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

VERSION = "unknown"

class MicrosoftDatadogClientConfiguration(Configuration):
"""Configuration for MicrosoftDatadogClient.
Expand All @@ -27,7 +26,7 @@ class MicrosoftDatadogClientConfiguration(Configuration):

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -45,7 +44,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-02-01-preview"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-datadog/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MicrosoftDatadogClient(object):
:vartype single_sign_on_configurations: microsoft_datadog_client.aio.operations.SingleSignOnConfigurationsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Microsoft Azure subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-02-01-preview"
api_version = "2021-03-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand All @@ -71,7 +71,7 @@ def prepare_request(next_link=None):
# Construct URL
url = self.list.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
Expand Down Expand Up @@ -99,7 +99,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -131,14 +131,14 @@ async def create_or_update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-02-01-preview"
api_version = "2021-03-01"
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'),
'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)

Expand All @@ -163,7 +163,7 @@ async def create_or_update(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('DatadogAgreementResource', pipeline_response)
Expand Down
Loading