Skip to content

Commit c96cf33

Browse files
author
SDKAuto
committed
CodeGen from PR 22575 in Azure/azure-rest-api-specs
Merge 5dcb32cfd1d7c552bdac80c6a7e726a3060c8e70 into ac7f9d6f1003acf6e54682534f30a9f5ec7fc5d2
1 parent 0b3c6cc commit c96cf33

File tree

658 files changed

+31553
-9223
lines changed

Some content is hidden

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

658 files changed

+31553
-9223
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2+
"commit": "9d2c3138de4793fd16010f6b827ebfac8bb2ac94",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
24
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@6.1.9",
6+
"@autorest/python@6.4.0",
57
"@autorest/[email protected]"
68
],
7-
"commit": "5263f0b2ead74031fa567da2700411743da26e7f",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/monitor/resource-manager/readme.md"
1111
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python create_or_update_action_group.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="187f412d-1758-44d9-b052-169e2564721d",
30+
)
31+
32+
response = client.action_groups.create_or_update(
33+
resource_group_name="Default-NotificationRules",
34+
action_group_name="SampleActionGroup",
35+
action_group={
36+
"location": "Global",
37+
"properties": {
38+
"armRoleReceivers": [
39+
{
40+
"name": "Sample armRole",
41+
"roleId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635",
42+
"useCommonAlertSchema": True,
43+
}
44+
],
45+
"automationRunbookReceivers": [
46+
{
47+
"automationAccountId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest",
48+
"isGlobalRunbook": False,
49+
"name": "testRunbook",
50+
"runbookName": "Sample runbook",
51+
"serviceUri": "<serviceUri>",
52+
"useCommonAlertSchema": True,
53+
"webhookResourceId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084",
54+
}
55+
],
56+
"azureAppPushReceivers": [{"emailAddress": "[email protected]", "name": "Sample azureAppPush"}],
57+
"azureFunctionReceivers": [
58+
{
59+
"functionAppResourceId": "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp",
60+
"functionName": "HttpTriggerCSharp1",
61+
"httpTriggerUrl": "http://test.me",
62+
"name": "Sample azureFunction",
63+
"useCommonAlertSchema": True,
64+
}
65+
],
66+
"emailReceivers": [
67+
{"emailAddress": "[email protected]", "name": "John Doe's email", "useCommonAlertSchema": False},
68+
{"emailAddress": "[email protected]", "name": "Jane Smith's email", "useCommonAlertSchema": True},
69+
],
70+
"enabled": True,
71+
"eventHubReceivers": [
72+
{
73+
"eventHubName": "testEventHub",
74+
"eventHubNameSpace": "testEventHubNameSpace",
75+
"name": "Sample eventHub",
76+
"subscriptionId": "187f412d-1758-44d9-b052-169e2564721d",
77+
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84",
78+
}
79+
],
80+
"groupShortName": "sample",
81+
"itsmReceivers": [
82+
{
83+
"connectionId": "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1",
84+
"name": "Sample itsm",
85+
"region": "westcentralus",
86+
"ticketConfiguration": '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}',
87+
"workspaceId": "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c",
88+
}
89+
],
90+
"logicAppReceivers": [
91+
{
92+
"callbackUrl": "https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w",
93+
"name": "Sample logicApp",
94+
"resourceId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp",
95+
"useCommonAlertSchema": False,
96+
}
97+
],
98+
"smsReceivers": [
99+
{"countryCode": "1", "name": "John Doe's mobile", "phoneNumber": "1234567890"},
100+
{"countryCode": "1", "name": "Jane Smith's mobile", "phoneNumber": "0987654321"},
101+
],
102+
"voiceReceivers": [{"countryCode": "1", "name": "Sample voice", "phoneNumber": "1234567890"}],
103+
"webhookReceivers": [
104+
{
105+
"name": "Sample webhook 1",
106+
"serviceUri": "http://www.example.com/webhook1",
107+
"useCommonAlertSchema": True,
108+
},
109+
{
110+
"identifierUri": "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a",
111+
"name": "Sample webhook 2",
112+
"objectId": "d3bb868c-fe44-452c-aa26-769a6538c808",
113+
"serviceUri": "http://www.example.com/webhook2",
114+
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84",
115+
"useAadAuth": True,
116+
"useCommonAlertSchema": True,
117+
},
118+
],
119+
},
120+
"tags": {},
121+
},
122+
)
123+
print(response)
124+
125+
126+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/createOrUpdateActionGroup.json
127+
if __name__ == "__main__":
128+
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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python delete_action_group.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="187f412d-1758-44d9-b052-169e2564721d",
30+
)
31+
32+
response = client.action_groups.delete(
33+
resource_group_name="Default-NotificationRules",
34+
action_group_name="SampleActionGroup",
35+
)
36+
print(response)
37+
38+
39+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/deleteActionGroup.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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python enable_receiver.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="187f412d-1758-44d9-b052-169e2564721d",
30+
)
31+
32+
response = client.action_groups.enable_receiver(
33+
resource_group_name="Default-NotificationRules",
34+
action_group_name="SampleActionGroup",
35+
enable_request={"receiverName": "John Doe's mobile"},
36+
)
37+
print(response)
38+
39+
40+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/enableReceiver.json
41+
if __name__ == "__main__":
42+
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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python get_action_group.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="187f412d-1758-44d9-b052-169e2564721d",
30+
)
31+
32+
response = client.action_groups.get(
33+
resource_group_name="Default-NotificationRules",
34+
action_group_name="SampleActionGroup",
35+
)
36+
print(response)
37+
38+
39+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/getActionGroup.json
40+
if __name__ == "__main__":
41+
main()
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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python get_test_notifications_at_action_group_resource_level.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="11111111-1111-1111-1111-111111111111",
30+
)
31+
32+
response = client.action_groups.get_test_notifications_at_action_group_resource_level(
33+
resource_group_name="TestRgName",
34+
action_group_name="TestAgName",
35+
notification_id="11000222191287",
36+
)
37+
print(response)
38+
39+
40+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.json
41+
if __name__ == "__main__":
42+
main()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python list_action_groups.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="187f412d-1758-44d9-b052-169e2564721d",
30+
)
31+
32+
response = client.action_groups.list_by_subscription_id()
33+
for item in response:
34+
print(item)
35+
36+
37+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/listActionGroups.json
38+
if __name__ == "__main__":
39+
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) AutoRest 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+
from azure.mgmt.monitor import MonitorManagementClient
11+
12+
"""
13+
# PREREQUISITES
14+
pip install azure-identity
15+
pip install azure-mgmt-monitor
16+
# USAGE
17+
python patch_action_group.py
18+
19+
Before run the sample, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
23+
"""
24+
25+
26+
def main():
27+
client = MonitorManagementClient(
28+
credential=DefaultAzureCredential(),
29+
subscription_id="187f412d-1758-44d9-b052-169e2564721d",
30+
)
31+
32+
response = client.action_groups.update(
33+
resource_group_name="Default-NotificationRules",
34+
action_group_name="SampleActionGroup",
35+
action_group_patch={"properties": {"enabled": False}, "tags": {"key1": "value1", "key2": "value2"}},
36+
)
37+
print(response)
38+
39+
40+
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/patchActionGroup.json
41+
if __name__ == "__main__":
42+
main()

0 commit comments

Comments
 (0)