Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-monitor] update metric version #2933

Closed
wants to merge 1 commit into from
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "c2e0bcfef9b9d873ee36a62621c94771534c831b",
"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"
}
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()
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()
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()
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()
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()
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()
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()
Loading