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
64 changes: 64 additions & 0 deletions sdk/dynatrace/azure-mgmt-dynatrace/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
# Release History

## 2.1.0 (2025-04-11)

### Features Added

- Client `DynatraceObservabilityMgmtClient` added operation group `monitored_subscriptions`
- Client `DynatraceObservabilityMgmtClient` added operation group `creation_supported`
- Model `AccountInfo` added property `company_name`
- Model `MarketplaceSaaSResourceDetailsResponse` added property `marketplace_saa_s_resource_name`
- Enum `MarketplaceSubscriptionStatus` added member `UNSUBSCRIBED`
- Model `MonitorResource` added property `marketplace_saas_auto_renew`
- Model `MonitorResourceUpdate` added property `properties`
- Model `MonitorResourceUpdate` added property `identity`
- Enum `MonitoringType` added member `DISCOVERY`
- Model `ProxyResource` added property `system_data`
- Model `Resource` added property `system_data`
- Model `TrackedResource` added property `system_data`
- Added enum `Action`
- Added model `AgentStatus`
- Added model `AgentStatusRequest`
- Added model `ConnectedResourcesCountResponse`
- Added model `CreateResourceSupportedProperties`
- Added model `CreateResourceSupportedResponse`
- Added model `LogStatusRequest`
- Added model `ManagedServiceIdentity`
- Added enum `ManagedServiceIdentityType`
- Added enum `MarketplaceSaasAutoRenew`
- Added model `MarketplaceSubscriptionIdRequest`
- Added model `MetricStatusRequest`
- Added model `MonitorUpdateProperties`
- Added model `MonitoredSubscription`
- Added model `MonitoredSubscriptionProperties`
- Added model `MonitoredSubscriptionPropertiesList`
- Added model `MonitoringTagRulesProperties`
- Added enum `Status`
- Added model `SubscriptionList`
- Added enum `SubscriptionListOperation`
- Added model `UpgradePlanRequest`
- Model `MonitorsOperations` added method `begin_upgrade_plan`
- Model `MonitorsOperations` added method `get_all_connected_resources_count`
- Model `MonitorsOperations` added method `update_agent_status`
- Added model `CreationSupportedOperations`
- Added model `MonitoredSubscriptionsOperations`
- Method `MonitorsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, monitor_name: str, resource: IO[bytes], content_type: str)`
- Method `MonitorsOperations.get_marketplace_saa_s_resource_details` has a new overload `def get_marketplace_saa_s_resource_details(self: None, request: IO[bytes], content_type: str)`
- Method `MonitorsOperations.get_metric_status` has a new overload `def get_metric_status(self: None, resource_group_name: str, monitor_name: str, request: Optional[MetricStatusRequest], content_type: str)`
- Method `MonitorsOperations.get_metric_status` has a new overload `def get_metric_status(self: None, resource_group_name: str, monitor_name: str, request: Optional[IO[bytes]], content_type: str)`
- Method `MonitorsOperations.get_sso_details` has a new overload `def get_sso_details(self: None, resource_group_name: str, monitor_name: str, request: Optional[IO[bytes]], content_type: str)`
- Method `MonitorsOperations.list_linkable_environments` has a new overload `def list_linkable_environments(self: None, resource_group_name: str, monitor_name: str, request: IO[bytes], content_type: str)`
- Method `MonitorsOperations.list_monitored_resources` has a new overload `def list_monitored_resources(self: None, resource_group_name: str, monitor_name: str, request: Optional[LogStatusRequest], content_type: str)`
- Method `MonitorsOperations.list_monitored_resources` has a new overload `def list_monitored_resources(self: None, resource_group_name: str, monitor_name: str, request: Optional[IO[bytes]], content_type: str)`
- Method `MonitorsOperations.update` has a new overload `def update(self: None, resource_group_name: str, monitor_name: str, resource: IO[bytes], content_type: str)`
- Method `MonitorsOperations.begin_upgrade_plan` has a new overload `def begin_upgrade_plan(self: None, resource_group_name: str, monitor_name: str, request: UpgradePlanRequest, content_type: str)`
- Method `MonitorsOperations.begin_upgrade_plan` has a new overload `def begin_upgrade_plan(self: None, resource_group_name: str, monitor_name: str, request: IO[bytes], content_type: str)`
- Method `MonitorsOperations.get_all_connected_resources_count` has a new overload `def get_all_connected_resources_count(self: None, request: MarketplaceSubscriptionIdRequest, content_type: str)`
- Method `MonitorsOperations.get_all_connected_resources_count` has a new overload `def get_all_connected_resources_count(self: None, request: IO[bytes], content_type: str)`
- Method `MonitorsOperations.update_agent_status` has a new overload `def update_agent_status(self: None, resource_group_name: str, monitor_name: str, request: AgentStatusRequest, content_type: str)`
- Method `MonitorsOperations.update_agent_status` has a new overload `def update_agent_status(self: None, resource_group_name: str, monitor_name: str, request: IO[bytes], content_type: str)`
- Method `SingleSignOnOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, monitor_name: str, configuration_name: str, resource: IO[bytes], content_type: str)`
- Method `TagRulesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, monitor_name: str, rule_set_name: str, resource: IO[bytes], content_type: str)`
- Method `MonitoredSubscriptionsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, monitor_name: str, body: Optional[MonitoredSubscriptionProperties], content_type: str)`
- Method `MonitoredSubscriptionsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, monitor_name: str, body: Optional[IO[bytes]], content_type: str)`
- Method `MonitoredSubscriptionsOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, monitor_name: str, body: Optional[MonitoredSubscriptionProperties], content_type: str)`
- Method `MonitoredSubscriptionsOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, monitor_name: str, body: Optional[IO[bytes]], content_type: str)`

## 2.0.0 (2023-08-18)

### Features Added
Expand Down
9 changes: 3 additions & 6 deletions sdk/dynatrace/azure-mgmt-dynatrace/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Dynatrace Management Client Library.
This package has been tested with Python 3.7+.
This package has been tested with Python 3.8+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).

## _Disclaimer_
Expand All @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For

### Prerequisites

- Python 3.7+ is required to use this package.
- Python 3.8+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package
Expand All @@ -24,7 +24,7 @@ pip install azure-identity

### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
Expand Down Expand Up @@ -59,6 +59,3 @@ Code samples for this package can be found at:
If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.



10 changes: 5 additions & 5 deletions sdk/dynatrace/azure-mgmt-dynatrace/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "c992976478b8ab8c3ea2b4abaeac9b0aacee55fe",
"commit": "6bbf3d3ed4c460e52124c95125a67abae030d0c0",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
"@autorest/python@6.27.4",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/dynatrace/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/dynatrace/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/dynatrace/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._dynatrace_observability_mgmt_client import DynatraceObservabilityMgmtClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._dynatrace_observability_mgmt_client import DynatraceObservabilityMgmtClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"DynatraceObservabilityMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __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,35 +8,32 @@

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class DynatraceObservabilityMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class DynatraceObservabilityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for DynatraceObservabilityMgmtClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-04-27". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-04-24". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(DynatraceObservabilityMgmtClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-04-27")
api_version: str = kwargs.pop("api_version", "2024-04-24")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -48,6 +45,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-dynatrace/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _configure(self, **kwargs: Any) -> None:
Expand All @@ -56,9 +54,9 @@ def _configure(self, **kwargs: Any) -> None:
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,39 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy

from . import models as _models
from ._configuration import DynatraceObservabilityMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import MonitorsOperations, Operations, SingleSignOnOperations, TagRulesOperations
from .operations import (
CreationSupportedOperations,
MonitoredSubscriptionsOperations,
MonitorsOperations,
Operations,
SingleSignOnOperations,
TagRulesOperations,
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential


class DynatraceObservabilityMgmtClient: # pylint: disable=client-accepts-api-version-keyword
class DynatraceObservabilityMgmtClient:
"""DynatraceObservabilityMgmtClient.

:ivar monitors: MonitorsOperations operations
:vartype monitors: azure.mgmt.dynatrace.operations.MonitorsOperations
:ivar monitored_subscriptions: MonitoredSubscriptionsOperations operations
:vartype monitored_subscriptions:
azure.mgmt.dynatrace.operations.MonitoredSubscriptionsOperations
:ivar creation_supported: CreationSupportedOperations operations
:vartype creation_supported: azure.mgmt.dynatrace.operations.CreationSupportedOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.dynatrace.operations.Operations
:ivar tag_rules: TagRulesOperations operations
Expand All @@ -35,11 +49,11 @@ class DynatraceObservabilityMgmtClient: # pylint: disable=client-accepts-api-ve
:vartype single_sign_on: azure.mgmt.dynatrace.operations.SingleSignOnOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-04-27". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-04-24". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -56,18 +70,42 @@ def __init__(
self._config = DynatraceObservabilityMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.monitors = MonitorsOperations(self._client, self._config, self._serialize, self._deserialize)
self.monitored_subscriptions = MonitoredSubscriptionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.creation_supported = CreationSupportedOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.tag_rules = TagRulesOperations(self._client, self._config, self._serialize, self._deserialize)
self.single_sign_on = SingleSignOnOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.

>>> from azure.core.rest import HttpRequest
Expand All @@ -87,12 +125,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

def close(self) -> None:
self._client.close()

def __enter__(self) -> "DynatraceObservabilityMgmtClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
Expand Down
Loading