Skip to content

Commit a381892

Browse files
azure-sdkmsyycWzb123456789
authored
[AutoRelease] t2-monitor-2023-03-08-59168(can only be merged by SDK owner) (Azure#29214)
* code and test * Update CHANGELOG.md * Update shared_requirements.txt --------- Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: zhenbiao wei <424401670@qq.com>
1 parent 0b3fb9e commit a381892

File tree

716 files changed

+49062
-10057
lines changed

Some content is hidden

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

716 files changed

+49062
-10057
lines changed

sdk/monitor/azure-mgmt-monitor/CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
11
# Release History
22

3+
## 6.0.0 (2023-03-20)
4+
5+
### Features Added
6+
7+
- Added operation MetricDefinitionsOperations.list_at_subscription_scope
8+
- Added operation MetricsOperations.list_at_subscription_scope
9+
- Added operation MetricsOperations.list_at_subscription_scope_post
10+
- Added operation group AzureMonitorWorkspacesOperations
11+
- Added operation group MonitorOperationsOperations
12+
- Added operation group TenantActionGroupsOperations
13+
- Model AzureMonitorPrivateLinkScope has a new parameter system_data
14+
- Model Condition has a new parameter metric_name
15+
- Model DataCollectionEndpoint has a new parameter failover_configuration
16+
- Model DataCollectionEndpoint has a new parameter metadata
17+
- Model DataCollectionEndpoint has a new parameter metrics_ingestion
18+
- Model DataCollectionEndpoint has a new parameter private_link_scoped_resources
19+
- Model DataCollectionEndpointResource has a new parameter failover_configuration
20+
- Model DataCollectionEndpointResource has a new parameter identity
21+
- Model DataCollectionEndpointResource has a new parameter metadata
22+
- Model DataCollectionEndpointResource has a new parameter metrics_ingestion
23+
- Model DataCollectionEndpointResource has a new parameter private_link_scoped_resources
24+
- Model DataCollectionEndpointResourceProperties has a new parameter failover_configuration
25+
- Model DataCollectionEndpointResourceProperties has a new parameter metadata
26+
- Model DataCollectionEndpointResourceProperties has a new parameter metrics_ingestion
27+
- Model DataCollectionEndpointResourceProperties has a new parameter private_link_scoped_resources
28+
- Model DataCollectionRuleAssociationMetadata has a new parameter provisioned_by_resource_id
29+
- Model DataCollectionRuleDataSources has a new parameter data_imports
30+
- Model DataCollectionRuleDataSources has a new parameter platform_telemetry
31+
- Model DataCollectionRuleDataSources has a new parameter prometheus_forwarder
32+
- Model DataCollectionRuleDataSources has a new parameter windows_firewall_logs
33+
- Model DataCollectionRuleDestinations has a new parameter event_hubs
34+
- Model DataCollectionRuleDestinations has a new parameter event_hubs_direct
35+
- Model DataCollectionRuleDestinations has a new parameter monitoring_accounts
36+
- Model DataCollectionRuleDestinations has a new parameter storage_accounts
37+
- Model DataCollectionRuleDestinations has a new parameter storage_blobs_direct
38+
- Model DataCollectionRuleDestinations has a new parameter storage_tables_direct
39+
- Model DataCollectionRuleMetadata has a new parameter provisioned_by_resource_id
40+
- Model DataCollectionRuleResource has a new parameter identity
41+
- Model DataFlow has a new parameter built_in_transform
42+
- Model DataSourcesSpec has a new parameter data_imports
43+
- Model DataSourcesSpec has a new parameter platform_telemetry
44+
- Model DataSourcesSpec has a new parameter prometheus_forwarder
45+
- Model DataSourcesSpec has a new parameter windows_firewall_logs
46+
- Model DestinationsSpec has a new parameter event_hubs
47+
- Model DestinationsSpec has a new parameter event_hubs_direct
48+
- Model DestinationsSpec has a new parameter monitoring_accounts
49+
- Model DestinationsSpec has a new parameter storage_accounts
50+
- Model DestinationsSpec has a new parameter storage_blobs_direct
51+
- Model DestinationsSpec has a new parameter storage_tables_direct
52+
- Model Metadata has a new parameter provisioned_by_resource_id
53+
- Model Operation has a new parameter action_type
54+
- Model Operation has a new parameter origin
55+
- Model PrivateLinkResource has a new parameter required_zone_names
56+
- Model ResourceForUpdate has a new parameter identity
57+
- Model ScheduledQueryRuleResource has a new parameter auto_mitigate
58+
- Model ScheduledQueryRuleResource has a new parameter check_workspace_alerts_storage_configured
59+
- Model ScheduledQueryRuleResource has a new parameter identity
60+
- Model ScheduledQueryRuleResource has a new parameter is_workspace_alerts_storage_configured
61+
- Model ScheduledQueryRuleResource has a new parameter public_network_access
62+
- Model ScheduledQueryRuleResource has a new parameter rule_resolve_configuration
63+
- Model ScheduledQueryRuleResource has a new parameter skip_query_validation
64+
- Model ScheduledQueryRuleResource has a new parameter system_data
65+
- Model ScheduledQueryRuleResourceCollection has a new parameter next_link
66+
- Model ScheduledQueryRuleResourcePatch has a new parameter auto_mitigate
67+
- Model ScheduledQueryRuleResourcePatch has a new parameter check_workspace_alerts_storage_configured
68+
- Model ScheduledQueryRuleResourcePatch has a new parameter identity
69+
- Model ScheduledQueryRuleResourcePatch has a new parameter is_workspace_alerts_storage_configured
70+
- Model ScheduledQueryRuleResourcePatch has a new parameter public_network_access
71+
- Model ScheduledQueryRuleResourcePatch has a new parameter rule_resolve_configuration
72+
- Model ScheduledQueryRuleResourcePatch has a new parameter skip_query_validation
73+
- Model ScopedResource has a new parameter system_data
74+
- Operation MetricsOperations.list has a new optional parameter auto_adjust_timegrain
75+
- Operation MetricsOperations.list has a new optional parameter validate_dimensions
76+
77+
### Breaking Changes
78+
79+
- Model AzureMonitorPrivateLinkScope has a new required parameter access_mode_settings
80+
- Model Operation no longer has parameter service_specification
81+
- Model OperationDisplay no longer has parameter publisher
82+
- Model PrivateEndpointConnectionListResult no longer has parameter next_link
83+
- Model PrivateLinkResourceListResult no longer has parameter next_link
84+
- Removed operation ActionGroupsOperations.begin_create_notifications_at_resource_group_level
85+
- Removed operation ActionGroupsOperations.begin_post_test_notifications
86+
- Removed operation ActionGroupsOperations.get_test_notifications
87+
- Removed operation ActionGroupsOperations.get_test_notifications_at_resource_group_level
88+
389
## 5.0.1 (2022-09-30)
490

591
### Bugs Fixed

sdk/monitor/azure-mgmt-monitor/README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,52 @@ For a more complete view of Azure libraries, see the [azure sdk python release](
88

99
_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_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/monitoring?view=azure-python-preview)
17-
Code samples for this package can be found at [Monitor](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/monitor)
15+
- Python 3.7+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-monitor
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.monitor import MonitorManagementClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = MonitorManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
49+
Code samples for this package can be found at [Monitor](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
50+
51+
52+
## Troubleshooting
53+
54+
## Next steps
55+
56+
## Provide Feedback
2257

2358
If you encounter any bugs or have suggestions, please file an issue in the
2459
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2+
"commit": "7d313ecb6a58a51046a3916ee5ea6b6d29973522",
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.3",
57
"@autorest/modelerfour@4.24.3"
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/python@6.1.9 --use=@autorest/modelerfour@4.24.3 --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=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.3 --use=@autorest/modelerfour@4.24.3 --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": "johndoe@email.com", "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": "johndoe@email.com", "name": "John Doe's email", "useCommonAlertSchema": False},
68+
{"emailAddress": "janesmith@email.com", "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()

0 commit comments

Comments
 (0)