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

## 1.0.0 (2025-09-25)

### Features Added

- Model `DurableTaskMgmtClient` added parameter `cloud_setting` in method `__init__`
- Added enum `SchedulerSkuName`

## 1.0.0b2 (2025-04-24)

### Features Added
Expand Down
9 changes: 4 additions & 5 deletions sdk/durabletask/azure-mgmt-durabletask/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
include _meta.json
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
include LICENSE
include azure/mgmt/durabletask/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"commit": "5edf0e869b189cadbf815ff0ce60f75b86a08c33",
"apiVersion": "2025-11-01",
"commit": "688609bf18c3978794a0c5ca31557c286c623b44",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/durabletask/DurableTask.Management",
"@azure-tools/typespec-python": "0.42.3"
"emitterVersion": "0.51.2"
}
49 changes: 33 additions & 16 deletions sdk/durabletask/azure-mgmt-durabletask/apiview-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,40 @@
"azure.mgmt.durabletask.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
"azure.mgmt.durabletask.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
"azure.mgmt.durabletask.models.ProvisioningState": "Microsoft.DurableTask.ProvisioningState",
"azure.mgmt.durabletask.models.SchedulerSkuName": "Microsoft.DurableTask.SchedulerSkuName",
"azure.mgmt.durabletask.models.RedundancyState": "Microsoft.DurableTask.RedundancyState",
"azure.mgmt.durabletask.models.PurgeableOrchestrationState": "Microsoft.DurableTask.PurgeableOrchestrationState",
"azure.mgmt.durabletask.DurableTaskMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.get": "Microsoft.DurableTask.Schedulers.get",
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate",
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.begin_update": "Microsoft.DurableTask.Schedulers.update",
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.begin_delete": "Microsoft.DurableTask.Schedulers.delete",
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.list_by_resource_group": "Microsoft.DurableTask.Schedulers.listByResourceGroup",
"azure.mgmt.durabletask.DurableTaskMgmtClient.schedulers.list_by_subscription": "Microsoft.DurableTask.Schedulers.listBySubscription",
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.get": "Microsoft.DurableTask.TaskHubs.get",
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate",
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.begin_delete": "Microsoft.DurableTask.TaskHubs.delete",
"azure.mgmt.durabletask.DurableTaskMgmtClient.task_hubs.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler",
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.get": "Microsoft.DurableTask.RetentionPolicies.get",
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.begin_create_or_replace": "Microsoft.DurableTask.RetentionPolicies.createOrReplace",
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.begin_update": "Microsoft.DurableTask.RetentionPolicies.update",
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete",
"azure.mgmt.durabletask.DurableTaskMgmtClient.retention_policies.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler"
"azure.mgmt.durabletask.operations.Operations.list": "Azure.ResourceManager.Operations.list",
"azure.mgmt.durabletask.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list",
"azure.mgmt.durabletask.operations.SchedulersOperations.get": "Microsoft.DurableTask.Schedulers.get",
"azure.mgmt.durabletask.aio.operations.SchedulersOperations.get": "Microsoft.DurableTask.Schedulers.get",
"azure.mgmt.durabletask.operations.SchedulersOperations.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate",
"azure.mgmt.durabletask.aio.operations.SchedulersOperations.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate",
"azure.mgmt.durabletask.operations.SchedulersOperations.begin_update": "Microsoft.DurableTask.Schedulers.update",
"azure.mgmt.durabletask.aio.operations.SchedulersOperations.begin_update": "Microsoft.DurableTask.Schedulers.update",
"azure.mgmt.durabletask.operations.SchedulersOperations.begin_delete": "Microsoft.DurableTask.Schedulers.delete",
"azure.mgmt.durabletask.aio.operations.SchedulersOperations.begin_delete": "Microsoft.DurableTask.Schedulers.delete",
"azure.mgmt.durabletask.operations.SchedulersOperations.list_by_resource_group": "Microsoft.DurableTask.Schedulers.listByResourceGroup",
"azure.mgmt.durabletask.aio.operations.SchedulersOperations.list_by_resource_group": "Microsoft.DurableTask.Schedulers.listByResourceGroup",
"azure.mgmt.durabletask.operations.SchedulersOperations.list_by_subscription": "Microsoft.DurableTask.Schedulers.listBySubscription",
"azure.mgmt.durabletask.aio.operations.SchedulersOperations.list_by_subscription": "Microsoft.DurableTask.Schedulers.listBySubscription",
"azure.mgmt.durabletask.operations.TaskHubsOperations.get": "Microsoft.DurableTask.TaskHubs.get",
"azure.mgmt.durabletask.aio.operations.TaskHubsOperations.get": "Microsoft.DurableTask.TaskHubs.get",
"azure.mgmt.durabletask.operations.TaskHubsOperations.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate",
"azure.mgmt.durabletask.aio.operations.TaskHubsOperations.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate",
"azure.mgmt.durabletask.operations.TaskHubsOperations.begin_delete": "Microsoft.DurableTask.TaskHubs.delete",
"azure.mgmt.durabletask.aio.operations.TaskHubsOperations.begin_delete": "Microsoft.DurableTask.TaskHubs.delete",
"azure.mgmt.durabletask.operations.TaskHubsOperations.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler",
"azure.mgmt.durabletask.aio.operations.TaskHubsOperations.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler",
"azure.mgmt.durabletask.operations.RetentionPoliciesOperations.get": "Microsoft.DurableTask.RetentionPolicies.get",
"azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.get": "Microsoft.DurableTask.RetentionPolicies.get",
"azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_create_or_replace": "Microsoft.DurableTask.RetentionPolicies.createOrReplace",
"azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.begin_create_or_replace": "Microsoft.DurableTask.RetentionPolicies.createOrReplace",
"azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_update": "Microsoft.DurableTask.RetentionPolicies.update",
"azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.begin_update": "Microsoft.DurableTask.RetentionPolicies.update",
"azure.mgmt.durabletask.operations.RetentionPoliciesOperations.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete",
"azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.begin_delete": "Microsoft.DurableTask.RetentionPolicies.delete",
"azure.mgmt.durabletask.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler",
"azure.mgmt.durabletask.aio.operations.RetentionPoliciesOperations.list_by_scheduler": "Microsoft.DurableTask.RetentionPolicies.listByScheduler"
}
}
2 changes: 1 addition & 1 deletion sdk/durabletask/azure-mgmt-durabletask/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@
# --------------------------------------------------------------------------

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

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

from ._configuration import DurableTaskMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from ._utils.serialization import Deserializer, Serializer
from .operations import Operations, RetentionPoliciesOperations, SchedulersOperations, TaskHubsOperations

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential


Expand All @@ -38,11 +41,13 @@ class DurableTaskMgmtClient:
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:param base_url: Service host. Default value is None.
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2025-04-01-preview". Note that overriding this default value may result in unsupported
behavior.
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:paramtype cloud_setting: ~azure.core.AzureClouds
:keyword api_version: The API version to use for this operation. Default value is "2025-11-01".
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
Retry-After header is present.
Expand All @@ -52,13 +57,26 @@ def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
base_url: Optional[str] = None,
*,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
_endpoint = "{endpoint}"
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
_endpoints = get_arm_endpoints(_cloud)
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = DurableTaskMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
credential=credential,
subscription_id=subscription_id,
base_url=cast(str, base_url),
cloud_setting=cloud_setting,
credential_scopes=credential_scopes,
**kwargs
)

_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
Expand All @@ -77,7 +95,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)

self._serialize = Serializer()
self._deserialize = Deserializer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

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

from ._version import VERSION

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential


Expand All @@ -29,9 +30,11 @@ class DurableTaskMgmtClientConfiguration: # pylint: disable=too-many-instance-a
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2025-04-01-preview". Note that overriding this default value may result in unsupported
behavior.
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:type cloud_setting: ~azure.core.AzureClouds
:keyword api_version: The API version to use for this operation. Default value is "2025-11-01".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand All @@ -40,9 +43,10 @@ def __init__(
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2025-04-01-preview")
api_version: str = kwargs.pop("api_version", "2025-11-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -52,6 +56,7 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.base_url = base_url
self.cloud_setting = cloud_setting
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-durabletask/{}".format(VERSION))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
Loading