forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 22792 in Azure/azure-rest-api-specs
{AzureMonitor} fixes Azure/azure-rest-api-specs#22716 fix the Metrics API version in the package-composite-v1 tag (Azure#22792) fixes Azure/azure-rest-api-specs#22716 fix the Metrics API version in the package-composite-v1 tag
- Loading branch information
SDKAuto
committed
Feb 28, 2023
1 parent
2c72ce6
commit 6bb8ba8
Showing
658 changed files
with
31,553 additions
and
9,223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"commit": "a61e5f218a0163431057ed9555eb60c58311792b", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
"autorest": "3.9.2", | ||
"use": [ | ||
"@autorest/python@6.1.9", | ||
"@autorest/python@6.4.0", | ||
"@autorest/[email protected]" | ||
], | ||
"commit": "5263f0b2ead74031fa567da2700411743da26e7f", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
"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", | ||
"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", | ||
"readme": "specification/monitor/resource-manager/readme.md" | ||
} |
128 changes: 128 additions & 0 deletions
128
sdk/monitor/azure-mgmt-monitor/azure/generated_samples/create_or_update_action_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python create_or_update_action_group.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="187f412d-1758-44d9-b052-169e2564721d", | ||
) | ||
|
||
response = client.action_groups.create_or_update( | ||
resource_group_name="Default-NotificationRules", | ||
action_group_name="SampleActionGroup", | ||
action_group={ | ||
"location": "Global", | ||
"properties": { | ||
"armRoleReceivers": [ | ||
{ | ||
"name": "Sample armRole", | ||
"roleId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635", | ||
"useCommonAlertSchema": True, | ||
} | ||
], | ||
"automationRunbookReceivers": [ | ||
{ | ||
"automationAccountId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest", | ||
"isGlobalRunbook": False, | ||
"name": "testRunbook", | ||
"runbookName": "Sample runbook", | ||
"serviceUri": "<serviceUri>", | ||
"useCommonAlertSchema": True, | ||
"webhookResourceId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084", | ||
} | ||
], | ||
"azureAppPushReceivers": [{"emailAddress": "[email protected]", "name": "Sample azureAppPush"}], | ||
"azureFunctionReceivers": [ | ||
{ | ||
"functionAppResourceId": "/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp", | ||
"functionName": "HttpTriggerCSharp1", | ||
"httpTriggerUrl": "http://test.me", | ||
"name": "Sample azureFunction", | ||
"useCommonAlertSchema": True, | ||
} | ||
], | ||
"emailReceivers": [ | ||
{"emailAddress": "[email protected]", "name": "John Doe's email", "useCommonAlertSchema": False}, | ||
{"emailAddress": "[email protected]", "name": "Jane Smith's email", "useCommonAlertSchema": True}, | ||
], | ||
"enabled": True, | ||
"eventHubReceivers": [ | ||
{ | ||
"eventHubName": "testEventHub", | ||
"eventHubNameSpace": "testEventHubNameSpace", | ||
"name": "Sample eventHub", | ||
"subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", | ||
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84", | ||
} | ||
], | ||
"groupShortName": "sample", | ||
"itsmReceivers": [ | ||
{ | ||
"connectionId": "a3b9076c-ce8e-434e-85b4-aff10cb3c8f1", | ||
"name": "Sample itsm", | ||
"region": "westcentralus", | ||
"ticketConfiguration": '{"PayloadRevision":0,"WorkItemType":"Incident","UseTemplate":false,"WorkItemData":"{}","CreateOneWIPerCI":false}', | ||
"workspaceId": "5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c", | ||
} | ||
], | ||
"logicAppReceivers": [ | ||
{ | ||
"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", | ||
"name": "Sample logicApp", | ||
"resourceId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp", | ||
"useCommonAlertSchema": False, | ||
} | ||
], | ||
"smsReceivers": [ | ||
{"countryCode": "1", "name": "John Doe's mobile", "phoneNumber": "1234567890"}, | ||
{"countryCode": "1", "name": "Jane Smith's mobile", "phoneNumber": "0987654321"}, | ||
], | ||
"voiceReceivers": [{"countryCode": "1", "name": "Sample voice", "phoneNumber": "1234567890"}], | ||
"webhookReceivers": [ | ||
{ | ||
"name": "Sample webhook 1", | ||
"serviceUri": "http://www.example.com/webhook1", | ||
"useCommonAlertSchema": True, | ||
}, | ||
{ | ||
"identifierUri": "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a", | ||
"name": "Sample webhook 2", | ||
"objectId": "d3bb868c-fe44-452c-aa26-769a6538c808", | ||
"serviceUri": "http://www.example.com/webhook2", | ||
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84", | ||
"useAadAuth": True, | ||
"useCommonAlertSchema": True, | ||
}, | ||
], | ||
}, | ||
"tags": {}, | ||
}, | ||
) | ||
print(response) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/createOrUpdateActionGroup.json | ||
if __name__ == "__main__": | ||
main() |
41 changes: 41 additions & 0 deletions
41
sdk/monitor/azure-mgmt-monitor/azure/generated_samples/delete_action_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python delete_action_group.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="187f412d-1758-44d9-b052-169e2564721d", | ||
) | ||
|
||
response = client.action_groups.delete( | ||
resource_group_name="Default-NotificationRules", | ||
action_group_name="SampleActionGroup", | ||
) | ||
print(response) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/deleteActionGroup.json | ||
if __name__ == "__main__": | ||
main() |
42 changes: 42 additions & 0 deletions
42
sdk/monitor/azure-mgmt-monitor/azure/generated_samples/enable_receiver.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python enable_receiver.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="187f412d-1758-44d9-b052-169e2564721d", | ||
) | ||
|
||
response = client.action_groups.enable_receiver( | ||
resource_group_name="Default-NotificationRules", | ||
action_group_name="SampleActionGroup", | ||
enable_request={"receiverName": "John Doe's mobile"}, | ||
) | ||
print(response) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/enableReceiver.json | ||
if __name__ == "__main__": | ||
main() |
41 changes: 41 additions & 0 deletions
41
sdk/monitor/azure-mgmt-monitor/azure/generated_samples/get_action_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python get_action_group.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="187f412d-1758-44d9-b052-169e2564721d", | ||
) | ||
|
||
response = client.action_groups.get( | ||
resource_group_name="Default-NotificationRules", | ||
action_group_name="SampleActionGroup", | ||
) | ||
print(response) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/getActionGroup.json | ||
if __name__ == "__main__": | ||
main() |
42 changes: 42 additions & 0 deletions
42
...-monitor/azure/generated_samples/get_test_notifications_at_action_group_resource_level.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python get_test_notifications_at_action_group_resource_level.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="11111111-1111-1111-1111-111111111111", | ||
) | ||
|
||
response = client.action_groups.get_test_notifications_at_action_group_resource_level( | ||
resource_group_name="TestRgName", | ||
action_group_name="TestAgName", | ||
notification_id="11000222191287", | ||
) | ||
print(response) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.json | ||
if __name__ == "__main__": | ||
main() |
39 changes: 39 additions & 0 deletions
39
sdk/monitor/azure-mgmt-monitor/azure/generated_samples/list_action_groups.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python list_action_groups.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="187f412d-1758-44d9-b052-169e2564721d", | ||
) | ||
|
||
response = client.action_groups.list_by_subscription_id() | ||
for item in response: | ||
print(item) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/listActionGroups.json | ||
if __name__ == "__main__": | ||
main() |
42 changes: 42 additions & 0 deletions
42
sdk/monitor/azure-mgmt-monitor/azure/generated_samples/patch_action_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# 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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.identity import DefaultAzureCredential | ||
from azure.mgmt.monitor import MonitorManagementClient | ||
|
||
""" | ||
# PREREQUISITES | ||
pip install azure-identity | ||
pip install azure-mgmt-monitor | ||
# USAGE | ||
python patch_action_group.py | ||
Before run the sample, please set the values of the client ID, tenant ID and client secret | ||
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, | ||
AZURE_CLIENT_SECRET. For more info about how to get the value, please see: | ||
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
""" | ||
|
||
|
||
def main(): | ||
client = MonitorManagementClient( | ||
credential=DefaultAzureCredential(), | ||
subscription_id="187f412d-1758-44d9-b052-169e2564721d", | ||
) | ||
|
||
response = client.action_groups.update( | ||
resource_group_name="Default-NotificationRules", | ||
action_group_name="SampleActionGroup", | ||
action_group_patch={"properties": {"enabled": False}, "tags": {"key1": "value1", "key2": "value2"}}, | ||
) | ||
print(response) | ||
|
||
|
||
# x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/patchActionGroup.json | ||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.