Skip to content

Commit 35e0913

Browse files
author
SDKAuto
committed
CodeGen from PR 32282 in Azure/azure-rest-api-specs
Merge 3f8b2c6b438fc8bfb90100e29a602e69d8319bd5 into e0ef299f475a972c2856175014bf4f1e9873dda0
1 parent 7656cf2 commit 35e0913

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+9264
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (1970-01-01)
4+
5+
- Initial version
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include _meta.json
2+
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
4+
include *.md
5+
include azure/__init__.py
6+
include azure/mgmt/__init__.py
7+
include LICENSE
8+
include azure/mgmt/durabletask/py.typed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure MyService Management Client Library.
4+
This package has been tested with Python 3.8+.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
## _Disclaimer_
8+
9+
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
10+
11+
## Getting started
12+
13+
### Prerequisites
14+
15+
- Python 3.8+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
17+
18+
### Install the package
19+
20+
```bash
21+
pip install azure-mgmt-durabletask
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.durabletask import
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = (credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
Code samples for this package can be found at:
49+
- [Search MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
58+
59+
If you encounter any bugs or have suggestions, please file an issue in the
60+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
61+
section of the project.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.DurableTask",
3+
"CrossLanguageDefinitionId": {
4+
"microsoft.durabletask.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
5+
"microsoft.durabletask.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
6+
"microsoft.durabletask.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
7+
"microsoft.durabletask.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
8+
"microsoft.durabletask.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
9+
"microsoft.durabletask.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
10+
"microsoft.durabletask.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
11+
"microsoft.durabletask.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
12+
"microsoft.durabletask.models.Scheduler": "Microsoft.DurableTask.Scheduler",
13+
"microsoft.durabletask.models.SchedulerProperties": "Microsoft.DurableTask.SchedulerProperties",
14+
"microsoft.durabletask.models.SchedulerPropertiesUpdate": "Microsoft.DurableTask.SchedulerPropertiesUpdate",
15+
"microsoft.durabletask.models.SchedulerSku": "Microsoft.DurableTask.SchedulerSku",
16+
"microsoft.durabletask.models.SchedulerSkuUpdate": "Microsoft.DurableTask.SchedulerSkuUpdate",
17+
"microsoft.durabletask.models.SchedulerUpdate": "Microsoft.DurableTask.SchedulerUpdate",
18+
"microsoft.durabletask.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
19+
"microsoft.durabletask.models.TaskHub": "Microsoft.DurableTask.TaskHub",
20+
"microsoft.durabletask.models.TaskHubProperties": "Microsoft.DurableTask.TaskHubProperties",
21+
"microsoft.durabletask.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
22+
"microsoft.durabletask.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
23+
"microsoft.durabletask.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
24+
"microsoft.durabletask.models.ProvisioningState": "Microsoft.DurableTask.ProvisioningState",
25+
"microsoft.durabletask.models.RedundancyState": "Microsoft.DurableTask.RedundancyState",
26+
"microsoft.durabletask.DurableTaskMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
27+
"microsoft.durabletask.DurableTaskMgmtClient.schedulers.get": "Microsoft.DurableTask.Schedulers.get",
28+
"microsoft.durabletask.DurableTaskMgmtClient.schedulers.begin_create_or_update": "Microsoft.DurableTask.Schedulers.createOrUpdate",
29+
"microsoft.durabletask.DurableTaskMgmtClient.schedulers.begin_update": "Microsoft.DurableTask.Schedulers.update",
30+
"microsoft.durabletask.DurableTaskMgmtClient.schedulers.begin_delete": "Microsoft.DurableTask.Schedulers.delete",
31+
"microsoft.durabletask.DurableTaskMgmtClient.schedulers.list_by_resource_group": "Microsoft.DurableTask.Schedulers.listByResourceGroup",
32+
"microsoft.durabletask.DurableTaskMgmtClient.schedulers.list_by_subscription": "Microsoft.DurableTask.Schedulers.listBySubscription",
33+
"microsoft.durabletask.DurableTaskMgmtClient.task_hubs.get": "Microsoft.DurableTask.TaskHubs.get",
34+
"microsoft.durabletask.DurableTaskMgmtClient.task_hubs.begin_create_or_update": "Microsoft.DurableTask.TaskHubs.createOrUpdate",
35+
"microsoft.durabletask.DurableTaskMgmtClient.task_hubs.begin_delete": "Microsoft.DurableTask.TaskHubs.delete",
36+
"microsoft.durabletask.DurableTaskMgmtClient.task_hubs.list_by_scheduler": "Microsoft.DurableTask.TaskHubs.listByScheduler"
37+
}
38+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-e ../../../tools/azure-sdk-tools
2+
../../core/azure-core
3+
../../identity/azure-identity
4+
../../core/azure-mgmt-core
5+
aiohttp
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from azure.identity import DefaultAzureCredential
10+
11+
from microsoft.durabletask import DurableTaskMgmtClient
12+
13+
"""
14+
# PREREQUISITES
15+
pip install azure-identity
16+
pip install microsoft-durabletask
17+
# USAGE
18+
python operations_list.py
19+
20+
Before run the sample, please set the values of the client ID, tenant ID and client secret
21+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
22+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
23+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
24+
"""
25+
26+
27+
def main():
28+
client = DurableTaskMgmtClient(
29+
credential=DefaultAzureCredential(),
30+
subscription_id="SUBSCRIPTION_ID",
31+
)
32+
33+
response = client.operations.list()
34+
for item in response:
35+
print(item)
36+
37+
38+
# x-ms-original-file: 2024-10-01-preview/Operations_List.json
39+
if __name__ == "__main__":
40+
main()
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from azure.identity import DefaultAzureCredential
10+
11+
from microsoft.durabletask import DurableTaskMgmtClient
12+
13+
"""
14+
# PREREQUISITES
15+
pip install azure-identity
16+
pip install microsoft-durabletask
17+
# USAGE
18+
python schedulers_create_or_update.py
19+
20+
Before run the sample, please set the values of the client ID, tenant ID and client secret
21+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
22+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
23+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
24+
"""
25+
26+
27+
def main():
28+
client = DurableTaskMgmtClient(
29+
credential=DefaultAzureCredential(),
30+
subscription_id="SUBSCRIPTION_ID",
31+
)
32+
33+
response = client.schedulers.begin_create_or_update(
34+
resource_group_name="rgopenapi",
35+
scheduler_name="testscheduler",
36+
resource={
37+
"location": "northcentralus",
38+
"properties": {"ipAllowlist": ["10.0.0.0/8"], "sku": {"name": "Dedicated"}},
39+
"tags": {"key2138": "fjaeecgnvqd", "key7131": "ryohwcoiccwsnewjigfmijz"},
40+
},
41+
).result()
42+
print(response)
43+
44+
45+
# x-ms-original-file: 2024-10-01-preview/Schedulers_CreateOrUpdate.json
46+
if __name__ == "__main__":
47+
main()
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from azure.identity import DefaultAzureCredential
10+
11+
from microsoft.durabletask import DurableTaskMgmtClient
12+
13+
"""
14+
# PREREQUISITES
15+
pip install azure-identity
16+
pip install microsoft-durabletask
17+
# USAGE
18+
python schedulers_delete.py
19+
20+
Before run the sample, please set the values of the client ID, tenant ID and client secret
21+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
22+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
23+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
24+
"""
25+
26+
27+
def main():
28+
client = DurableTaskMgmtClient(
29+
credential=DefaultAzureCredential(),
30+
subscription_id="SUBSCRIPTION_ID",
31+
)
32+
33+
client.schedulers.begin_delete(
34+
resource_group_name="rgopenapi",
35+
scheduler_name="testscheduler",
36+
).result()
37+
38+
39+
# x-ms-original-file: 2024-10-01-preview/Schedulers_Delete.json
40+
if __name__ == "__main__":
41+
main()
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from azure.identity import DefaultAzureCredential
10+
11+
from microsoft.durabletask import DurableTaskMgmtClient
12+
13+
"""
14+
# PREREQUISITES
15+
pip install azure-identity
16+
pip install microsoft-durabletask
17+
# USAGE
18+
python schedulers_get.py
19+
20+
Before run the sample, please set the values of the client ID, tenant ID and client secret
21+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
22+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
23+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
24+
"""
25+
26+
27+
def main():
28+
client = DurableTaskMgmtClient(
29+
credential=DefaultAzureCredential(),
30+
subscription_id="SUBSCRIPTION_ID",
31+
)
32+
33+
response = client.schedulers.get(
34+
resource_group_name="rgopenapi",
35+
scheduler_name="testscheduler",
36+
)
37+
print(response)
38+
39+
40+
# x-ms-original-file: 2024-10-01-preview/Schedulers_Get.json
41+
if __name__ == "__main__":
42+
main()

0 commit comments

Comments
 (0)