diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 53c8c6e98ae..99c5c2e6ced 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -166,4 +166,6 @@ /src/automation/ @arrownj +/src/monitor-control-service/ @jsntcy @msyyc @kairu-ms + /src/rdbms-connect/ @mjain2 @Juliehzl diff --git a/.gitignore b/.gitignore index a938084efe9..5167b738c2b 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,5 @@ _build/ # Mac desktop service store files .DS_Store + +_az_debug/ \ No newline at end of file diff --git a/src/monitor-control-service/HISTORY.rst b/src/monitor-control-service/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/monitor-control-service/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/monitor-control-service/README.md b/src/monitor-control-service/README.md new file mode 100644 index 00000000000..ae06ad18062 --- /dev/null +++ b/src/monitor-control-service/README.md @@ -0,0 +1,161 @@ +# Azure CLI monitor-control-service Extension +This is the extension for monitor-control-service + +### How to use +Install this extension using the below CLI command +``` +az extension add --name monitor-control-service +``` + +### Included Features +#### data-collection rule +##### Create +``` +az monitor data-collection rule create --resource-group "myResourceGroup" --location "eastus" --name "myCollectionRule" --data-flows destinations="centralWorkspace" streams="Microsoft-Perf" streams="Microsoft-Syslog" streams="Microsoft-WindowsEvent" --log-analytics name="centralWorkspace" resource-id="/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" --performance-counters name="cloudTeamCoreCounters" counter-specifiers="\\Processor(_Total)\\% Processor Time" counter-specifiers="\\Memory\\Committed Bytes" counter-specifiers="\\LogicalDisk(_Total)\\Free Megabytes" counter-specifiers="\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" sampling-frequency=15 transfer-period="PT1M" streams="Microsoft-Perf" --performance-counters name="appTeamExtraCounters" counter-specifiers="\\Process(_Total)\\Thread Count" sampling-frequency=30 transfer-period="PT5M" streams="Microsoft-Perf" --syslog name="cronSyslog" facility-names="cron" log-levels="Debug" log-levels="Critical" log-levels="Emergency" streams="Microsoft-Syslog" --syslog name="syslogBase" facility-names="syslog" log-levels="Alert" log-levels="Critical" log-levels="Emergency" streams="Microsoft-Syslog" --windows-event-logs name="cloudSecurityTeamEvents" transfer-period="PT1M" streams="Microsoft-WindowsEvent" x-path-queries="Security!" --windows-event-logs name="appTeam1AppEvents" transfer-period="PT5M" streams="Microsoft-WindowsEvent" x-path-queries="System![System[(Level = 1 or Level = 2 or Level = 3)]]" x-path-queries="Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" +``` +##### Show +``` +az monitor data-collection rule show --name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### List +List data collection rules by resource group +``` +az monitor data-collection rule list --resource-group "myResourceGroup" +``` +List data collection rules by subscription +``` +az monitor data-collection rule list +``` +##### Update +``` +az monitor data-collection rule update --resource-group "myResourceGroup" --name "myCollectionRule" --data-flows destinations="centralWorkspace" streams="Microsoft-Perf" streams="Microsoft-Syslog" streams="Microsoft-WindowsEvent" --log-analytics name="centralWorkspace" resource-id="/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace" --performance-counters name="appTeamExtraCounters" counter-specifiers="\\Process(_Total)\\Thread Count" sampling-frequency=30 transfer-period="PT5M" streams="Microsoft-Perf" --syslog name="cronSyslog" facility-names="cron" log-levels="Debug" log-levels="Critical" log-levels="Emergency" streams="Microsoft-Syslog" --windows-event-logs name="cloudSecurityTeamEvents" transfer-period="PT1M" streams="Microsoft-WindowsEvent" x-path-queries="Security!" +``` +##### Delete +``` +az monitor data-collection rule delete --name "myCollectionRule" --resource-group "myResourceGroup" +``` + +#### data-collection rule data-flow +##### List +``` +az monitor data-collection rule data-flow list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Add +``` +az monitor data-collection rule data-flow add --rule-name "myCollectionRule" --resource-group "myResourceGroup" --destinations XX3 XX4 --streams "Microsoft-Perf" "Microsoft-WindowsEvent" +``` + +#### data-collection rule log-analytics +##### List +``` +az monitor data-collection rule log-analytics list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Show +``` +az monitor data-collection rule log-analytics show --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "centralWorkspace" +``` +##### Add +``` +az monitor data-collection rule log-analytics add --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "workspace2" --resource-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/workspace2" +``` +##### Delete +``` +az monitor data-collection rule log-analytics delete --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "workspace2" +``` +##### Update +``` +az monitor data-collection rule log-analytics update --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "workspace2" --resource-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/anotherWorkspace" +``` + +#### data-collection rule performance-counter +##### List +``` +az monitor data-collection rule performance-counter list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Show +``` +az monitor data-collection rule performance-counter show --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "appTeamExtraCounters" +``` +##### Add +``` +az monitor data-collection rule performance-counter add --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "team2ExtraCounters" --streams "Microsoft-Perf" --counter-specifiers "\\Process(_Total)\\Thread Count" "\\LogicalDisk(_Total)\\Free Megabytes" --sampling-frequency 30 --transfer-period PT15M +``` +##### Delete +``` +az monitor data-collection rule performance-counter delete --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "team2ExtraCounters" +``` +##### Update +``` +az monitor data-collection rule performance-counter update --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "team2ExtraCounters" --transfer-period PT1M +``` + +#### data-collection rule windows-event-log +##### List +``` +az monitor data-collection rule windows-event-log list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Show +``` +az monitor data-collection rule windows-event-log show --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "appTeam1AppEvents" +``` +##### Add +``` +az monitor data-collection rule windows-event-log add --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "appTeam1AppEvents" --transfer-period "PT1M" --streams "Microsoft-WindowsEvent" --x-path-queries "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" "System![System[(Level = 1 or Level = 2 or Level = 3)]]" +``` +##### Delete +``` +az monitor data-collection rule windows-event-log delete --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "appTeam1AppEvents" +``` +##### Update +``` +az monitor data-collection rule windows-event-log update --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "appTeam1AppEvents" --x-path-queries "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" +``` + +#### data-collection rule syslog +##### List +``` +az monitor data-collection rule syslog list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Show +``` +az monitor data-collection rule syslog show --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "syslogBase" +``` +##### Add +``` +az monitor data-collection rule syslog add --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "syslogBase" --facility-names "syslog" --log-levels "Alert" "Critical" --streams "Microsoft-Syslog" +``` +##### Delete +``` +az monitor data-collection rule syslog delete --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "syslogBase" +``` +##### Update +``` +az monitor data-collection rule syslog update --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "syslogBase" --facility-names "syslog" --log-levels "Emergency" "Critical" +``` + +#### data-collection rule association +##### Create +``` +az monitor data-collection rule association create --name "myAssociation" --rule-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### Show +``` +az monitor data-collection rule association show --name "myAssociation" --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### Update +``` +az monitor data-collection rule association update --name "myAssociation" --rule-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule" --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### List +List associations for specified data collection rule +``` +az monitor data-collection rule association list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +List associations for specified resource +``` +az monitor data-collection rule association list --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### Delete +``` +az monitor data-collection rule association delete --name "myAssociation" --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` diff --git a/src/monitor-control-service/azext_amcs/__init__.py b/src/monitor-control-service/azext_amcs/__init__.py new file mode 100644 index 00000000000..af0cf41cc90 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# 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.cli.core import AzCommandsLoader +from azext_amcs.generated._help import helps # pylint: disable=unused-import +try: + from azext_amcs.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class MonitorClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_amcs.generated._client_factory import cf_monitor_control_service_cl + monitor_control_service_custom = CliCommandType( + operations_tmpl='azext_amcs.custom#{}', + client_factory=cf_monitor_control_service_cl) + parent = super(MonitorClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=monitor_control_service_custom) + + def load_command_table(self, args): + from azext_amcs.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_amcs.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_amcs.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_amcs.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = MonitorClientCommandsLoader diff --git a/src/monitor-control-service/azext_amcs/action.py b/src/monitor-control-service/azext_amcs/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/monitor-control-service/azext_amcs/azext_metadata.json b/src/monitor-control-service/azext_amcs/azext_metadata.json new file mode 100644 index 00000000000..30fdaf614ee --- /dev/null +++ b/src/monitor-control-service/azext_amcs/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/monitor-control-service/azext_amcs/custom.py b/src/monitor-control-service/azext_amcs/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/monitor-control-service/azext_amcs/generated/__init__.py b/src/monitor-control-service/azext_amcs/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/monitor-control-service/azext_amcs/generated/_client_factory.py b/src/monitor-control-service/azext_amcs/generated/_client_factory.py new file mode 100644 index 00000000000..8886ffe1aac --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/_client_factory.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_monitor_control_service_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_amcs.vendored_sdks.amcs import MonitorClient + return get_mgmt_service_client(cli_ctx, + MonitorClient) + + +def cf_data_collection_rule_association(cli_ctx, *_): + return cf_monitor_control_service_cl(cli_ctx).data_collection_rule_associations + + +def cf_data_collection_rule(cli_ctx, *_): + return cf_monitor_control_service_cl(cli_ctx).data_collection_rules diff --git a/src/monitor-control-service/azext_amcs/generated/_help.py b/src/monitor-control-service/azext_amcs/generated/_help.py new file mode 100644 index 00000000000..35938f8619e --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/_help.py @@ -0,0 +1,91 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['monitor data-collection rule association'] = """ + type: group + short-summary: Manage data collection rule association with monitor control service +""" + +helps['monitor data-collection rule association list'] = """ + type: command + short-summary: "Lists associations for the specified data collection rule. And Lists associations for the \ +specified resource." + examples: + - name: List associations for specified data collection rule + text: |- + az monitor data-collection rule association list --rule-name "myCollectionRule" --resource-group \ +"myResourceGroup" + - name: List associations for specified resource + text: |- + az monitor data-collection rule association list --resource "subscriptions/703362b3-f278-4e4b-9179-c76ea\ +f41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +""" + +helps['monitor data-collection rule association show'] = """ + type: command + short-summary: "Returns the specified association." + examples: + - name: Get association + text: |- + az monitor data-collection rule association show --name "myAssociation" --resource \ +"subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualM\ +achines/myVm" +""" + +helps['monitor data-collection rule association delete'] = """ + type: command + short-summary: "Deletes an association." + examples: + - name: Delete association + text: |- + az monitor data-collection rule association delete --name "myAssociation" --resource \ +"subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualM\ +achines/myVm" +""" + +helps['monitor data-collection rule'] = """ + type: group + short-summary: Manage data collection rule with monitor control service +""" + +helps['monitor data-collection rule list'] = """ + type: command + short-summary: "Lists all data collection rules in the specified resource group. And Lists all data collection \ +rules in the specified subscription." + examples: + - name: List data collection rules by resource group + text: |- + az monitor data-collection rule list --resource-group "myResourceGroup" + - name: List data collection rules by subscription + text: |- + az monitor data-collection rule list +""" + +helps['monitor data-collection rule show'] = """ + type: command + short-summary: "Returns the specified data collection rule." + examples: + - name: Get data collection rule + text: |- + az monitor data-collection rule show --name "myCollectionRule" --resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule delete'] = """ + type: command + short-summary: "Deletes a data collection rule." + examples: + - name: Delete data collection rule + text: |- + az monitor data-collection rule delete --name "myCollectionRule" --resource-group "myResourceGroup" +""" diff --git a/src/monitor-control-service/azext_amcs/generated/_params.py b/src/monitor-control-service/azext_amcs/generated/_params.py new file mode 100644 index 00000000000..2d90b23807e --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/_params.py @@ -0,0 +1,43 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import resource_group_name_type + + +def load_arguments(self, _): + + with self.argument_context('monitor data-collection rule association list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('data_collection_rule_name', options_list=['--rule-name'], type=str, help='The name of the data ' + 'collection rule. The name is case insensitive.') + c.argument('resource_uri', options_list=['--resource'], type=str, help='The identifier of the resource.') + + with self.argument_context('monitor data-collection rule association show') as c: + c.argument('resource_uri', options_list=['--resource'], type=str, help='The identifier of the resource.') + c.argument('association_name', options_list=['--name', '-n'], type=str, help='The name of the association.') + + with self.argument_context('monitor data-collection rule association delete') as c: + c.argument('resource_uri', options_list=['--resource'], type=str, help='The identifier of the resource.') + c.argument('association_name', options_list=['--name', '-n'], type=str, help='The name of the association.') + + with self.argument_context('monitor data-collection rule list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('monitor data-collection rule show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('data_collection_rule_name', options_list=['--name', '-n'], type=str, + help='The name of the data collection rule. The name is case insensitive.', id_part='name') + + with self.argument_context('monitor data-collection rule delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('data_collection_rule_name', options_list=['--name', '-n'], type=str, + help='The name of the data collection rule. The name is case insensitive.', id_part='name') diff --git a/src/monitor-control-service/azext_amcs/generated/_validators.py b/src/monitor-control-service/azext_amcs/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/monitor-control-service/azext_amcs/generated/action.py b/src/monitor-control-service/azext_amcs/generated/action.py new file mode 100644 index 00000000000..b49bfaeeefe --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/action.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access diff --git a/src/monitor-control-service/azext_amcs/generated/commands.py b/src/monitor-control-service/azext_amcs/generated/commands.py new file mode 100644 index 00000000000..f490759122e --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/commands.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_amcs.generated._client_factory import cf_data_collection_rule_association + monitor_control_service_data_collection_rule_association = CliCommandType( + operations_tmpl='azext_amcs.vendored_sdks.amcs.operations._data_collection_rule_associations_operations#DataCol' + 'lectionRuleAssociationsOperations.{}', + client_factory=cf_data_collection_rule_association) + with self.command_group('monitor data-collection rule association', + monitor_control_service_data_collection_rule_association, + client_factory=cf_data_collection_rule_association) as g: + g.custom_command('list', 'monitor_data_collection_rule_association_list') + g.custom_show_command('show', 'monitor_data_collection_rule_association_show') + g.custom_command('delete', 'monitor_data_collection_rule_association_delete', confirmation=True) + + from azext_amcs.generated._client_factory import cf_data_collection_rule + monitor_control_service_data_collection_rule = CliCommandType( + operations_tmpl='azext_amcs.vendored_sdks.amcs.operations._data_collection_rules_operations#DataCollectionRules' + 'Operations.{}', + client_factory=cf_data_collection_rule) + with self.command_group('monitor data-collection rule', monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_command('list', 'monitor_data_collection_rule_list') + g.custom_show_command('show', 'monitor_data_collection_rule_show') + g.custom_command('delete', 'monitor_data_collection_rule_delete', confirmation=True) + + with self.command_group('monitor-control-service', is_preview=True): + pass diff --git a/src/monitor-control-service/azext_amcs/generated/custom.py b/src/monitor-control-service/azext_amcs/generated/custom.py new file mode 100644 index 00000000000..db07c469953 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/generated/custom.py @@ -0,0 +1,55 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + + +def monitor_data_collection_rule_association_list(client, + resource_group_name=None, + data_collection_rule_name=None, + resource_uri=None): + if resource_group_name and data_collection_rule_name is not None: + return client.list_by_rule(resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name) + return client.list_by_resource(resource_uri=resource_uri) + + +def monitor_data_collection_rule_association_show(client, + resource_uri, + association_name): + return client.get(resource_uri=resource_uri, + association_name=association_name) + + +def monitor_data_collection_rule_association_delete(client, + resource_uri, + association_name): + return client.delete(resource_uri=resource_uri, + association_name=association_name) + + +def monitor_data_collection_rule_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def monitor_data_collection_rule_show(client, + resource_group_name, + data_collection_rule_name): + return client.get(resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name) + + +def monitor_data_collection_rule_delete(client, + resource_group_name, + data_collection_rule_name): + return client.delete(resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name) diff --git a/src/monitor-control-service/azext_amcs/manual/__init__.py b/src/monitor-control-service/azext_amcs/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/manual/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/monitor-control-service/azext_amcs/manual/_help.py b/src/monitor-control-service/azext_amcs/manual/_help.py new file mode 100644 index 00000000000..00516e1d68d --- /dev/null +++ b/src/monitor-control-service/azext_amcs/manual/_help.py @@ -0,0 +1,570 @@ +# 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. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps + +helps['monitor data-collection'] = """ + type: group + short-summary: Manage data collection for monitor control service +""" + +helps['monitor data-collection rule association'] = """ + type: group + short-summary: Manage data collection rule association for monitor control service +""" + +helps['monitor data-collection rule association list'] = """ + type: command + short-summary: "List associations for the specified data collection rule. And Lists associations for the \ +specified resource." + examples: + - name: List associations for specified data collection rule + text: |- + az monitor data-collection rule association list --rule-name "myCollectionRule" --resource-group \ +"myResourceGroup" + - name: List associations for specified resource + text: |- + az monitor data-collection rule association list --resource "subscriptions/703362b3-f278-4e4b-9179-c76ea\ +f41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +""" + +helps['monitor data-collection rule association show'] = """ + type: command + short-summary: "Return the specified association." + examples: + - name: Get association + text: |- + az monitor data-collection rule association show --name "myAssociation" --resource \ +"subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualM\ +achines/myVm" +""" + +helps['monitor data-collection rule association create'] = """ + type: command + short-summary: "Create an association." + examples: + - name: Create association + text: |- + az monitor data-collection rule association create --name "myAssociation" --rule-id \ +"/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCo\ +llectionRules/myCollectionRule" --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourc\ +eGroup/providers/Microsoft.Compute/virtualMachines/myVm" +""" + +helps['monitor data-collection rule association update'] = """ + type: command + short-summary: "Update an association." + examples: + - name: Update association + text: |- + az monitor data-collection rule association update --name "myAssociation" --rule-id \ +"/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCo\ +llectionRules/myCollectionRule" --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourc\ +eGroup/providers/Microsoft.Compute/virtualMachines/myVm" +""" + +helps['monitor data-collection rule association delete'] = """ + type: command + short-summary: "Delete an association." + examples: + - name: Delete association + text: |- + az monitor data-collection rule association delete --name "myAssociation" --resource \ +"subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualM\ +achines/myVm" +""" + +helps['monitor data-collection rule'] = """ + type: group + short-summary: Manage data collection rule for monitor control service +""" + +helps['monitor data-collection rule list'] = """ + type: command + short-summary: "List all data collection rules in the specified resource group. And Lists all data collection \ +rules in the specified subscription." + examples: + - name: List data collection rules by resource group + text: |- + az monitor data-collection rule list --resource-group "myResourceGroup" + - name: List data collection rules by subscription + text: |- + az monitor data-collection rule list +""" + +helps['monitor data-collection rule show'] = """ + type: command + short-summary: "Return the specified data collection rule." + examples: + - name: Get data collection rule + text: |- + az monitor data-collection rule show --name "myCollectionRule" --resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule create'] = """ + type: command + short-summary: "Create a data collection rule." + parameters: + - name: --data-flows + short-summary: "The specification of data flows." + long-summary: | + Usage: --data-flows streams=XX1 streams=XX2 destinations=XX1 destinations=XX2 + + streams: Required. List of streams for this data flow. + destinations: Required. List of destinations for this data flow. + + Multiple actions can be specified by using more than one --data-flows argument. + - name: --log-analytics + short-summary: "List of Log Analytics destinations." + long-summary: | + Usage: --log-analytics resource-id=XX name=XX + + resource-id: Required. The resource ID of the Log Analytics workspace. + name: Required. A friendly name for the destination. This name should be unique across all destinations \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --log-analytics argument. + - name: --monitor-metrics + short-summary: "Azure Monitor Metrics destination." + long-summary: | + Usage: --monitor-metrics name=XX + + name: Required. A friendly name for the destination. This name should be unique across all destinations \ +(regardless of type) within the data collection rule. + - name: --performance-counters + short-summary: "The list of performance counter data source configurations." + long-summary: | + Usage: --performance-counters streams=XX1 streams=XX2 transfer-period=XX \ +sampling-frequency=XX counter-specifiers=XX1 counter-specifiers=XX2 name=XX + + streams: Required. List of streams that this data source will be sent to. A stream indicates what schema \ +will be used for this data and usually what table in Log Analytics the data will be sent to. + transfer-period: Required. The interval between data uploads (scheduled transfers), rounded up \ +to the nearest minute. + sampling-frequency: Required. The number of seconds between consecutive counter measurements \ +(samples). + counter-specifiers: Required. A list of specifier names of the performance counters you want to collect. \ +Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run the \ +command 'typeperf'. + name: Required. A friendly name for the data source. This name should be unique across all data sources \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --performance-counters argument. + - name: --windows-event-logs + short-summary: "The list of Windows Event Log data source configurations." + long-summary: | + Usage: --windows-event-logs streams=XX1 streams=XX2 transfer-period=XX x-path-queries=XX1 \ +x-path-queries=XX2 name=XX + + streams: Required. List of streams that this data source will be sent to. A stream indicates what schema \ +will be used for this data and usually what table in Log Analytics the data will be sent to. + transfer-period: Required. The interval between data uploads (scheduled transfers), rounded up \ +to the nearest minute. + x-path-queries: Required. A list of Windows Event Log queries in XPATH format. + name: Required. A friendly name for the data source. This name should be unique across all data sources \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --windows-event-logs argument. + - name: --syslog + short-summary: "The list of Syslog data source configurations." + long-summary: | + Usage: --syslog streams=XX1 streams=XX2 facility-names=XX1 facility-names=XX2 log-levels=XX1 log-levels=XX2 \ +name=XX + + streams: Required. List of streams that this data source will be sent to. A stream indicates what schema \ +will be used for this data and usually what table in Log Analytics the data will be sent to. + facility-names: Required. The list of facility names. + log-levels: The log levels to collect. + name: Required. A friendly name for the data source. This name should be unique across all data sources \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --syslog argument. + examples: + - name: Create data collection rule + text: |- + az monitor data-collection rule create --resource-group "myResourceGroup" --location "eastus" \ +--name "myCollectionRule" \ +--data-flows destinations="centralWorkspace" streams="Microsoft-Perf" streams="Microsoft-Syslog" \ +streams="Microsoft-WindowsEvent" \ +--log-analytics name="centralWorkspace" \ +resource-id="/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Mic\ +rosoft.OperationalInsights/workspaces/centralTeamWorkspace" \ +--performance-counters name="cloudTeamCoreCounters" counter-specifiers="\\\\Processor(_Total)\\\\% Processor Time" \ +counter-specifiers="\\\\Memory\\\\Committed Bytes" counter-specifiers="\\\\LogicalDisk(_Total)\\\\Free Megabytes" \ +counter-specifiers="\\\\PhysicalDisk(_Total)\\\\Avg. Disk Queue Length" sampling-frequency=15 \ +transfer-period="PT1M" streams="Microsoft-Perf" \ +--performance-counters name="appTeamExtraCounters" \ +counter-specifiers="\\\\Process(_Total)\\\\Thread Count" sampling-frequency=30 \ +transfer-period="PT5M" streams="Microsoft-Perf" \ +--syslog name="cronSyslog" facility-names="cron" log-levels="Debug" log-levels="Critical" log-levels="Emergency" \ +streams="Microsoft-Syslog" \ +--syslog name="syslogBase" facility-names="syslog" log-levels="Alert" log-levels="Critical" log-levels="Emergency" \ +streams="Microsoft-Syslog" \ +--windows-event-logs name="cloudSecurityTeamEvents" transfer-period="PT1M" streams="Microsoft-WindowsEvent" \ +x-path-queries="Security!" \ +--windows-event-logs name="appTeam1AppEvents" transfer-period="PT5M" streams="Microsoft-WindowsEvent" \ +x-path-queries="System![System[(Level = 1 or Level = 2 or Level = 3)]]" \ +x-path-queries="Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" + +""" + +helps['monitor data-collection rule update'] = """ + type: command + short-summary: "Update a data collection rule." + parameters: + - name: --data-flows + short-summary: "The specification of data flows." + long-summary: | + Usage: --data-flows streams=XX1 streams=XX2 destinations=XX1 destinations=XX2 + + streams: Required. List of streams for this data flow. + destinations: Required. List of destinations for this data flow. + + Multiple actions can be specified by using more than one --data-flows argument. + - name: --log-analytics + short-summary: "List of Log Analytics destinations." + long-summary: | + Usage: --log-analytics resource-id=XX name=XX + + resource-id: Required. The resource ID of the Log Analytics workspace. + name: Required. A friendly name for the destination. This name should be unique across all destinations \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --log-analytics argument. + - name: --monitor-metrics + short-summary: "Azure Monitor Metrics destination." + long-summary: | + Usage: --monitor-metrics name=XX + + name: Required. A friendly name for the destination. This name should be unique across all destinations \ +(regardless of type) within the data collection rule. + - name: --performance-counters + short-summary: "The list of performance counter data source configurations." + long-summary: | + Usage: --performance-counters streams=XX1 streams=XX2 transfer-period=XX \ +sampling-frequency=XX counter-specifiers=XX1 counter-specifiers=XX2 name=XX + + streams: Required. List of streams that this data source will be sent to. A stream indicates what schema \ +will be used for this data and usually what table in Log Analytics the data will be sent to. + transfer-period: Required. The interval between data uploads (scheduled transfers), rounded up \ +to the nearest minute. + sampling-frequency: Required. The number of seconds between consecutive counter measurements \ +(samples). + counter-specifiers: Required. A list of specifier names of the performance counters you want to collect. \ +Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run the \ +command 'typeperf'. + name: Required. A friendly name for the data source. This name should be unique across all data sources \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --performance-counters argument. + - name: --windows-event-logs + short-summary: "The list of Windows Event Log data source configurations." + long-summary: | + Usage: --windows-event-logs streams=XX1 streams=XX2 transfer-period=XX x-path-queries=XX1 \ +x-path-queries=XX2 name=XX + + streams: Required. List of streams that this data source will be sent to. A stream indicates what schema \ +will be used for this data and usually what table in Log Analytics the data will be sent to. + transfer-period: Required. The interval between data uploads (scheduled transfers), rounded up \ +to the nearest minute. + x-path-queries: Required. A list of Windows Event Log queries in XPATH format. + name: Required. A friendly name for the data source. This name should be unique across all data sources \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --windows-event-logs argument. + - name: --syslog + short-summary: "The list of Syslog data source configurations." + long-summary: | + Usage: --syslog streams=XX1 streams=XX2 facility-names=XX1 facility-names=XX2 log-levels=XX1 log-levels=XX2 \ +name=XX + + streams: Required. List of streams that this data source will be sent to. A stream indicates what schema \ +will be used for this data and usually what table in Log Analytics the data will be sent to. + facility-names: Required. The list of facility names. + log-levels: The log levels to collect. + name: Required. A friendly name for the data source. This name should be unique across all data sources \ +(regardless of type) within the data collection rule. + + Multiple actions can be specified by using more than one --syslog argument. + examples: + - name: Update data collection rule + text: |- + az monitor data-collection rule update --resource-group "myResourceGroup" --name "myCollectionRule" \ +--data-flows destinations="centralWorkspace" streams="Microsoft-Perf" streams="Microsoft-Syslog" \ +streams="Microsoft-WindowsEvent" \ +--log-analytics name="centralWorkspace" \ +resource-id="/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Mic\ +rosoft.OperationalInsights/workspaces/centralTeamWorkspace" \ +--performance-counters name="appTeamExtraCounters" \ +counter-specifiers="\\\\Process(_Total)\\\\Thread Count" sampling-frequency=30 \ +transfer-period="PT5M" streams="Microsoft-Perf" \ +--syslog name="cronSyslog" facility-names="cron" log-levels="Debug" log-levels="Critical" log-levels="Emergency" \ +streams="Microsoft-Syslog" \ +--windows-event-logs name="cloudSecurityTeamEvents" transfer-period="PT1M" streams="Microsoft-WindowsEvent" \ +x-path-queries="Security!" +""" + +helps['monitor data-collection rule delete'] = """ + type: command + short-summary: "Deletes a data collection rule." + examples: + - name: Delete data collection rule + text: |- + az monitor data-collection rule delete --name "myCollectionRule" --resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule data-flow'] = """ + type: group + short-summary: Manage data flows. +""" + +helps['monitor data-collection rule data-flow list'] = """ + type: command + short-summary: List data flows. + examples: + - name: List data flows + text: |- + az monitor data-collection rule data-flow list --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule data-flow add'] = """ + type: command + short-summary: Add a data flow. + examples: + - name: Add a data flow + text: |- + az monitor data-collection rule data-flow add --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --destinations XX3 XX4 --streams "Microsoft-Perf" "Microsoft-WindowsEvent" +""" + +helps['monitor data-collection rule log-analytics'] = """ + type: group + short-summary: Manage Log Analytics destinations. +""" + +helps['monitor data-collection rule log-analytics list'] = """ + type: command + short-summary: List Log Analytics destinations of a data collection rule. + examples: + - name: List Log Analytics destinations of a data collection rule + text: |- + az monitor data-collection rule log-analytics list --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule log-analytics show'] = """ + type: command + short-summary: Show a Log Analytics destination of a data collection rule. + examples: + - name: Show a Log Analytics destination of a data collection rule + text: |- + az monitor data-collection rule log-analytics show --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "centralWorkspace" +""" + +helps['monitor data-collection rule log-analytics add'] = """ + type: command + short-summary: Add Log Analytics destinations of a data collection rule. + examples: + - name: Add Log Analytics destinations of a data collection rule + text: |- + az monitor data-collection rule log-analytics add --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "workspace2" --resource-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ff\ +c2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/workspace2" +""" + +helps['monitor data-collection rule log-analytics delete'] = """ + type: command + short-summary: Delete a Log Analytics destinations of a data collection rule. + examples: + - name: Delete a Log Analytics destinations of a data collection rule + text: |- + az monitor data-collection rule log-analytics delete --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "workspace2" +""" + +helps['monitor data-collection rule log-analytics update'] = """ + type: command + short-summary: Update a Log Analytics destination of a data collection rule. + examples: + - name: Update a Log Analytics destination of a data collection rule + text: |- + az monitor data-collection rule log-analytics update --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "workspace2" --resource-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ff\ +c2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/anotherWorkspace" +""" + +helps['monitor data-collection rule performance-counter'] = """ + type: group + short-summary: Manage Log performance counter data source. +""" + +helps['monitor data-collection rule performance-counter list'] = """ + type: command + short-summary: List Log performance counter data sources. + examples: + - name: List Log performance counter data sources + text: |- + az monitor data-collection rule performance-counter list --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule performance-counter show'] = """ + type: command + short-summary: Show a Log performance counter data source. + examples: + - name: Show a Log performance counter data source + text: |- + az monitor data-collection rule performance-counter show --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "appTeamExtraCounters" +""" + +helps['monitor data-collection rule performance-counter add'] = """ + type: command + short-summary: Add a Log performance counter data source. + examples: + - name: Add a Log performance counter data source + text: |- + az monitor data-collection rule performance-counter add --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "team2ExtraCounters" --streams "Microsoft-Perf" \ +--counter-specifiers "\\\\Process(_Total)\\\\Thread Count" "\\\\LogicalDisk(_Total)\\\\Free Megabytes" \ +--sampling-frequency 30 --transfer-period PT15M +""" + +helps['monitor data-collection rule performance-counter update'] = """ + type: command + short-summary: Update a Log performance counter data source. + examples: + - name: Update a Log performance counter data source + text: |- + az monitor data-collection rule performance-counter update --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "team2ExtraCounters" --transfer-period PT1M +""" + +helps['monitor data-collection rule performance-counter delete'] = """ + type: command + short-summary: Delete a Log performance counter data source. + examples: + - name: Delete a Log performance counter data source + text: |- + az monitor data-collection rule performance-counter delete --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "team2ExtraCounters" +""" + +helps['monitor data-collection rule windows-event-log'] = """ + type: group + short-summary: Manage Windows Event Log data source. +""" + +helps['monitor data-collection rule windows-event-log list'] = """ + type: command + short-summary: List Windows Event Log data sources. + examples: + - name: List Windows Event Log data sources + text: |- + az monitor data-collection rule windows-event-log list --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule windows-event-log show'] = """ + type: command + short-summary: Show a Windows Event Log data source. + examples: + - name: Show a Windows Event Log data source + text: |- + az monitor data-collection rule windows-event-log show --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "appTeam1AppEvents" +""" + +helps['monitor data-collection rule windows-event-log add'] = """ + type: command + short-summary: Add a Windows Event Log data source. + examples: + - name: Add a Windows Event Log data source + text: |- + az monitor data-collection rule windows-event-log add --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "appTeam1AppEvents" --transfer-period "PT1M" \ +--streams "Microsoft-WindowsEvent" --x-path-queries "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" \ +"System![System[(Level = 1 or Level = 2 or Level = 3)]]" +""" + +helps['monitor data-collection rule windows-event-log update'] = """ + type: command + short-summary: Update a Windows Event Log data source. + examples: + - name: Update a Windows Event Log data source + text: |- + az monitor data-collection rule windows-event-log update --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "appTeam1AppEvents" \ +--x-path-queries "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" +""" + +helps['monitor data-collection rule windows-event-log delete'] = """ + type: command + short-summary: Delete a Windows Event Log data source. + examples: + - name: Delete a Windows Event Log data source + text: |- + az monitor data-collection rule windows-event-log delete --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "appTeam1AppEvents" +""" + +helps['monitor data-collection rule syslog'] = """ + type: group + short-summary: Manage Syslog data source. +""" + +helps['monitor data-collection rule syslog list'] = """ + type: command + short-summary: List Syslog data sources. + examples: + - name: List Syslog data sources + text: |- + az monitor data-collection rule syslog list --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" +""" + +helps['monitor data-collection rule syslog show'] = """ + type: command + short-summary: Show a Syslog data source. + examples: + - name: Show a Syslog data source + text: |- + az monitor data-collection rule syslog show --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "syslogBase" +""" + +helps['monitor data-collection rule syslog add'] = """ + type: command + short-summary: Add a Syslog data source. + examples: + - name: Add a Syslog data source + text: |- + az monitor data-collection rule syslog add --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "syslogBase" --facility-names "syslog" --log-levels "Alert" "Critical" \ +--streams "Microsoft-Syslog" +""" + +helps['monitor data-collection rule syslog update'] = """ + type: command + short-summary: Update a Syslog data source. + examples: + - name: Update a Syslog data source + text: |- + az monitor data-collection rule syslog update --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "syslogBase" --facility-names "syslog" --log-levels "Emergency" "Critical" +""" + +helps['monitor data-collection rule syslog delete'] = """ + type: command + short-summary: Delete a Syslog data source. + examples: + - name: Delete a Syslog data source + text: |- + az monitor data-collection rule syslog delete --rule-name "myCollectionRule" \ +--resource-group "myResourceGroup" --name "syslogBase" +""" diff --git a/src/monitor-control-service/azext_amcs/manual/_params.py b/src/monitor-control-service/azext_amcs/manual/_params.py new file mode 100644 index 00000000000..026c6aa1880 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/manual/_params.py @@ -0,0 +1,159 @@ +# 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. +# -------------------------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + resource_group_name_type, + get_location_type, + get_enum_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_amcs.action import ( + AddDataFlows, + AddDestinationsLogAnalytics, + AddDestinationsAzureMonitorMetrics, + AddDataSourcesPerformanceCounters, + AddDataSourcesWindowsEventLogs, + AddDataSourcesSyslog +) + + +from azext_amcs.vendored_sdks.amcs.models import KnownDataFlowStreams, KnownPerfCounterDataSourceStreams, \ + KnownPerfCounterDataSourceScheduledTransferPeriod, KnownWindowsEventLogDataSourceStreams, \ + KnownWindowsEventLogDataSourceScheduledTransferPeriod, KnownSyslogDataSourceStreams, \ + KnownSyslogDataSourceFacilityNames, KnownSyslogDataSourceLogLevels + + +def load_arguments(self, _): + + with self.argument_context('monitor data-collection rule association') as c: + c.argument('resource_uri', options_list=['--resource'], help='The identifier of the resource.') + c.argument('association_name', options_list=['--name', '-n'], help='The name of the association.') + c.argument('description', help='Description of the association.') + c.argument('rule_id', help='The resource ID of the data collection rule that is to be associated.') + c.argument('data_collection_rule_name', options_list=['--rule-name']) + + with self.argument_context('monitor data-collection rule association list') as c: + c.argument('data_collection_rule_name', options_list=['--rule-name'], id_part=None) + + with self.argument_context('monitor data-collection rule') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('data_collection_rule_name', options_list=['--name', '-n'], help='The name of the data ' + 'collection rule. The name is case insensitive.', id_part='name') + c.argument('tags', tags_type) + c.argument('description', help='Description of the data collection rule.') + + c.argument('data_flows', action=AddDataFlows, options_list=['--data-flows'], arg_group="Data Flow", + nargs='+', help='The specification of data flows.') + + c.argument('destinations__log_analytics', options_list=['--log-analytics'], arg_group="Destinations", + action=AddDestinationsLogAnalytics, nargs='+', help='List of Log Analytics destinations.') + c.argument('destinations__azure_monitor_metrics', options_list=['--monitor-metrics'], arg_group="Destinations", + action=AddDestinationsAzureMonitorMetrics, nargs='+', help='Azure Monitor Metrics destination.') + + c.argument('data_sources__performance_counters', options_list=['--performance-counters'], + arg_group="Data Sources", action=AddDataSourcesPerformanceCounters, nargs='+', + help='The list of performance counter data source configurations.') + c.argument('data_sources__windows_event_logs', options_list=['--windows-event-logs'], arg_group="Data Sources", + action=AddDataSourcesWindowsEventLogs, nargs='+', help='The list of Windows Event Log data source ' + 'configurations.') + c.argument('data_sources__syslog', options_list=['--syslog'], arg_group="Data Sources", + action=AddDataSourcesSyslog, nargs='+', help='The list of Syslog data source configurations.') + c.argument('data_sources__extensions', options_list=['--extensions'], arg_group="Data Sources", + type=validate_file_or_dict, help='The list of Azure VM extension data source configurations. ' + 'Expected value: json-string/@json-file.') + + with self.argument_context('monitor data-collection rule list') as c: + c.argument('data_collection_rule_name', id_part=None) + + with self.argument_context('monitor data-collection rule create') as c: + c.argument('data_collection_rule_name', id_part=None) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + + with self.argument_context('monitor data-collection rule data-flow') as c: + c.argument('data_collection_rule_name', options_list=['--rule-name']) + c.argument('streams', options_list=['--streams'], arg_type=get_enum_type(KnownDataFlowStreams), + nargs='+', help='List of streams for this data flow.') + c.argument('destinations', options_list=['--destinations'], nargs='+', + help='List of destinations for this data flow.') + + with self.argument_context('monitor data-collection rule data-flow list') as c: + c.argument('data_collection_rule_name', id_part=None) + + with self.argument_context('monitor data-collection rule log-analytics') as c: + c.argument('data_collection_rule_name', options_list=['--rule-name']) + c.argument('name', options_list=['--name', '-n'], + help='A friendly name for the destination. This name should be unique across all destinations ' + '(regardless of type) within the data collection rule.') + c.argument('workspace_resource_id', options_list=['--resource-id'], + help='The resource ID of the Log Analytics workspace.') + + with self.argument_context('monitor data-collection rule log-analytics list') as c: + c.argument('data_collection_rule_name', id_part=None) + + with self.argument_context('monitor data-collection rule performance-counter') as c: + c.argument('data_collection_rule_name', options_list=['--rule-name']) + c.argument('name', options_list=['--name', '-n'], + help='A friendly name for the data source. This name should be unique across all data sources ' + '(regardless of type) within the data collection rule.') + c.argument('streams', options_list=['--streams'], arg_type=get_enum_type(KnownPerfCounterDataSourceStreams), + nargs='+', help='List of streams that this data source will be sent to. A stream ' + 'indicates what schema will be used for this data and usually what table in Log Analytics the data ' + 'will be sent to.') + c.argument('scheduled_transfer_period', options_list=['--transfer-period'], + arg_type=get_enum_type(KnownPerfCounterDataSourceScheduledTransferPeriod), + help='The interval between data uploads (scheduled transfers), rounded up to the nearest minute.') + c.argument('sampling_frequency_in_seconds', options_list=['--sampling-frequency'], type=int, + help='The number of seconds between consecutive counter measurements (samples).') + c.argument('counter_specifiers', options_list=['--counter-specifiers'], nargs='+', + help="A list of specifier names of the performance counters you want to collect." + "Use a wildcard (*) to collect a counter for all instances. " + "To get a list of performance counters on Windows, run the command 'typeperf'.") + + with self.argument_context('monitor data-collection rule performance-counter list') as c: + c.argument('data_collection_rule_name', id_part=None) + + with self.argument_context('monitor data-collection rule windows-event-log') as c: + c.argument('data_collection_rule_name', options_list=['--rule-name']) + c.argument('name', options_list=['--name', '-n'], + help='A friendly name for the data source. This name should be unique across all data sources ' + '(regardless of type) within the data collection rule.') + c.argument('streams', options_list=['--streams'], arg_type=get_enum_type(KnownWindowsEventLogDataSourceStreams), + nargs='+', help='List of streams that this data source will be sent to. A stream ' + 'indicates what schema will be used for this data and usually what table in Log Analytics the data ' + 'will be sent to.') + c.argument('scheduled_transfer_period', options_list=['--transfer-period'], + arg_type=get_enum_type(KnownWindowsEventLogDataSourceScheduledTransferPeriod), + help='The interval between data uploads (scheduled transfers), rounded up to the nearest minute.') + c.argument('x_path_queries', options_list=['--x-path-queries'], nargs='+', + help='A list of Windows Event Log queries in XPATH format.') + + with self.argument_context('monitor data-collection rule windows-event-log list') as c: + c.argument('data_collection_rule_name', id_part=None) + + with self.argument_context('monitor data-collection rule syslog') as c: + c.argument('data_collection_rule_name', options_list=['--rule-name']) + c.argument('name', options_list=['--name', '-n'], + help='A friendly name for the data source. This name should be unique across all data sources ' + '(regardless of type) within the data collection rule.') + c.argument('streams', options_list=['--streams'], arg_type=get_enum_type(KnownSyslogDataSourceStreams), + nargs='+', help='List of streams that this data source will be sent to. A stream ' + 'indicates what schema will be used for this data and usually what table in Log Analytics the data ' + 'will be sent to.') + c.argument('facility_names', options_list=['--facility-names'], + arg_type=get_enum_type(KnownSyslogDataSourceFacilityNames), nargs='+', + help='The list of facility names.') + c.argument('log_levels', options_list=['--log-levels'], arg_type=get_enum_type(KnownSyslogDataSourceLogLevels), + nargs='+', help='The log levels to collect.') + + with self.argument_context('monitor data-collection rule syslog list') as c: + c.argument('data_collection_rule_name', id_part=None) diff --git a/src/monitor-control-service/azext_amcs/manual/action.py b/src/monitor-control-service/azext_amcs/manual/action.py new file mode 100644 index 00000000000..f4c857ce456 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/manual/action.py @@ -0,0 +1,169 @@ +# 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. +# -------------------------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from collections import defaultdict +from azure.cli.core.azclierror import ValidationError + + +class AddDataFlows(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDataFlows, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise ValidationError('{} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'streams': + d['streams'] = v + elif kl == 'destinations': + d['destinations'] = v + return d + + +class AddDestinationsLogAnalytics(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDestinationsLogAnalytics, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise ValidationError('{} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'resource-id': + d['workspace_resource_id'] = v[0] + elif kl == 'name': + d['name'] = v[0] + return d + + +class AddDestinationsAzureMonitorMetrics(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.destinations_azure_monitor_metrics = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise ValidationError('{} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + return d + + +class AddDataSourcesPerformanceCounters(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDataSourcesPerformanceCounters, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise ValidationError('{} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'streams': + d['streams'] = v + elif kl == 'transfer-period': + d['scheduled_transfer_period'] = v[0] + elif kl == 'sampling-frequency': + try: + d['sampling_frequency_in_seconds'] = int(v[0]) + except ValueError: + raise ValidationError('invalid sampling-frequency={}'.format(v[0])) + elif kl == 'counter-specifiers': + d['counter_specifiers'] = v + elif kl == 'name': + d['name'] = v[0] + return d + + +class AddDataSourcesWindowsEventLogs(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDataSourcesWindowsEventLogs, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise ValidationError('{} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'streams': + d['streams'] = v + elif kl == 'transfer-period': + d['scheduled_transfer_period'] = v[0] + elif kl == 'x-path-queries': + d['x_path_queries'] = v + elif kl == 'name': + d['name'] = v[0] + return d + + +class AddDataSourcesSyslog(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDataSourcesSyslog, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise ValidationError('{} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'streams': + d['streams'] = v + elif kl == 'facility-names': + d['facility_names'] = v + elif kl == 'log-levels': + d['log_levels'] = v + elif kl == 'name': + d['name'] = v[0] + return d diff --git a/src/monitor-control-service/azext_amcs/manual/commands.py b/src/monitor-control-service/azext_amcs/manual/commands.py new file mode 100644 index 00000000000..e838142e079 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/manual/commands.py @@ -0,0 +1,99 @@ +# 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. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + with self.command_group('monitor data-collection', is_experimental=True): + pass + + from azext_amcs.generated._client_factory import cf_data_collection_rule_association + monitor_control_service_data_collection_rule_association = CliCommandType( + operations_tmpl='azext_amcs.vendored_sdks.amcs.operations._data_collection_rule_associations_operations#DataCol' + 'lectionRuleAssociationsOperations.{}', + client_factory=cf_data_collection_rule_association) + with self.command_group('monitor data-collection rule association', + monitor_control_service_data_collection_rule_association, + client_factory=cf_data_collection_rule_association) as g: + g.custom_command('create', 'data_collection_rule_associations_create') + g.custom_command('update', 'data_collection_rule_associations_update') + + from azext_amcs.generated._client_factory import cf_data_collection_rule + monitor_control_service_data_collection_rule = CliCommandType( + operations_tmpl='azext_amcs.vendored_sdks.amcs.operations._data_collection_rules_operations#DataCollectionRules' + 'Operations.{}', + client_factory=cf_data_collection_rule) + with self.command_group('monitor data-collection rule', monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_command( + 'list', 'data_collection_rules_list') + g.custom_command( + 'create', 'data_collection_rules_create') + g.custom_command( + 'update', 'data_collection_rules_update') + + with self.command_group('monitor data-collection rule data-flow', monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_show_command( + 'list', 'data_collection_rules_data_flows_list') + g.custom_command( + 'add', 'data_collection_rules_data_flows_add') + + with self.command_group('monitor data-collection rule log-analytics', monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_show_command( + 'list', 'data_collection_rules_log_analytics_list') + g.custom_show_command( + 'show', 'data_collection_rules_log_analytics_show') + g.custom_command( + 'add', 'data_collection_rules_log_analytics_add') + g.custom_command( + 'delete', 'data_collection_rules_log_analytics_delete') + g.custom_command( + 'update', 'data_collection_rules_log_analytics_update') + + with self.command_group('monitor data-collection rule performance-counter', + monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_show_command( + 'list', 'data_collection_rules_performance_counters_list') + g.custom_show_command( + 'show', 'data_collection_rules_performance_counters_show') + g.custom_command( + 'add', 'data_collection_rules_performance_counters_add') + g.custom_command( + 'delete', 'data_collection_rules_performance_counters_delete') + g.custom_command( + 'update', 'data_collection_rules_performance_counters_update') + + with self.command_group('monitor data-collection rule windows-event-log', + monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_show_command( + 'list', 'data_collection_rules_windows_event_logs_list') + g.custom_show_command( + 'show', 'data_collection_rules_windows_event_logs_show') + g.custom_command( + 'add', 'data_collection_rules_windows_event_logs_add') + g.custom_command( + 'delete', 'data_collection_rules_windows_event_logs_delete') + g.custom_command( + 'update', 'data_collection_rules_windows_event_logs_update') + + with self.command_group('monitor data-collection rule syslog', monitor_control_service_data_collection_rule, + client_factory=cf_data_collection_rule) as g: + g.custom_show_command( + 'list', 'data_collection_rules_syslog_list') + g.custom_show_command( + 'show', 'data_collection_rules_syslog_show') + g.custom_command( + 'add', 'data_collection_rules_syslog_add') + g.custom_command( + 'delete', 'data_collection_rules_syslog_delete') + g.custom_command( + 'update', 'data_collection_rules_syslog_update') diff --git a/src/monitor-control-service/azext_amcs/manual/custom.py b/src/monitor-control-service/azext_amcs/manual/custom.py new file mode 100644 index 00000000000..f77fb0c3935 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/manual/custom.py @@ -0,0 +1,609 @@ +# 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. +# -------------------------------------------------------------------------------------------- + + +def data_collection_rule_associations_create(client, + resource_uri, + association_name, + description=None, + rule_id=None): + body = {} + body['description'] = description + body['data_collection_rule_id'] = rule_id + return client.create(resource_uri=resource_uri, + association_name=association_name, + body=body) + + +def data_collection_rule_associations_update(client, + resource_uri, + association_name, + description=None, + rule_id=None): + from ..custom import monitor_data_collection_rule_association_show + instance = monitor_data_collection_rule_association_show(client, resource_uri, association_name) + body = instance.as_dict(keep_readonly=False) + + if description is not None: + body['description'] = description + if rule_id is not None: + body['data_collection_rule_id'] = rule_id + return client.create(resource_uri=resource_uri, + association_name=association_name, + body=body) + + +def _data_collection_rules_create(client, + resource_group_name, + data_collection_rule_name, + body): + return client.create(resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_create(client, + resource_group_name, + data_collection_rule_name, + location=None, + tags=None, + description=None, + data_flows=None, + destinations__log_analytics=None, + destinations__azure_monitor_metrics=None, + data_sources__performance_counters=None, + data_sources__windows_event_logs=None, + data_sources__syslog=None, + data_sources__extensions=None): + body = {} + body['location'] = location + body['tags'] = tags + body['description'] = description + body['data_flows'] = data_flows + body['destinations'] = {} + body['destinations']['log_analytics'] = destinations__log_analytics + body['destinations']['azure_monitor_metrics'] = destinations__azure_monitor_metrics + body['data_sources'] = {} + body['data_sources']['performance_counters'] = data_sources__performance_counters + body['data_sources']['windows_event_logs'] = data_sources__windows_event_logs + body['data_sources']['syslog'] = data_sources__syslog + body['data_sources']['extensions'] = data_sources__extensions + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_update(client, + resource_group_name, + data_collection_rule_name, + tags=None, + description=None, + data_flows=None, + destinations__log_analytics=None, + destinations__azure_monitor_metrics=None, + data_sources__performance_counters=None, + data_sources__windows_event_logs=None, + data_sources__syslog=None, + data_sources__extensions=None): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if tags is not None: + body['tags'] = tags + if description is not None: + body['description'] = description + if data_flows is not None: + body['data_flows'] = data_flows + if 'destinations' not in body: + body['destinations'] = {} + if destinations__log_analytics is not None: + body['destinations']['log_analytics'] = destinations__log_analytics + if destinations__azure_monitor_metrics is not None: + body['destinations']['azure_monitor_metrics'] = destinations__azure_monitor_metrics + if 'data_sources' not in body: + body['data_sources'] = {} + if data_sources__performance_counters is not None: + body['data_sources']['performance_counters'] = data_sources__performance_counters + if data_sources__windows_event_logs is not None: + body['data_sources']['windows_event_logs'] = data_sources__windows_event_logs + if data_sources__syslog is not None: + body['data_sources']['syslog'] = data_sources__syslog + if data_sources__extensions is not None: + body['data_sources']['extensions'] = data_sources__extensions + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_data_flows_list(client, + resource_group_name, + data_collection_rule_name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + if instance: + return instance.data_flows + return [] + + +def data_collection_rules_data_flows_add(client, + resource_group_name, + data_collection_rule_name, + streams, + destinations): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_flows' not in body: + body['data_flows'] = [] + item = { + 'streams': streams, + 'destinations': destinations, + } + body['data_flows'].append(item) + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_log_analytics_list(client, + resource_group_name, + data_collection_rule_name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + if instance: + return instance.destinations.log_analytics + return [] + + +def data_collection_rules_log_analytics_show(client, + resource_group_name, + data_collection_rule_name, + name): + item_list = data_collection_rules_log_analytics_list( + client, resource_group_name, data_collection_rule_name) + for item in item_list: + if item.name == name: + return item + return {} + + +def data_collection_rules_log_analytics_add(client, + resource_group_name, + data_collection_rule_name, + name, + workspace_resource_id): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'destinations' not in body: + body['destinations'] = {} + if 'log_analytics' not in body['destinations']: + body['destinations']['log_analytics'] = [] + + item_list = body['destinations']['log_analytics'] + for item in item_list: + if item['name'] == name: + from azure.cli.core.azclierror import InvalidArgumentValueError + raise InvalidArgumentValueError("Name {} exists.".format(name)) + item = { + 'name': name, + 'workspace_resource_id': workspace_resource_id + } + item_list.append(item) + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_log_analytics_delete(client, + resource_group_name, + data_collection_rule_name, + name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'destinations' not in body: + body['destinations'] = {} + if 'log_analytics' not in body['destinations']: + body['destinations']['log_analytics'] = [] + + item_list = body['destinations']['log_analytics'] + for idx, item in enumerate(item_list): + if item['name'] == name: + item_list.pop(idx) + break + + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_log_analytics_update(client, + resource_group_name, + data_collection_rule_name, + name, + workspace_resource_id=None): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'destinations' not in body: + body['destinations'] = {} + if 'log_analytics' not in body['destinations']: + body['destinations']['log_analytics'] = [] + + item_list = body['destinations']['log_analytics'] + for item in item_list: + if item['name'] == name: + if workspace_resource_id is not None: + item['workspace_resource_id'] = workspace_resource_id + break + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_list_by_subscription(client): + return client.list_by_subscription() + + +def data_collection_rules_list_by_resource_group(client, resource_group_name): + return client.list_by_resource_group(resource_group_name=resource_group_name) + + +def data_collection_rules_list(client, + resource_group_name=None): + if resource_group_name: + return data_collection_rules_list_by_resource_group( + client=client, + resource_group_name=resource_group_name + ) + return data_collection_rules_list_by_subscription(client) + + +def data_collection_rules_performance_counters_list(client, + resource_group_name, + data_collection_rule_name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + if instance: + return instance.data_sources.performance_counters + return [] + + +def data_collection_rules_performance_counters_show(client, + resource_group_name, + data_collection_rule_name, + name): + item_list = data_collection_rules_performance_counters_list( + client, resource_group_name, data_collection_rule_name) + for item in item_list: + if item.name == name: + return item + return {} + + +def data_collection_rules_performance_counters_add(client, + resource_group_name, + data_collection_rule_name, + name, + streams, + scheduled_transfer_period, + sampling_frequency_in_seconds, + counter_specifiers): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'performance_counters' not in body['data_sources']: + body['data_sources']['performance_counters'] = [] + + item_list = body['data_sources']['performance_counters'] + for item in item_list: + if item['name'] == name: + from azure.cli.core.azclierror import InvalidArgumentValueError + raise InvalidArgumentValueError("Name {} exists.".format(name)) + + item = { + 'name': name, + 'streams': streams, + 'scheduled_transfer_period': scheduled_transfer_period, + 'sampling_frequency_in_seconds': sampling_frequency_in_seconds, + 'counter_specifiers': counter_specifiers + } + + item_list.append(item) + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_performance_counters_delete(client, + resource_group_name, + data_collection_rule_name, + name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'performance_counters' not in body['data_sources']: + body['data_sources']['performance_counters'] = [] + + item_list = body['data_sources']['performance_counters'] + for idx, item in enumerate(item_list): + if item['name'] == name: + item_list.pop(idx) + break + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_performance_counters_update(client, + resource_group_name, + data_collection_rule_name, + name, + streams=None, + scheduled_transfer_period=None, + sampling_frequency_in_seconds=None, + counter_specifiers=None): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'performance_counters' not in body['data_sources']: + body['data_sources']['performance_counters'] = [] + + item_list = body['data_sources']['performance_counters'] + for item in item_list: + if item['name'] == name: + if streams is not None: + item['streams'] = streams + if scheduled_transfer_period is not None: + item['scheduled_transfer_period'] = scheduled_transfer_period + if sampling_frequency_in_seconds is not None: + item['sampling_frequency_in_seconds'] = sampling_frequency_in_seconds + if counter_specifiers is not None: + item['counter_specifiers'] = counter_specifiers + break + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_windows_event_logs_list(client, + resource_group_name, + data_collection_rule_name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + if instance: + return instance.data_sources.windows_event_logs + return [] + + +def data_collection_rules_windows_event_logs_show(client, + resource_group_name, + data_collection_rule_name, + name): + item_list = data_collection_rules_windows_event_logs_list( + client, resource_group_name, data_collection_rule_name) + for item in item_list: + if item.name == name: + return item + return {} + + +def data_collection_rules_windows_event_logs_add(client, + resource_group_name, + data_collection_rule_name, + name, + streams, + scheduled_transfer_period, + x_path_queries): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'windows_event_logs' not in body['data_sources']: + body['data_sources']['windows_event_logs'] = [] + + item_list = body['data_sources']['windows_event_logs'] + for item in item_list: + if item['name'] == name: + from azure.cli.core.azclierror import InvalidArgumentValueError + raise InvalidArgumentValueError("Name {} exists.".format(name)) + + item = { + 'name': name, + 'streams': streams, + 'scheduled_transfer_period': scheduled_transfer_period, + 'x_path_queries': x_path_queries + } + + item_list.append(item) + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_windows_event_logs_delete(client, + resource_group_name, + data_collection_rule_name, + name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'windows_event_logs' not in body['data_sources']: + body['data_sources']['windows_event_logs'] = [] + + item_list = body['data_sources']['windows_event_logs'] + for idx, item in enumerate(item_list): + if item['name'] == name: + item_list.pop(idx) + break + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_windows_event_logs_update(client, + resource_group_name, + data_collection_rule_name, + name, + streams=None, + scheduled_transfer_period=None, + x_path_queries=None): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'windows_event_logs' not in body['data_sources']: + body['data_sources']['windows_event_logs'] = [] + + item_list = body['data_sources']['windows_event_logs'] + for item in item_list: + if item['name'] == name: + if streams is not None: + item['streams'] = streams + if scheduled_transfer_period is not None: + item['scheduled_transfer_period'] = scheduled_transfer_period + if x_path_queries is not None: + item['x_path_queries'] = x_path_queries + break + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_syslog_list(client, + resource_group_name, + data_collection_rule_name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + if instance: + return instance.data_sources.syslog + return [] + + +def data_collection_rules_syslog_show(client, + resource_group_name, + data_collection_rule_name, + name): + item_list = data_collection_rules_syslog_list(client, resource_group_name, + data_collection_rule_name) + for item in item_list: + if item.name == name: + return item + return {} + + +def data_collection_rules_syslog_add(client, + resource_group_name, + data_collection_rule_name, + name, + streams, + facility_names, + log_levels=None): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'syslog' not in body['data_sources']: + body['data_sources']['syslog'] = [] + + item_list = body['data_sources']['syslog'] + for item in item_list: + if item['name'] == name: + from azure.cli.core.azclierror import InvalidArgumentValueError + raise InvalidArgumentValueError("Name {} exists.".format(name)) + + item = { + 'name': name, + 'streams': streams, + 'facility_names': facility_names, + } + if log_levels is not None: + item['log_levels'] = log_levels + + item_list.append(item) + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_syslog_delete(client, + resource_group_name, + data_collection_rule_name, + name): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'syslog' not in body['data_sources']: + body['data_sources']['syslog'] = [] + + item_list = body['data_sources']['syslog'] + for idx, item in enumerate(item_list): + if item['name'] == name: + item_list.pop(idx) + break + + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) + + +def data_collection_rules_syslog_update(client, + resource_group_name, + data_collection_rule_name, + name, + streams=None, + facility_names=None, + log_levels=None): + from ..custom import monitor_data_collection_rule_show + instance = monitor_data_collection_rule_show(client, resource_group_name, data_collection_rule_name) + body = instance.as_dict(keep_readonly=False) + if 'data_sources' not in body: + body['data_sources'] = {} + if 'syslog' not in body['data_sources']: + body['data_sources']['syslog'] = [] + + item_list = body['data_sources']['syslog'] + for item in item_list: + if item['name'] == name: + if streams is not None: + item['streams'] = streams + if facility_names is not None: + item['facility_names'] = facility_names + if log_levels is not None: + item['log_levels'] = log_levels + + return _data_collection_rules_create(client, + resource_group_name=resource_group_name, + data_collection_rule_name=data_collection_rule_name, + body=body) diff --git a/src/monitor-control-service/azext_amcs/tests/__init__.py b/src/monitor-control-service/azext_amcs/tests/__init__.py new file mode 100644 index 00000000000..50e0627daff --- /dev/null +++ b/src/monitor-control-service/azext_amcs/tests/__init__.py @@ -0,0 +1,114 @@ +# 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. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/monitor-control-service/azext_amcs/tests/latest/__init__.py b/src/monitor-control-service/azext_amcs/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/monitor-control-service/azext_amcs/tests/latest/example_steps.py b/src/monitor-control-service/azext_amcs/tests/latest/example_steps.py new file mode 100644 index 00000000000..a4e8f18da03 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/tests/latest/example_steps.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------- +# 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 .. import try_manual + + +# EXAMPLE: /DataCollectionRules/put/Create or update data collection rule + + +# EXAMPLE: /DataCollectionRules/get/Get data collection rule +@try_manual +def step_data_collection_rule_show(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule show ' + '--name "{myDataCollectionRule}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DataCollectionRules/get/List data collection rules by resource group +@try_manual +def step_data_collection_rule_list_by_resource_group(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DataCollectionRules/get/List data collection rules by subscription +@try_manual +def step_data_collection_rule_list_by_subscription(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule list ', + checks=checks) + + +# EXAMPLE: /DataCollectionRules/patch/Update data collection rule +@try_manual +def step_data_collection_rule_update(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule update ' + '--tags tag1="A" tag2="B" tag3="C" ' + '--name "{myDataCollectionRule}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DataCollectionRuleAssociations/put/Create or update association +@try_manual +def step_data_collection_rule_association_create(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule association create ' + '--name "{myAssociation}" ' + '--rule-id "{rule_id}" ' + '--resource "{vm_id}"', + checks=checks) + + +# EXAMPLE: /DataCollectionRuleAssociations/get/Get association +@try_manual +def step_data_collection_rule_association_show(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule association show ' + '--name "{myAssociation}" ' + '--resource "{vm_id}"', + checks=checks) + + +# EXAMPLE: /DataCollectionRuleAssociations/get/List associations for specified data collection rule +@try_manual +def step_data_collection_rule_association_list_by_rule(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule association list ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DataCollectionRuleAssociations/get/List associations for specified resource +@try_manual +def step_data_collection_rule_association_list_by_resource(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule association list ' + '--resource "{vm_id}" ', + checks=checks) + + +# EXAMPLE: /DataCollectionRuleAssociations/delete/Delete association +@try_manual +def step_data_collection_rule_association_delete(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule association delete -y ' + '--name "{myAssociation}" ' + '--resource "{vm_id}" ', + checks=checks) + + +# EXAMPLE: /DataCollectionRules/delete/Delete data collection rule +@try_manual +def step_data_collection_rule_delete(test, _, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule delete -y ' + '--name "{myDataCollectionRule}" ' + '--resource-group "{rg}"', + checks=checks) diff --git a/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_Scenario.yaml b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_Scenario.yaml new file mode 100644 index 00000000000..c19e7684e36 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/tests/latest/recordings/test_monitor_control_service_Scenario.yaml @@ -0,0 +1,4392 @@ +interactions: +- request: + body: '{"location": "eastus", "properties": {"sku": {"name": "CapacityReservation", + "capacityReservationLevel": 100}, "retentionInDays": 30, "workspaceCapping": + {"dailyQuotaGb": 1.0}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '177' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --location --quota --level --sku + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.7.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"0c25a664-0a09-4c35-8c73-b5a83cad7d71\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"capacityreservation\",\r\n \"capacityReservationLevel\": + 100,\r\n \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": + \"Sun, 06 Dec 2020 05:40:10 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Sun, 06 Dec 2020 13:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": + \"Enabled\",\r\n \"createdDate\": \"Sun, 06 Dec 2020 05:40:10 GMT\",\r\n + \ \"modifiedDate\": \"Sun, 06 Dec 2020 05:40:10 GMT\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n + \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"eastus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1227' + content-type: + - application/json + date: + - Sun, 06 Dec 2020 05:40:11 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --location --quota --level --sku + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.7.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"0c25a664-0a09-4c35-8c73-b5a83cad7d71\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"capacityreservation\",\r\n \"capacityReservationLevel\": + 100,\r\n \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": + \"Sun, 06 Dec 2020 05:40:10 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 1.0,\r\n \"quotaNextResetTime\": + \"Sun, 06 Dec 2020 13:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": + \"Enabled\",\r\n \"createdDate\": \"Sun, 06 Dec 2020 05:40:10 GMT\",\r\n + \ \"modifiedDate\": \"Sun, 06 Dec 2020 05:40:11 GMT\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002\",\r\n + \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"eastus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1227' + content-type: + - application/json + date: + - Sun, 06 Dec 2020 05:40:45 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"sku": {"name": "CapacityReservation", + "capacityReservationLevel": 300}, "retentionInDays": 30, "workspaceCapping": + {"dailyQuotaGb": 1.0}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '177' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --location --quota --level --sku + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.7.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.OperationalInsights/workspaces/clitest000003?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"5d339633-eb2e-4d42-a54c-333ff72434b7\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"capacityreservation\",\r\n \"capacityReservationLevel\": + 300,\r\n \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": + \"Sun, 06 Dec 2020 05:40:56 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 07 Dec 2020 03:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": + \"Enabled\",\r\n \"createdDate\": \"Sun, 06 Dec 2020 05:40:56 GMT\",\r\n + \ \"modifiedDate\": \"Sun, 06 Dec 2020 05:40:56 GMT\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003\",\r\n + \ \"name\": \"clitest000003\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"eastus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1227' + content-type: + - application/json + date: + - Sun, 06 Dec 2020 05:40:57 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --location --quota --level --sku + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.7.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.OperationalInsights/workspaces/clitest000003?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"5d339633-eb2e-4d42-a54c-333ff72434b7\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"capacityreservation\",\r\n \"capacityReservationLevel\": + 300,\r\n \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": + \"Sun, 06 Dec 2020 05:40:56 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 1.0,\r\n \"quotaNextResetTime\": + \"Mon, 07 Dec 2020 03:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": + \"Enabled\",\r\n \"createdDate\": \"Sun, 06 Dec 2020 05:40:56 GMT\",\r\n + \ \"modifiedDate\": \"Sun, 06 Dec 2020 05:40:57 GMT\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003\",\r\n + \ \"name\": \"clitest000003\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"eastus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1227' + content-type: + - application/json + date: + - Sun, 06 Dec 2020 05:41:28 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"sku": {"name": "CapacityReservation", + "capacityReservationLevel": 200}, "retentionInDays": 30, "workspaceCapping": + {"dailyQuotaGb": 1.0}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '177' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --location --quota --level --sku + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.7.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.OperationalInsights/workspaces/clitest000004?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"8a7b820a-4350-409f-8839-03c6c7fa582d\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"capacityreservation\",\r\n \"capacityReservationLevel\": + 200,\r\n \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": + \"Sun, 06 Dec 2020 05:41:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 07 Dec 2020 03:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": + \"Enabled\",\r\n \"createdDate\": \"Sun, 06 Dec 2020 05:41:39 GMT\",\r\n + \ \"modifiedDate\": \"Sun, 06 Dec 2020 05:41:39 GMT\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000004\",\r\n + \ \"name\": \"clitest000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"eastus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1227' + content-type: + - application/json + date: + - Sun, 06 Dec 2020 05:41:40 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n --location --quota --level --sku + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.7.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.OperationalInsights/workspaces/clitest000004?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"8a7b820a-4350-409f-8839-03c6c7fa582d\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"capacityreservation\",\r\n \"capacityReservationLevel\": + 200,\r\n \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": + \"Sun, 06 Dec 2020 05:41:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 1.0,\r\n \"quotaNextResetTime\": + \"Mon, 07 Dec 2020 03:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n + \ },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": + \"Enabled\",\r\n \"createdDate\": \"Sun, 06 Dec 2020 05:41:39 GMT\",\r\n + \ \"modifiedDate\": \"Sun, 06 Dec 2020 05:41:40 GMT\"\r\n },\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000004\",\r\n + \ \"name\": \"clitest000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"eastus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1227' + content-type: + - application/json + date: + - Sun, 06 Dec 2020 05:42:11 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001","name":"clitest000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-12-06T05:39:55Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:42:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\": + {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"type\": + \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": + {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n + \ \"sku\": \"7.5\",\n \"version\": \"latest\"\n },\n + \ \"CoreOS\": {\n \"publisher\": \"CoreOS\",\n \"offer\": + \"CoreOS\",\n \"sku\": \"Stable\",\n \"version\": \"latest\"\n + \ },\n \"Debian\": {\n \"publisher\": \"Debian\",\n + \ \"offer\": \"debian-10\",\n \"sku\": \"10\",\n \"version\": + \"latest\"\n },\n \"openSUSE-Leap\": {\n \"publisher\": + \"SUSE\",\n \"offer\": \"openSUSE-Leap\",\n \"sku\": + \"42.3\",\n \"version\": \"latest\"\n },\n \"RHEL\": + {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\",\n + \ \"sku\": \"7-LVM\",\n \"version\": \"latest\"\n },\n + \ \"SLES\": {\n \"publisher\": \"SUSE\",\n \"offer\": + \"SLES\",\n \"sku\": \"15\",\n \"version\": \"latest\"\n + \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\",\n + \ \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\",\n + \ \"version\": \"latest\"\n }\n },\n \"Windows\": + {\n \"Win2019Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n + \ \"offer\": \"WindowsServer\",\n \"sku\": \"2019-Datacenter\",\n + \ \"version\": \"latest\"\n },\n \"Win2016Datacenter\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \"version\": + \"latest\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-R2-Datacenter\",\n \"version\": \"latest\"\n },\n + \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n + \ \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\",\n + \ \"version\": \"latest\"\n },\n \"Win2008R2SP1\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2008-R2-SP1\",\n \"version\": + \"latest\"\n }\n }\n }\n }\n }\n}\n" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '2501' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:42:16 GMT + etag: + - W/"540044b4084c3c314537f1baa1770f248628b2bc9ba0328f1004c33862e049da" + expires: + - Sun, 06 Dec 2020 05:47:16 GMT + source-age: + - '279' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding + via: + - 1.1 varnish (Varnish/6.0), 1.1 varnish + x-cache: + - HIT, HIT + x-cache-hits: + - 3, 1 + x-content-type-options: + - nosniff + x-fastly-request-id: + - a7f44bad3f4be534fc13b497429bc657ceed74fc + x-frame-options: + - deny + x-github-request-id: + - 0C3E:885E:2EF0F3:3740F8:5FCC692E + x-served-by: + - cache-sin18043-SIN + x-timer: + - S1607233337.658557,VS0,VE1 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-network/12.0.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/virtualNetworks?api-version=2018-01-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:42:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"adminPassword": {"type": "securestring", + "metadata": {"description": "Secure adminPassword"}}}, "variables": {}, "resources": + [{"name": "vm1VNET", "type": "Microsoft.Network/virtualNetworks", "location": + "westus", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, "properties": + {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": [{"name": + "vm1Subnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"type": "Microsoft.Network/networkSecurityGroups", + "name": "vm1NSG", "apiVersion": "2015-06-15", "location": "westus", "tags": + {}, "dependsOn": [], "properties": {"securityRules": [{"name": "default-allow-ssh", + "properties": {"protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": + "22", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": + "Allow", "priority": 1000, "direction": "Inbound"}}]}}, {"apiVersion": "2018-01-01", + "type": "Microsoft.Network/publicIPAddresses", "name": "vm1PublicIP", "location": + "westus", "tags": {}, "dependsOn": [], "properties": {"publicIPAllocationMethod": + null}}, {"apiVersion": "2015-06-15", "type": "Microsoft.Network/networkInterfaces", + "name": "vm1VMNic", "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/vm1VNET", + "Microsoft.Network/networkSecurityGroups/vm1NSG", "Microsoft.Network/publicIpAddresses/vm1PublicIP"], + "properties": {"ipConfigurations": [{"name": "ipconfigvm1", "properties": {"privateIPAllocationMethod": + "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/virtualNetworks/vm1VNET/subnets/vm1Subnet"}, + "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP"}}}], + "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG"}}}, + {"apiVersion": "2020-06-01", "type": "Microsoft.Compute/virtualMachines", "name": + "vm1", "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/vm1VMNic"], + "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": + {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic"}]}, + "storageProfile": {"osDisk": {"createOption": "fromImage", "name": null, "caching": + "ReadWrite", "managedDisk": {"storageAccountType": null}}, "imageReference": + {"publisher": "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": + "latest"}}, "osProfile": {"computerName": "vm1", "adminUsername": "testadmin", + "adminPassword": "[parameters(''adminPassword'')]"}}}], "outputs": {}}, "parameters": + {"adminPassword": {"value": "TestPassword11!!"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '3316' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Resources/deployments/vm_deploy_Tu6VEXk8F7OwVxxxi4ghzDX3tNIEVkNZ","name":"vm_deploy_Tu6VEXk8F7OwVxxxi4ghzDX3tNIEVkNZ","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16950604059441059810","parameters":{"adminPassword":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2020-12-06T05:42:23.2441834Z","duration":"PT2.508027S","correlationId":"65ea4c4d-fde6-4032-9080-0bb67207108b","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]},{"resourceType":"networkSecurityGroups","locations":["westus"]},{"resourceType":"publicIPAddresses","locations":["westus"]},{"resourceType":"networkInterfaces","locations":["westus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["westus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/virtualNetworks/vm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/vm_deploy_Tu6VEXk8F7OwVxxxi4ghzDX3tNIEVkNZ/operationStatuses/08585943735447414798?api-version=2020-06-01 + cache-control: + - no-cache + content-length: + - '2781' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:42:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585943735447414798?api-version=2020-06-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:42:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585943735447414798?api-version=2020-06-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:43:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585943735447414798?api-version=2020-06-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:43:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585943735447414798?api-version=2020-06-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:44:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585943735447414798?api-version=2020-06-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:44:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585943735447414798?api-version=2020-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.15.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Resources/deployments/vm_deploy_Tu6VEXk8F7OwVxxxi4ghzDX3tNIEVkNZ","name":"vm_deploy_Tu6VEXk8F7OwVxxxi4ghzDX3tNIEVkNZ","type":"Microsoft.Resources/deployments","properties":{"templateHash":"16950604059441059810","parameters":{"adminPassword":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2020-12-06T05:45:02.9922837Z","duration":"PT2M42.2561273S","correlationId":"65ea4c4d-fde6-4032-9080-0bb67207108b","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]},{"resourceType":"networkSecurityGroups","locations":["westus"]},{"resourceType":"publicIPAddresses","locations":["westus"]},{"resourceType":"networkInterfaces","locations":["westus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["westus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/virtualNetworks/vm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/virtualNetworks/vm1VNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3849' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-compute/14.0.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1?$expand=instanceView&api-version=2020-06-01 + response: + body: + string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"be397c73-e2a7-498a-a630-c5010ba8f607\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": + \"18.04-LTS\",\r\n \"version\": \"latest\",\r\n \"exactVersion\": + \"18.04.202012010\"\r\n },\r\n \"osDisk\": {\r\n \"osType\": + \"Linux\",\r\n \"name\": \"vm1_disk1_1fa977164e6a4e059e2ab8a45006eefc\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/disks/vm1_disk1_1fa977164e6a4e059e2ab8a45006eefc\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm1\",\r\n + \ \"adminUsername\": \"testadmin\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\"\r\n + \ }\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": + \"vm1\",\r\n \"osName\": \"ubuntu\",\r\n \"osVersion\": \"18.04\",\r\n + \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.2.52\",\r\n \"statuses\": + [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n + \ \"message\": \"Guest Agent is running\",\r\n \"time\": + \"2020-12-06T05:45:29+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"vm1_disk1_1fa977164e6a4e059e2ab8a45006eefc\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2020-12-06T05:44:43.5059188+00:00\"\r\n + \ }\r\n ]\r\n }\r\n ],\r\n \"hyperVGeneration\": + \"V1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded/osProvisioningInProgress\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"OS provisioning + in progress\",\r\n \"time\": \"2020-12-06T05:45:00.2254429+00:00\"\r\n + \ },\r\n {\r\n \"code\": \"PowerState/running\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n + \ }\r\n ]\r\n }\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3281' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31989 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-network/12.0.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\",\r\n + \ \"etag\": \"W/\\\"0774c17b-3f4c-43e5-ab2c-3664ce052dcc\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"0b627daf-60e6-4868-8b62-cd5c7d3a7c3a\",\r\n + \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigvm1\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic/ipConfigurations/ipconfigvm1\",\r\n + \ \"etag\": \"W/\\\"0774c17b-3f4c-43e5-ab2c-3664ce052dcc\\\"\",\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": + \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/virtualNetworks/vm1VNET/subnets/vm1Subnet\"\r\n + \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": + \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": + [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": + \"e4np3l5juenu1gof3ek3e0ix0h.dx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-04-19-64\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2568' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:31 GMT + etag: + - W/"0774c17b-3f4c-43e5-ab2c-3664ce052dcc" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 2ee5ed48-9f70-4817-bc2e-8bbcef0cb10b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-password --admin-username --authentication-type + User-Agent: + - python/3.8.5 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-network/12.0.0 Azure-SDK-For-Python AZURECLI/2.15.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP\",\r\n + \ \"etag\": \"W/\\\"32a05f9f-eca1-4666-baed-c58e0c9f0650\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"e276be60-1607-4694-bcbf-f95af2d122c5\",\r\n + \ \"ipAddress\": \"104.42.60.97\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n + \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": + 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic/ipConfigurations/ipconfigvm1\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Basic\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '996' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:32 GMT + etag: + - W/"32a05f9f-eca1-4666-baed-c58e0c9f0650" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - eec5c5e2-4a20-4038-90b0-eea1e2b2af52 + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"dataSources": {"performanceCounters": + [{"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": + 15, "counterSpecifiers": ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed + Bytes", "\\LogicalDisk(_Total)\\Free Megabytes", "\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"], "name": "cloudTeamCoreCounters"}, {"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": 30, "counterSpecifiers": + ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], "windowsEventLogs": + [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT1M", + "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule create + Connection: + - keep-alive + Content-Length: + - '1594' + Content-Type: + - application/json + ParameterSetName: + - -g -n --location --data-flow --log-analytics --performance-counter --performance-counter + --syslog --windows-event-log --windows-event-log + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000f800-0000-0100-0000-5fcc70050000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2003' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:42 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000f800-0000-0100-0000-5fcc70050000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2003' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:45 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000f800-0000-0100-0000-5fcc70050000\""}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2031' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:48 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/dataCollectionRules?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"properties":{"immutableId":"dcr-c3ea0fc412a941d6b02c733cf533e158","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"},{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitestn6u6lguqr4ny3ykff7fdoyjhiokfg7klxijg7dt5vqpmo7e67uply5hhhpimiyupqrkd/providers/microsoft.operationalinsights/workspaces/clitestepv754tpxcsgp","workspaceId":"54bfce71-0209-443c-a259-3228791c9279","name":"clitestepv754tpxcsgp"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitestepv754tpxcsgp"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestn6u6lguqr4ny3ykff7fdoyjhiokfg7klxijg7dt5vqpmo7e67uply5hhhpimiyupqrkd/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00002f00-0000-0100-0000-5fcb9c920000\""},{"properties":{"immutableId":"dcr-f32a6cd3a4554c37a11a82faf86fe5b6","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"},{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitesteqdzs5d5mmwscgzjdnbcaive4nejxahwlqklg6pmsitconentqj2q23qaiihmliocnzi/providers/microsoft.operationalinsights/workspaces/clitestlnqqp426mxgls","workspaceId":"74a72d18-9279-41a6-97a4-9891d7961b13","name":"clitestlnqqp426mxgls"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitestlnqqp426mxgls"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitesteqdzs5d5mmwscgzjdnbcaive4nejxahwlqklg6pmsitconentqj2q23qaiihmliocnzi/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00003600-0000-0100-0000-5fcba20d0000\""},{"properties":{"immutableId":"dcr-d8f6b47e2f444d6d839e2ebfebf35cd2","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"},{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitestzdaptknrlicbtkmeula53vzxjis57e2t4f7d2puirsnoyew3p4ef2w2wfilpspjzwpl2/providers/microsoft.operationalinsights/workspaces/clitestnky3m23jgxffk","workspaceId":"a2c0bcdb-fa70-42aa-a443-57906fe02077","name":"clitestnky3m23jgxffk"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitestnky3m23jgxffk"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestzdaptknrlicbtkmeula53vzxjis57e2t4f7d2puirsnoyew3p4ef2w2wfilpspjzwpl2/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00003800-0000-0100-0000-5fcba2b40000\""},{"properties":{"immutableId":"dcr-a357d7a3c36e483bacbd6f7c7b903d58","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitestgkjbok3pliq3jpl2hpr2gbgsyaj26fupdxroflfjxvfyrupptkysbv6anjo2u7xfurju/providers/microsoft.operationalinsights/workspaces/clitest4gyxkatmg7k44","workspaceId":"d5756adf-7d78-4d5b-8dd9-924c5fb7afc1","name":"clitest4gyxkatmg7k44"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest4gyxkatmg7k44"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestgkjbok3pliq3jpl2hpr2gbgsyaj26fupdxroflfjxvfyrupptkysbv6anjo2u7xfurju/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00004700-0000-0100-0000-5fcba75d0000\""},{"properties":{"immutableId":"dcr-0a1394a604b14185ad4d234ecdedae29","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitestz2oh4a26nxn2jiiwsqrd3avbvgtndowsdkecglxmovgjxjjgwy6qtcgm7tuarknghcq6/providers/microsoft.operationalinsights/workspaces/clitestj6s5tcifnkpe4","workspaceId":"8110f9f8-ec15-48de-b85f-ba7b31c813d0","name":"clitestj6s5tcifnkpe4"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitestj6s5tcifnkpe4"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestz2oh4a26nxn2jiiwsqrd3avbvgtndowsdkecglxmovgjxjjgwy6qtcgm7tuarknghcq6/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00008f00-0000-0100-0000-5fcc22dc0000\""},{"properties":{"immutableId":"dcr-a0b1f393fd5a44a3b1c644675695b0e3","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitestmzve6bgeczsnw4a3uzk76dmu7lujmnym3suxgin2ixoynxp5p7r2su4bvvhuek5mdwfa/providers/microsoft.operationalinsights/workspaces/clitestvf6vpw5nxxe62","workspaceId":"cba93a11-2599-425f-9e17-b28e488f10e3","name":"clitestvf6vpw5nxxe62"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitestvf6vpw5nxxe62"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestmzve6bgeczsnw4a3uzk76dmu7lujmnym3suxgin2ixoynxp5p7r2su4bvvhuek5mdwfa/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00009300-0000-0100-0000-5fcc386d0000\""},{"properties":{"immutableId":"dcr-4a4d3cd9f2d9463b89ad4f19ba9f2083","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest6k7extwssuklw75jlmbxq5tuqk233kyeee6wamit3h3pf2mdb3vuvebwrt4egeo7zq4b/providers/microsoft.operationalinsights/workspaces/clitestbvjua2i2djjhm","workspaceId":"7cfffaf6-8448-488d-a188-9f2c12fdf062","name":"clitestbvjua2i2djjhm"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitestbvjua2i2djjhm"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest6k7extwssuklw75jlmbxq5tuqk233kyeee6wamit3h3pf2mdb3vuvebwrt4egeo7zq4b/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000b500-0000-0100-0000-5fcc3fb60000\""},{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000f800-0000-0100-0000-5fcc70050000\""}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '16609' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:50 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule update + Connection: + - keep-alive + ParameterSetName: + - --tags --name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000f800-0000-0100-0000-5fcc70050000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2003' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:51 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule update + Connection: + - keep-alive + Content-Length: + - '1643' + Content-Type: + - application/json + ParameterSetName: + - --tags --name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fa00-0000-0100-0000-5fcc70100000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '58' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics add + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --resource-id + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fa00-0000-0100-0000-5fcc70100000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:57 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}, {"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003", + "name": "clitest000003"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics add + Connection: + - keep-alive + Content-Length: + - '1918' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --resource-id + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fb00-0000-0100-0000-5fcc70160000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:45:58 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics list + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fb00-0000-0100-0000-5fcc70160000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:01 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics show + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fb00-0000-0100-0000-5fcc70160000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:03 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics update + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --resource-id + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fb00-0000-0100-0000-5fcc70160000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:04 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}, {"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000004", + "name": "clitest000003"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics update + Connection: + - keep-alive + Content-Length: + - '1918' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --resource-id + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000004","workspaceId":"8a7b820a-4350-409f-8839-03c6c7fa582d","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fc00-0000-0100-0000-5fcc701d0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:05 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '58' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics delete + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000004","workspaceId":"8a7b820a-4350-409f-8839-03c6c7fa582d","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fc00-0000-0100-0000-5fcc701d0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:08 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics delete + Connection: + - keep-alive + Content-Length: + - '1643' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fd00-0000-0100-0000-5fcc70210000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:08 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter add + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --counter-specifiers --sampling-frequency + --transfer-period --streams + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fd00-0000-0100-0000-5fcc70210000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:11 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": + 15, "counterSpecifiers": ["\\Memory\\Committed Bytes", "\\Processor(_Total)\\% + Processor Time"], "name": "extraCounters"}], "windowsEventLogs": [{"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT1M", "xPathQueries": + ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": ["Microsoft-WindowsEvent"], + "scheduledTransferPeriod": "PT5M", "xPathQueries": ["System![System[(Level = + 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level = 1 or Level = + 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": [{"streams": ["Microsoft-Syslog"], + "facilityNames": ["syslog"], "logLevels": ["Alert", "Critical", "Emergency"], + "name": "syslogBase"}]}, "destinations": {"logAnalytics": [{"workspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter add + Connection: + - keep-alive + Content-Length: + - '1863' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --counter-specifiers --sampling-frequency + --transfer-period --streams + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Memory\\Committed + Bytes","\\Processor(_Total)\\% Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fe00-0000-0100-0000-5fcc70240000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2254' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:12 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter list + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Memory\\Committed + Bytes","\\Processor(_Total)\\% Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fe00-0000-0100-0000-5fcc70240000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2254' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:14 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter show + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Memory\\Committed + Bytes","\\Processor(_Total)\\% Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fe00-0000-0100-0000-5fcc70240000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2254' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:16 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter update + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --counter-specifiers + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Memory\\Committed + Bytes","\\Processor(_Total)\\% Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000fe00-0000-0100-0000-5fcc70240000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2254' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:17 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": + 15, "counterSpecifiers": ["\\Processor(_Total)\\% Processor Time"], "name": + "extraCounters"}], "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], + "scheduledTransferPeriod": "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, + {"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter update + Connection: + - keep-alive + Content-Length: + - '1834' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --counter-specifiers + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000ff00-0000-0100-0000-5fcc702a0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2226' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:18 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '57' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter delete + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time"],"name":"extraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"0000ff00-0000-0100-0000-5fcc702a0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2226' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:19 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule performance-counter delete + Connection: + - keep-alive + Content-Length: + - '1643' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000001-0000-0100-0000-5fcc702c0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:20 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log add + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --transfer-period --streams --x-path-queries + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000001-0000-0100-0000-5fcc702c0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:23 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT1M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "extraEvents"}], "syslog": [{"streams": + ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": ["Alert", "Critical", + "Emergency"], "name": "syslogBase"}]}, "destinations": {"logAnalytics": [{"workspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log add + Connection: + - keep-alive + Content-Length: + - '1882' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --transfer-period --streams --x-path-queries + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"extraEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000101-0000-0100-0000-5fcc70300000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2275' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:24 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log list + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"extraEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000101-0000-0100-0000-5fcc70300000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2275' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:25 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log show + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"extraEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000101-0000-0100-0000-5fcc70300000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2275' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:26 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log update + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --x-path-queries + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"extraEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000101-0000-0100-0000-5fcc70300000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2275' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:29 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT1M", "xPathQueries": + ["Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]"], "name": "extraEvents"}], + "syslog": [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log update + Connection: + - keep-alive + Content-Length: + - '1824' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --x-path-queries + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"],"name":"extraEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000201-0000-0100-0000-5fcc70360000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2218' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:30 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log delete + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"],"name":"extraEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000201-0000-0100-0000-5fcc70360000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2218' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:30 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule windows-event-log delete + Connection: + - keep-alive + Content-Length: + - '1643' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000301-0000-0100-0000-5fcc70380000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:31 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '56' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog add + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --facility-names --log-levels --streams + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000301-0000-0100-0000-5fcc70380000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:33 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}, {"streams": ["Microsoft-Syslog"], + "facilityNames": ["cron"], "logLevels": ["Debug", "Critical", "Emergency"], + "name": "cronSyslog"}]}, "destinations": {"logAnalytics": [{"workspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog add + Connection: + - keep-alive + Content-Length: + - '1776' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --facility-names --log-levels --streams + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"},{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000401-0000-0100-0000-5fcc703a0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2168' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:34 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog list + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"},{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000401-0000-0100-0000-5fcc703a0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2168' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:35 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog show + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"},{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000401-0000-0100-0000-5fcc703a0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2168' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:37 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog update + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --log-levels + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"},{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Debug","Critical","Emergency"],"name":"cronSyslog"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000401-0000-0100-0000-5fcc703a0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2168' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:40 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}, {"streams": ["Microsoft-Syslog"], + "facilityNames": ["cron"], "logLevels": ["Critical", "Emergency"], "name": "cronSyslog"}]}, + "destinations": {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog update + Connection: + - keep-alive + Content-Length: + - '1767' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --log-levels + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"},{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Critical","Emergency"],"name":"cronSyslog"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000501-0000-0100-0000-5fcc70410000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2160' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:41 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog delete + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"},{"streams":["Microsoft-Syslog"],"facilityNames":["cron"],"logLevels":["Critical","Emergency"],"name":"cronSyslog"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000501-0000-0100-0000-5fcc70410000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2160' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:42 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule syslog delete + Connection: + - keep-alive + Content-Length: + - '1643' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000601-0000-0100-0000-5fcc70430000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:43 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '58' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics add + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --name --resource-id + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000601-0000-0100-0000-5fcc70430000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2045' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:45 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}, {"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003", + "name": "clitest000003"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule log-analytics add + Connection: + - keep-alive + Content-Length: + - '1918' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --name --resource-id + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000701-0000-0100-0000-5fcc70460000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:46 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '57' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule data-flow add + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group --destinations --streams + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000701-0000-0100-0000-5fcc70460000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2369' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:46 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"tag1": "A", "tag2": "B", "tag3": "C"}, + "properties": {"dataSources": {"performanceCounters": [{"streams": ["Microsoft-Perf"], + "scheduledTransferPeriod": "PT1M", "samplingFrequencyInSeconds": 15, "counterSpecifiers": + ["\\Processor(_Total)\\% Processor Time", "\\Memory\\Committed Bytes", "\\LogicalDisk(_Total)\\Free + Megabytes", "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length"], "name": "cloudTeamCoreCounters"}, + {"streams": ["Microsoft-Perf"], "scheduledTransferPeriod": "PT5M", "samplingFrequencyInSeconds": + 30, "counterSpecifiers": ["\\Process(_Total)\\Thread Count"], "name": "appTeamExtraCounters"}], + "windowsEventLogs": [{"streams": ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": + "PT1M", "xPathQueries": ["Security!"], "name": "cloudSecurityTeamEvents"}, {"streams": + ["Microsoft-WindowsEvent"], "scheduledTransferPeriod": "PT5M", "xPathQueries": + ["System![System[(Level = 1 or Level = 2 or Level = 3)]]", "Application!*[System[(Level + = 1 or Level = 2 or Level = 3)]]"], "name": "appTeam1AppEvents"}], "syslog": + [{"streams": ["Microsoft-Syslog"], "facilityNames": ["syslog"], "logLevels": + ["Alert", "Critical", "Emergency"], "name": "syslogBase"}]}, "destinations": + {"logAnalytics": [{"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002", + "name": "clitest000002"}, {"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003", + "name": "clitest000003"}]}, "dataFlows": [{"streams": ["Microsoft-Perf", "Microsoft-Syslog", + "Microsoft-WindowsEvent"], "destinations": ["clitest000002"]}, {"streams": ["Microsoft-Perf"], + "destinations": ["clitest000003"]}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule data-flow add + Connection: + - keep-alive + Content-Length: + - '1993' + Content-Type: + - application/json + ParameterSetName: + - --rule-name --resource-group --destinations --streams + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]},{"streams":["Microsoft-Perf"],"destinations":["clitest000003"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000801-0000-0100-0000-5fcc70480000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2440' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:48 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule data-flow list + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"immutableId":"dcr-7f8a544c421740ed918aa2c25e621c18","dataSources":{"performanceCounters":[{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT1M","samplingFrequencyInSeconds":15,"counterSpecifiers":["\\Processor(_Total)\\% + Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. + Disk Queue Length"],"name":"cloudTeamCoreCounters"},{"streams":["Microsoft-Perf"],"scheduledTransferPeriod":"PT5M","samplingFrequencyInSeconds":30,"counterSpecifiers":["\\Process(_Total)\\Thread + Count"],"name":"appTeamExtraCounters"}],"windowsEventLogs":[{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT1M","xPathQueries":["Security!"],"name":"cloudSecurityTeamEvents"},{"streams":["Microsoft-WindowsEvent"],"scheduledTransferPeriod":"PT5M","xPathQueries":["System![System[(Level + = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level + = 2 or Level = 3)]]"],"name":"appTeam1AppEvents"}],"syslog":[{"streams":["Microsoft-Syslog"],"facilityNames":["syslog"],"logLevels":["Alert","Critical","Emergency"],"name":"syslogBase"}]},"destinations":{"logAnalytics":[{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000002","workspaceId":"0c25a664-0a09-4c35-8c73-b5a83cad7d71","name":"clitest000002"},{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.operationalinsights/workspaces/clitest000003","workspaceId":"5d339633-eb2e-4d42-a54c-333ff72434b7","name":"clitest000003"}]},"dataFlows":[{"streams":["Microsoft-Perf","Microsoft-Syslog","Microsoft-WindowsEvent"],"destinations":["clitest000002"]},{"streams":["Microsoft-Perf"],"destinations":["clitest000003"]}],"provisioningState":"Succeeded"},"location":"eastus","tags":{"tag1":"A","tag2":"B","tag3":"C"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule","name":"myCollectionRule","type":"Microsoft.Insights/dataCollectionRules","etag":"\"00000801-0000-0100-0000-5fcc70480000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '2440' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:50 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"dataCollectionRuleId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association create + Connection: + - keep-alive + Content-Length: + - '252' + Content-Type: + - application/json + ParameterSetName: + - --name --rule-id --resource + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"dataCollectionRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation","name":"myAssociation","type":"Microsoft.Insights/dataCollectionRuleAssociations","etag":"\"0800fc04-0000-0700-0000-5fcc704c0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '654' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:52 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association show + Connection: + - keep-alive + ParameterSetName: + - --name --resource + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"dataCollectionRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation","name":"myAssociation","type":"Microsoft.Insights/dataCollectionRuleAssociations","etag":"\"0800fc04-0000-0700-0000-5fcc704c0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '654' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association list + Connection: + - keep-alive + ParameterSetName: + - --rule-name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule/associations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"properties":{"dataCollectionRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.insights/datacollectionrules/mycollectionrule"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/microsoft.compute/virtualmachines/vm1/providers/microsoft.insights/datacollectionruleassociations/myassociation","name":"myassociation","type":"Microsoft.Insights/dataCollectionRuleAssociations"}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '632' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:57 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association list + Connection: + - keep-alive + ParameterSetName: + - --resource + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"properties":{"dataCollectionRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation","name":"myAssociation","type":"Microsoft.Insights/dataCollectionRuleAssociations","etag":"\"0800fc04-0000-0700-0000-5fcc704c0000\""}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '682' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:46:58 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association update + Connection: + - keep-alive + ParameterSetName: + - --name --resource --description + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"dataCollectionRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation","name":"myAssociation","type":"Microsoft.Insights/dataCollectionRuleAssociations","etag":"\"0800fc04-0000-0700-0000-5fcc704c0000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '654' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:47:00 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "this is description", "dataCollectionRuleId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association update + Connection: + - keep-alive + Content-Length: + - '290' + Content-Type: + - application/json + ParameterSetName: + - --name --resource --description + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation?api-version=2019-11-01-preview + response: + body: + string: '{"properties":{"description":"this is description","dataCollectionRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation","name":"myAssociation","type":"Microsoft.Insights/dataCollectionRuleAssociations","etag":"\"08000405-0000-0700-0000-5fcc70560000\""}' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '690' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 06 Dec 2020 05:47:01 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '59' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule association delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation?api-version=2019-11-01-preview + response: + body: + string: '' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 06 Dec 2020 05:47:05 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor data-collection rule delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.15.1 azsdk-python-monitorclient/unknown Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule?api-version=2019-11-01-preview + response: + body: + string: '' + headers: + api-supported-versions: + - 2019-11-01-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 06 Dec 2020 05:47:11 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:2bbfbac8-e1b0-44af-b9c6-3a40669d37e3 + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/monitor-control-service/azext_amcs/tests/latest/test_monitor_control_service_scenario.py b/src/monitor-control-service/azext_amcs/tests/latest/test_monitor_control_service_scenario.py new file mode 100644 index 00000000000..fbc3d97ab1c --- /dev/null +++ b/src/monitor-control-service/azext_amcs/tests/latest/test_monitor_control_service_scenario.py @@ -0,0 +1,504 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_data_collection_rule_show +from .example_steps import step_data_collection_rule_list_by_resource_group +from .example_steps import step_data_collection_rule_list_by_subscription +from .example_steps import step_data_collection_rule_association_create +from .example_steps import step_data_collection_rule_association_show +from .example_steps import step_data_collection_rule_association_list_by_rule +from .example_steps import step_data_collection_rule_association_list_by_resource +from .example_steps import step_data_collection_rule_association_delete +from .example_steps import step_data_collection_rule_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def step_data_collection_rule_create(test, rg, checks=None): + if checks is None: + checks = [] + rule_json = test.cmd('az monitor data-collection rule create ' + '-g {rg} -n {myDataCollectionRule} --location "{location}" ' + '--data-flows destinations="{workspace_name}" streams="Microsoft-Perf" ' + 'streams="Microsoft-Syslog" streams="Microsoft-WindowsEvent" ' + '--log-analytics name="{workspace_name}" resource-id="{workspace_id}" ' + '--performance-counters name="cloudTeamCoreCounters" counter-specifiers="\\\\Processor(_Total' + ')\\\\% Processor Time" counter-specifiers="\\\\Memory\\\\Committed Bytes" ' + 'counter-specifiers="\\\\LogicalDisk(_Total)\\\\Free Megabytes" ' + 'counter-specifiers="\\\\PhysicalDisk(_Total)\\\\Avg. Disk Queue Length" ' + 'sampling-frequency=15 transfer-period="PT1M" streams="Microsoft-Perf" ' + '--performance-counters name="appTeamExtraCounters" ' + 'counter-specifiers="\\\\Process(_Total)\\\\Thread Count" sampling-frequency=30 ' + 'transfer-period="PT5M" streams="Microsoft-Perf" ' + '--syslog name="syslogBase" facility-names="syslog" log-levels="Alert" log-levels="Critical" ' + 'log-levels="Emergency" streams="Microsoft-Syslog" ' + '--windows-event-logs name="cloudSecurityTeamEvents" transfer-period="PT1M" ' + 'streams="Microsoft-WindowsEvent" x-path-queries="Security!" ' + '--windows-event-logs name="appTeam1AppEvents" transfer-period="PT5M" ' + 'streams="Microsoft-WindowsEvent" ' + 'x-path-queries="System![System[(Level = 1 or Level = 2 or Level = 3)]]" ' + 'x-path-queries="Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" ', + checks=checks).get_output_in_json() + test.kwargs['rule_id'] = rule_json['id'] + + +@try_manual +def step_data_collection_rule_update_tags(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([ + test.check("tags.tag1", "A", case_sensitive=False), + test.check("tags.tag2", "B", case_sensitive=False), + test.check("tags.tag3", "C", case_sensitive=False), + ]) + test.cmd('az monitor data-collection rule update ' + '--tags tag1="A" tag2="B" tag3="C" ' + '--name "{myDataCollectionRule}" ' + '--resource-group "{rg}"', + checks=checks) + + +@try_manual +def step_data_collection_rule_log_analytics_add(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule log-analytics add ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name {workspace2_name} ' + '--resource-id "{workspace2_id}"', + checks=checks) + + +@try_manual +def step_data_collection_rule_log_analytics_list(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule log-analytics list ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_log_analytics_show(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule log-analytics show ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name {workspace2_name} ', + checks=checks) + + +@try_manual +def step_data_collection_rule_log_analytics_update(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule log-analytics update ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name {workspace2_name} ' + '--resource-id "{workspace3_id}"', + checks=checks) + + +@try_manual +def step_data_collection_rule_log_analytics_delete(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule log-analytics delete ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name {workspace2_name} ', + checks=checks) + + +@try_manual +def step_data_collection_rule_data_flow_list(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule data-flow list ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_data_flow_add(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule data-flow add ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" --destinations {workspace2_name} --streams "Microsoft-Perf"', + checks=checks) + + +@try_manual +def step_data_collection_rule_performance_counter_add(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule performance-counter add ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraCounters ' + '--counter-specifiers "\\\\Memory\\\\Committed Bytes" "\\\\Processor(_Total)\\\\% Processor Time" ' + '--sampling-frequency 15 ' + '--transfer-period "PT1M" ' + '--streams "Microsoft-Perf"', + checks=checks) + + +@try_manual +def step_data_collection_rule_performance_counter_list(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule performance-counter list ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_performance_counter_show(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule performance-counter show ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraCounters ', + checks=checks) + + +@try_manual +def step_data_collection_rule_performance_counter_update(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule performance-counter update ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraCounters ' + '--counter-specifiers "\\\\Processor(_Total)\\\\% Processor Time"', + checks=checks) + + +@try_manual +def step_data_collection_rule_performance_counter_delete(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule performance-counter delete ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraCounters ', + checks=checks) + + +@try_manual +def step_data_collection_rule_windows_event_log_add(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule windows-event-log add ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraEvents ' + '--transfer-period "PT1M" ' + '--streams "Microsoft-WindowsEvent" ' + '--x-path-queries "System![System[(Level = 1 or Level = 2 or Level = 3)]]" ' + '"Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]"', + checks=checks) + + +@try_manual +def step_data_collection_rule_windows_event_log_list(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule windows-event-log list ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_windows_event_log_show(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule windows-event-log show ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraEvents ', + checks=checks) + + +@try_manual +def step_data_collection_rule_windows_event_log_update(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule windows-event-log update ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraEvents ' + '--x-path-queries "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_windows_event_log_delete(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule windows-event-log delete ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name extraEvents ', + checks=checks) + + +@try_manual +def step_data_collection_rule_syslog_add(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule syslog add ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name "cronSyslog" ' + '--facility-names "cron" ' + '--log-levels "Debug" "Critical" "Emergency" ' + '--streams "Microsoft-Syslog" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_syslog_list(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule syslog list ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_syslog_show(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule syslog show ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name cronSyslog ', + checks=checks) + + +@try_manual +def step_data_collection_rule_syslog_update(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule syslog update ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name cronSyslog ' + '--log-levels "Critical" "Emergency" ', + checks=checks) + + +@try_manual +def step_data_collection_rule_syslog_delete(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([]) + test.cmd('az monitor data-collection rule syslog delete ' + '--rule-name "{myDataCollectionRule}" ' + '--resource-group "{rg}" ' + '--name cronSyslog ', + checks=checks) + + +@try_manual +def step_data_collection_rule_association_update(test, rg, checks=None): + if checks is None: + checks = [] + checks.extend([ + test.check("description", "{description}", case_sensitive=False), + ]) + test.cmd('az monitor data-collection rule association update ' + '--name "{myAssociation}" ' + '--resource "{vm_id}" ' + '--description "{description}" ', + checks=checks) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + test.kwargs.update({ + 'rg': rg, + 'workspace_name': test.create_random_name('clitest', 20), + 'workspace2_name': test.create_random_name('clitest', 20), + 'workspace3_name': test.create_random_name('clitest', 20), + 'location': "eastus", + 'vm': "vm1", + 'description': "this is description", + }) + + workspace_json = test.cmd( + "monitor log-analytics workspace create -g {rg} -n {workspace_name} --location {location} --quota 1 " + "--level 100 --sku CapacityReservation").get_output_in_json() + test.kwargs['workspace_id'] = workspace_json['id'] + + workspace2_json = test.cmd( + "monitor log-analytics workspace create -g {rg} -n {workspace2_name} --location {location} --quota 1 " + "--level 300 --sku CapacityReservation").get_output_in_json() + test.kwargs['workspace2_id'] = workspace2_json['id'] + + workspace3_json = test.cmd( + "monitor log-analytics workspace create -g {rg} -n {workspace3_name} --location {location} --quota 1 " + "--level 200 --sku CapacityReservation").get_output_in_json() + test.kwargs['workspace3_id'] = workspace3_json['id'] + + vm_json = test.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --admin-password TestPassword11!! ' + '--admin-username testadmin --authentication-type password').get_output_in_json() + test.kwargs['vm_id'] = vm_json['id'] + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_data_collection_rule_create(test, rg, checks=[ + test.check("location", "{location}", case_sensitive=False), + test.check("name", "{myDataCollectionRule}", case_sensitive=False), + ]) + step_data_collection_rule_show(test, rg, checks=[ + test.check("location", "{location}", case_sensitive=False), + test.check("name", "{myDataCollectionRule}", case_sensitive=False), + ]) + step_data_collection_rule_list_by_resource_group(test, rg, checks=[ + test.check('length(@)', 1), + ]) + step_data_collection_rule_list_by_subscription(test, rg, checks=[]) + step_data_collection_rule_update_tags(test, rg, checks=[ + test.check("location", "{location}", case_sensitive=False), + test.check("name", "{myDataCollectionRule}", case_sensitive=False), + ]) + + step_data_collection_rule_log_analytics_add(test, rg, checks=[]) + step_data_collection_rule_log_analytics_list(test, rg, checks=[ + test.check('length(@)', 2), + ]) + step_data_collection_rule_log_analytics_show(test, rg, checks=[]) + step_data_collection_rule_log_analytics_update(test, rg, checks=[]) + step_data_collection_rule_log_analytics_delete(test, rg, checks=[]) + + step_data_collection_rule_performance_counter_add(test, rg, checks=[]) + step_data_collection_rule_performance_counter_list(test, rg, checks=[ + test.check('length(@)', 3), + ]) + step_data_collection_rule_performance_counter_show(test, rg, checks=[]) + step_data_collection_rule_performance_counter_update(test, rg, checks=[]) + step_data_collection_rule_performance_counter_delete(test, rg, checks=[]) + + step_data_collection_rule_windows_event_log_add(test, rg, checks=[]) + step_data_collection_rule_windows_event_log_list(test, rg, checks=[ + test.check('length(@)', 3), + ]) + step_data_collection_rule_windows_event_log_show(test, rg, checks=[]) + step_data_collection_rule_windows_event_log_update(test, rg, checks=[]) + step_data_collection_rule_windows_event_log_delete(test, rg, checks=[]) + + step_data_collection_rule_syslog_add(test, rg, checks=[]) + step_data_collection_rule_syslog_list(test, rg, checks=[ + test.check('length(@)', 2), + ]) + step_data_collection_rule_syslog_show(test, rg, checks=[]) + step_data_collection_rule_syslog_update(test, rg, checks=[]) + step_data_collection_rule_syslog_delete(test, rg, checks=[]) + + step_data_collection_rule_log_analytics_add(test, rg, checks=[]) + step_data_collection_rule_data_flow_add(test, rg, checks=[]) + step_data_collection_rule_data_flow_list(test, rg, checks=[ + test.check('length(@)', 2), + ]) + + step_data_collection_rule_association_create(test, rg, checks=[]) + step_data_collection_rule_association_show(test, rg, checks=[]) + step_data_collection_rule_association_list_by_rule(test, rg, checks=[]) + step_data_collection_rule_association_list_by_resource(test, rg, checks=[]) + step_data_collection_rule_association_update(test, rg, checks=[]) + step_data_collection_rule_association_delete(test, rg, checks=[]) + + step_data_collection_rule_delete(test, rg, checks=[]) + cleanup_scenario(test, rg) + + +# EXAMPLE: /DataCollectionRules/patch/Update data collection rule +@try_manual +def step_data_collection_rule_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az monitor data-collection rule update ' + '--tags tag1="A" tag2="B" tag3="C" ' + '--name "{myDataCollectionRule}" ' + '--resource-group "{rg}"', + checks=checks) + + +# Test class for Scenario +@try_manual +class Monitor_control_serviceScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestmonitor_control_service_myResourceGroup'[:7], key='rg', + parameter_name='rg') + def test_monitor_control_service_Scenario(self, rg): + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myDataCollectionRule': 'myCollectionRule', + 'myAssociation': 'myAssociation' + }) + + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/monitor-control-service/azext_amcs/tests/latest/test_monitor_control_service_scenario_coverage.md b/src/monitor-control-service/azext_amcs/tests/latest/test_monitor_control_service_scenario_coverage.md new file mode 100644 index 00000000000..f58c5281d8f --- /dev/null +++ b/src/monitor-control-service/azext_amcs/tests/latest/test_monitor_control_service_scenario_coverage.md @@ -0,0 +1,36 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_data_collection_rule_create|successed||||2020-12-06 06:19:33.430101|2020-12-06 06:19:33.875079| +|step_data_collection_rule_show|successed||||2020-12-06 06:19:33.875079|2020-12-06 06:19:34.030414| +|step_data_collection_rule_list_by_resource_group|successed||||2020-12-06 06:19:34.030414|2020-12-06 06:19:34.181268| +|step_data_collection_rule_list_by_subscription|successed||||2020-12-06 06:19:34.181268|2020-12-06 06:19:34.382711| +|step_data_collection_rule_update_tags|successed||||2020-12-06 06:19:34.382711|2020-12-06 06:19:34.553738| +|step_data_collection_rule_log_analytics_add|successed||||2020-12-06 06:19:38.331945|2020-12-06 06:19:38.534172| +|step_data_collection_rule_log_analytics_list|successed||||2020-12-06 06:19:34.773959|2020-12-06 06:19:34.952407| +|step_data_collection_rule_log_analytics_show|successed||||2020-12-06 06:19:34.952407|2020-12-06 06:19:35.097624| +|step_data_collection_rule_log_analytics_update|successed||||2020-12-06 06:19:35.097624|2020-12-06 06:19:35.269941| +|step_data_collection_rule_log_analytics_delete|successed||||2020-12-06 06:19:35.269941|2020-12-06 06:19:35.435925| +|step_data_collection_rule_performance_counter_add|successed||||2020-12-06 06:19:35.435925|2020-12-06 06:19:35.600317| +|step_data_collection_rule_performance_counter_list|successed||||2020-12-06 06:19:35.600317|2020-12-06 06:19:35.758440| +|step_data_collection_rule_performance_counter_show|successed||||2020-12-06 06:19:35.758440|2020-12-06 06:19:35.929409| +|step_data_collection_rule_performance_counter_update|successed||||2020-12-06 06:19:35.929409|2020-12-06 06:19:36.094490| +|step_data_collection_rule_performance_counter_delete|successed||||2020-12-06 06:19:36.102476|2020-12-06 06:19:36.286495| +|step_data_collection_rule_windows_event_log_add|successed||||2020-12-06 06:19:36.286495|2020-12-06 06:19:36.470242| +|step_data_collection_rule_windows_event_log_list|successed||||2020-12-06 06:19:36.470242|2020-12-06 06:19:36.637700| +|step_data_collection_rule_windows_event_log_show|successed||||2020-12-06 06:19:36.637700|2020-12-06 06:19:36.824072| +|step_data_collection_rule_windows_event_log_update|successed||||2020-12-06 06:19:36.824072|2020-12-06 06:19:37.036132| +|step_data_collection_rule_windows_event_log_delete|successed||||2020-12-06 06:19:37.036132|2020-12-06 06:19:37.253954| +|step_data_collection_rule_syslog_add|successed||||2020-12-06 06:19:37.253954|2020-12-06 06:19:37.464321| +|step_data_collection_rule_syslog_list|successed||||2020-12-06 06:19:37.464321|2020-12-06 06:19:37.650559| +|step_data_collection_rule_syslog_show|successed||||2020-12-06 06:19:37.650559|2020-12-06 06:19:37.935204| +|step_data_collection_rule_syslog_update|successed||||2020-12-06 06:19:37.935204|2020-12-06 06:19:38.127402| +|step_data_collection_rule_syslog_delete|successed||||2020-12-06 06:19:38.127402|2020-12-06 06:19:38.331945| +|step_data_collection_rule_data_flow_add|successed||||2020-12-06 06:19:38.536188|2020-12-06 06:19:38.733902| +|step_data_collection_rule_data_flow_list|successed||||2020-12-06 06:19:38.733902|2020-12-06 06:19:38.953767| +|step_data_collection_rule_association_create|successed||||2020-12-06 06:19:38.953767|2020-12-06 06:19:39.163916| +|step_data_collection_rule_association_show|successed||||2020-12-06 06:19:39.172325|2020-12-06 06:19:39.411240| +|step_data_collection_rule_association_list_by_rule|successed||||2020-12-06 06:19:39.411240|2020-12-06 06:19:39.611947| +|step_data_collection_rule_association_list_by_resource|successed||||2020-12-06 06:19:39.611947|2020-12-06 06:19:39.814270| +|step_data_collection_rule_association_update|successed||||2020-12-06 06:19:39.814270|2020-12-06 06:19:40.030964| +|step_data_collection_rule_association_delete|successed||||2020-12-06 06:19:40.030964|2020-12-06 06:19:40.240757| +|step_data_collection_rule_delete|successed||||2020-12-06 06:19:40.240757|2020-12-06 06:19:40.451782| +Coverage: 34/34 diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/__init__.py b/src/monitor-control-service/azext_amcs/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/__init__.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/__init__.py new file mode 100644 index 00000000000..fa63968b375 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/__init__.py @@ -0,0 +1,16 @@ +# 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/_configuration.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/_configuration.py new file mode 100644 index 00000000000..e99ceac3dcf --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/_configuration.py @@ -0,0 +1,70 @@ +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-11-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'monitorclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/_monitor_client.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/_monitor_client.py new file mode 100644 index 00000000000..d8e2038c2d4 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/_monitor_client.py @@ -0,0 +1,74 @@ +# 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import DataCollectionRuleAssociationsOperations +from .operations import DataCollectionRulesOperations +from . import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar data_collection_rule_associations: DataCollectionRuleAssociationsOperations operations + :vartype data_collection_rule_associations: $(python-base-namespace).v2019_11_01_preview.operations.DataCollectionRuleAssociationsOperations + :ivar data_collection_rules: DataCollectionRulesOperations operations + :vartype data_collection_rules: $(python-base-namespace).v2019_11_01_preview.operations.DataCollectionRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.data_collection_rule_associations = DataCollectionRuleAssociationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_collection_rules = DataCollectionRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MonitorClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/__init__.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/__init__.py new file mode 100644 index 00000000000..0734551e38d --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/__init__.py @@ -0,0 +1,122 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureMonitorMetricsDestination + from ._models_py3 import DataCollectionRule + from ._models_py3 import DataCollectionRuleAssociation + from ._models_py3 import DataCollectionRuleAssociationProxyOnlyResource + from ._models_py3 import DataCollectionRuleAssociationProxyOnlyResourceListResult + from ._models_py3 import DataCollectionRuleAssociationProxyOnlyResourceProperties + from ._models_py3 import DataCollectionRuleDataSources + from ._models_py3 import DataCollectionRuleDestinations + from ._models_py3 import DataCollectionRuleResource + from ._models_py3 import DataCollectionRuleResourceListResult + from ._models_py3 import DataCollectionRuleResourceProperties + from ._models_py3 import DataFlow + from ._models_py3 import DataSourcesSpec + from ._models_py3 import DestinationsSpec + from ._models_py3 import DestinationsSpecAzureMonitorMetrics + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorDetailsautogenerated + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseError + from ._models_py3 import ErrorResponseErrorautogenerated + from ._models_py3 import ErrorResponseautogenerated + from ._models_py3 import ExtensionDataSource + from ._models_py3 import LogAnalyticsDestination + from ._models_py3 import PerfCounterDataSource + from ._models_py3 import ResourceForUpdate + from ._models_py3 import SyslogDataSource + from ._models_py3 import WindowsEventLogDataSource +except (SyntaxError, ImportError): + from ._models import AzureMonitorMetricsDestination # type: ignore + from ._models import DataCollectionRule # type: ignore + from ._models import DataCollectionRuleAssociation # type: ignore + from ._models import DataCollectionRuleAssociationProxyOnlyResource # type: ignore + from ._models import DataCollectionRuleAssociationProxyOnlyResourceListResult # type: ignore + from ._models import DataCollectionRuleAssociationProxyOnlyResourceProperties # type: ignore + from ._models import DataCollectionRuleDataSources # type: ignore + from ._models import DataCollectionRuleDestinations # type: ignore + from ._models import DataCollectionRuleResource # type: ignore + from ._models import DataCollectionRuleResourceListResult # type: ignore + from ._models import DataCollectionRuleResourceProperties # type: ignore + from ._models import DataFlow # type: ignore + from ._models import DataSourcesSpec # type: ignore + from ._models import DestinationsSpec # type: ignore + from ._models import DestinationsSpecAzureMonitorMetrics # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetails # type: ignore + from ._models import ErrorDetailsautogenerated # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseError # type: ignore + from ._models import ErrorResponseErrorautogenerated # type: ignore + from ._models import ErrorResponseautogenerated # type: ignore + from ._models import ExtensionDataSource # type: ignore + from ._models import LogAnalyticsDestination # type: ignore + from ._models import PerfCounterDataSource # type: ignore + from ._models import ResourceForUpdate # type: ignore + from ._models import SyslogDataSource # type: ignore + from ._models import WindowsEventLogDataSource # type: ignore + +from ._monitor_client_enums import ( + KnownDataCollectionRuleAssociationProvisioningState, + KnownDataCollectionRuleProvisioningState, + KnownDataFlowStreams, + KnownExtensionDataSourceStreams, + KnownPerfCounterDataSourceScheduledTransferPeriod, + KnownPerfCounterDataSourceStreams, + KnownSyslogDataSourceFacilityNames, + KnownSyslogDataSourceLogLevels, + KnownSyslogDataSourceStreams, + KnownWindowsEventLogDataSourceScheduledTransferPeriod, + KnownWindowsEventLogDataSourceStreams, +) + +__all__ = [ + 'AzureMonitorMetricsDestination', + 'DataCollectionRule', + 'DataCollectionRuleAssociation', + 'DataCollectionRuleAssociationProxyOnlyResource', + 'DataCollectionRuleAssociationProxyOnlyResourceListResult', + 'DataCollectionRuleAssociationProxyOnlyResourceProperties', + 'DataCollectionRuleDataSources', + 'DataCollectionRuleDestinations', + 'DataCollectionRuleResource', + 'DataCollectionRuleResourceListResult', + 'DataCollectionRuleResourceProperties', + 'DataFlow', + 'DataSourcesSpec', + 'DestinationsSpec', + 'DestinationsSpecAzureMonitorMetrics', + 'ErrorAdditionalInfo', + 'ErrorDetails', + 'ErrorDetailsautogenerated', + 'ErrorResponse', + 'ErrorResponseError', + 'ErrorResponseErrorautogenerated', + 'ErrorResponseautogenerated', + 'ExtensionDataSource', + 'LogAnalyticsDestination', + 'PerfCounterDataSource', + 'ResourceForUpdate', + 'SyslogDataSource', + 'WindowsEventLogDataSource', + 'KnownDataCollectionRuleAssociationProvisioningState', + 'KnownDataCollectionRuleProvisioningState', + 'KnownDataFlowStreams', + 'KnownExtensionDataSourceStreams', + 'KnownPerfCounterDataSourceScheduledTransferPeriod', + 'KnownPerfCounterDataSourceStreams', + 'KnownSyslogDataSourceFacilityNames', + 'KnownSyslogDataSourceLogLevels', + 'KnownSyslogDataSourceStreams', + 'KnownWindowsEventLogDataSourceScheduledTransferPeriod', + 'KnownWindowsEventLogDataSourceStreams', +] diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_models.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_models.py new file mode 100644 index 00000000000..c3c0b792f45 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_models.py @@ -0,0 +1,1089 @@ +# 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.core.exceptions import HttpResponseError +import msrest.serialization + + +class AzureMonitorMetricsDestination(msrest.serialization.Model): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureMonitorMetricsDestination, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class DataCollectionRule(msrest.serialization.Model): + """Definition of what monitoring data to collect and where that data should be sent. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.data_sources = kwargs.get('data_sources', None) + self.destinations = kwargs['destinations'] + self.data_flows = kwargs['data_flows'] + self.provisioning_state = None + + +class DataCollectionRuleAssociation(msrest.serialization.Model): + """Definition of association of a data collection rule with a monitored Azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociation, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.data_collection_rule_id = kwargs['data_collection_rule_id'] + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResource(msrest.serialization.Model): + """Definition of generic ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'properties.dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = kwargs.get('description', None) + self.data_collection_rule_id = kwargs['data_collection_rule_id'] + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleAssociationProxyOnlyResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DataCollectionRuleAssociationProxyOnlyResourceProperties(DataCollectionRuleAssociation): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceProperties, self).__init__(**kwargs) + + +class DataSourcesSpec(msrest.serialization.Model): + """Specification of data sources that will be collected. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSourcesSpec, self).__init__(**kwargs) + self.performance_counters = kwargs.get('performance_counters', None) + self.windows_event_logs = kwargs.get('windows_event_logs', None) + self.syslog = kwargs.get('syslog', None) + self.extensions = kwargs.get('extensions', None) + + +class DataCollectionRuleDataSources(DataSourcesSpec): + """The specification of data sources. +This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleDataSources, self).__init__(**kwargs) + + +class DestinationsSpec(msrest.serialization.Model): + """Specification of destinations that can be used in data flows. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + **kwargs + ): + super(DestinationsSpec, self).__init__(**kwargs) + self.log_analytics = kwargs.get('log_analytics', None) + self.azure_monitor_metrics = kwargs.get('azure_monitor_metrics', None) + + +class DataCollectionRuleDestinations(DestinationsSpec): + """The specification of destinations. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleDestinations, self).__init__(**kwargs) + + +class DataCollectionRuleResource(msrest.serialization.Model): + """Definition of ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The geo-location where the resource lives. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_sources': {'key': 'properties.dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'properties.destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'properties.dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleResource, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = kwargs.get('description', None) + self.data_sources = kwargs.get('data_sources', None) + self.destinations = kwargs['destinations'] + self.data_flows = kwargs['data_flows'] + self.provisioning_state = None + + +class DataCollectionRuleResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleResourceListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DataCollectionRuleResourceProperties(DataCollectionRule): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleResourceProperties, self).__init__(**kwargs) + + +class DataFlow(msrest.serialization.Model): + """Definition of which streams are sent to which destinations. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams for this data flow. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataFlowStreams] + :param destinations: Required. List of destinations for this data flow. + :type destinations: list[str] + """ + + _validation = { + 'streams': {'required': True}, + 'destinations': {'required': True}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataFlow, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.destinations = kwargs['destinations'] + + +class DestinationsSpecAzureMonitorMetrics(AzureMonitorMetricsDestination): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DestinationsSpecAzureMonitorMetrics, self).__init__(**kwargs) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """Additional information for common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetails(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorDetailsautogenerated(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsautogenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsautogenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetailsautogenerated, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseautogenerated(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsautogenerated + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsautogenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseautogenerated, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseError(ErrorDetails): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + + +class ErrorResponseErrorautogenerated(ErrorDetailsautogenerated): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsautogenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsautogenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorautogenerated, self).__init__(**kwargs) + + +class ExtensionDataSource(msrest.serialization.Model): + """Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. +Collected from either Windows and Linux machines, depending on which extension is defined. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownExtensionDataSourceStreams] + :param extension_name: Required. The name of the VM extension. + :type extension_name: str + :param extension_settings: The extension settings. The format is specific for particular + extension. + :type extension_settings: object + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'extension_name': {'required': True, 'max_length': 64, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'extension_settings': {'key': 'extensionSettings', 'type': 'object'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.extension_name = kwargs['extension_name'] + self.extension_settings = kwargs.get('extension_settings', None) + self.name = kwargs['name'] + + +class LogAnalyticsDestination(msrest.serialization.Model): + """Log Analytics destination. + + All required parameters must be populated in order to send to Azure. + + :param workspace_resource_id: Required. The resource ID of the Log Analytics workspace. + :type workspace_resource_id: str + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'workspace_resource_id': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsDestination, self).__init__(**kwargs) + self.workspace_resource_id = kwargs['workspace_resource_id'] + self.name = kwargs['name'] + + +class PerfCounterDataSource(msrest.serialization.Model): + """Definition of which performance counters will be collected and how they will be collected by this data collection rule. +Collected from both Windows and Linux machines where the counter is present. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceScheduledTransferPeriod + :param sampling_frequency_in_seconds: Required. The number of seconds between consecutive + counter measurements (samples). + :type sampling_frequency_in_seconds: int + :param counter_specifiers: Required. A list of specifier names of the performance counters you + want to collect. + Use a wildcard (*) to collect a counter for all instances. + To get a list of performance counters on Windows, run the command 'typeperf'. + :type counter_specifiers: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'sampling_frequency_in_seconds': {'required': True, 'maximum': 30, 'minimum': 1}, + 'counter_specifiers': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'sampling_frequency_in_seconds': {'key': 'samplingFrequencyInSeconds', 'type': 'int'}, + 'counter_specifiers': {'key': 'counterSpecifiers', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfCounterDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.scheduled_transfer_period = kwargs['scheduled_transfer_period'] + self.sampling_frequency_in_seconds = kwargs['sampling_frequency_in_seconds'] + self.counter_specifiers = kwargs['counter_specifiers'] + self.name = kwargs['name'] + + +class ResourceForUpdate(msrest.serialization.Model): + """Definition of ARM tracked top level resource properties for update operation. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceForUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class SyslogDataSource(msrest.serialization.Model): + """Definition of which syslog data will be collected and how it will be collected. +Only collected from Linux machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceStreams] + :param facility_names: Required. The list of facility names. + :type facility_names: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceFacilityNames] + :param log_levels: The log levels to collect. + :type log_levels: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceLogLevels] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'facility_names': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'facility_names': {'key': 'facilityNames', 'type': '[str]'}, + 'log_levels': {'key': 'logLevels', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SyslogDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.facility_names = kwargs['facility_names'] + self.log_levels = kwargs.get('log_levels', None) + self.name = kwargs['name'] + + +class WindowsEventLogDataSource(msrest.serialization.Model): + """Definition of which Windows Event Log events will be collected and how they will be collected. +Only collected from Windows machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceScheduledTransferPeriod + :param x_path_queries: Required. A list of Windows Event Log queries in XPATH format. + :type x_path_queries: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'x_path_queries': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'x_path_queries': {'key': 'xPathQueries', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsEventLogDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.scheduled_transfer_period = kwargs['scheduled_transfer_period'] + self.x_path_queries = kwargs['x_path_queries'] + self.name = kwargs['name'] diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_models_py3.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_models_py3.py new file mode 100644 index 00000000000..c421746d54b --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_models_py3.py @@ -0,0 +1,1174 @@ +# 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 typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._monitor_client_enums import * + + +class AzureMonitorMetricsDestination(msrest.serialization.Model): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(AzureMonitorMetricsDestination, self).__init__(**kwargs) + self.name = name + + +class DataCollectionRule(msrest.serialization.Model): + """Definition of what monitoring data to collect and where that data should be sent. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + destinations: "DestinationsSpec", + data_flows: List["DataFlow"], + description: Optional[str] = None, + data_sources: Optional["DataSourcesSpec"] = None, + **kwargs + ): + super(DataCollectionRule, self).__init__(**kwargs) + self.description = description + self.data_sources = data_sources + self.destinations = destinations + self.data_flows = data_flows + self.provisioning_state = None + + +class DataCollectionRuleAssociation(msrest.serialization.Model): + """Definition of association of a data collection rule with a monitored Azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_collection_rule_id: str, + description: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociation, self).__init__(**kwargs) + self.description = description + self.data_collection_rule_id = data_collection_rule_id + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResource(msrest.serialization.Model): + """Definition of generic ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'properties.dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_collection_rule_id: str, + description: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = description + self.data_collection_rule_id = data_collection_rule_id + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleAssociationProxyOnlyResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DataCollectionRuleAssociationProxyOnlyResource"], + next_link: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DataCollectionRuleAssociationProxyOnlyResourceProperties(DataCollectionRuleAssociation): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_collection_rule_id: str, + description: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceProperties, self).__init__(description=description, data_collection_rule_id=data_collection_rule_id, **kwargs) + + +class DataSourcesSpec(msrest.serialization.Model): + """Specification of data sources that will be collected. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + *, + performance_counters: Optional[List["PerfCounterDataSource"]] = None, + windows_event_logs: Optional[List["WindowsEventLogDataSource"]] = None, + syslog: Optional[List["SyslogDataSource"]] = None, + extensions: Optional[List["ExtensionDataSource"]] = None, + **kwargs + ): + super(DataSourcesSpec, self).__init__(**kwargs) + self.performance_counters = performance_counters + self.windows_event_logs = windows_event_logs + self.syslog = syslog + self.extensions = extensions + + +class DataCollectionRuleDataSources(DataSourcesSpec): + """The specification of data sources. +This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + *, + performance_counters: Optional[List["PerfCounterDataSource"]] = None, + windows_event_logs: Optional[List["WindowsEventLogDataSource"]] = None, + syslog: Optional[List["SyslogDataSource"]] = None, + extensions: Optional[List["ExtensionDataSource"]] = None, + **kwargs + ): + super(DataCollectionRuleDataSources, self).__init__(performance_counters=performance_counters, windows_event_logs=windows_event_logs, syslog=syslog, extensions=extensions, **kwargs) + + +class DestinationsSpec(msrest.serialization.Model): + """Specification of destinations that can be used in data flows. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + *, + log_analytics: Optional[List["LogAnalyticsDestination"]] = None, + azure_monitor_metrics: Optional["AzureMonitorMetricsDestination"] = None, + **kwargs + ): + super(DestinationsSpec, self).__init__(**kwargs) + self.log_analytics = log_analytics + self.azure_monitor_metrics = azure_monitor_metrics + + +class DataCollectionRuleDestinations(DestinationsSpec): + """The specification of destinations. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + *, + log_analytics: Optional[List["LogAnalyticsDestination"]] = None, + azure_monitor_metrics: Optional["AzureMonitorMetricsDestination"] = None, + **kwargs + ): + super(DataCollectionRuleDestinations, self).__init__(log_analytics=log_analytics, azure_monitor_metrics=azure_monitor_metrics, **kwargs) + + +class DataCollectionRuleResource(msrest.serialization.Model): + """Definition of ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The geo-location where the resource lives. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_sources': {'key': 'properties.dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'properties.destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'properties.dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + destinations: "DestinationsSpec", + data_flows: List["DataFlow"], + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + data_sources: Optional["DataSourcesSpec"] = None, + **kwargs + ): + super(DataCollectionRuleResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = description + self.data_sources = data_sources + self.destinations = destinations + self.data_flows = data_flows + self.provisioning_state = None + + +class DataCollectionRuleResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DataCollectionRuleResource"], + next_link: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DataCollectionRuleResourceProperties(DataCollectionRule): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + destinations: "DestinationsSpec", + data_flows: List["DataFlow"], + description: Optional[str] = None, + data_sources: Optional["DataSourcesSpec"] = None, + **kwargs + ): + super(DataCollectionRuleResourceProperties, self).__init__(description=description, data_sources=data_sources, destinations=destinations, data_flows=data_flows, **kwargs) + + +class DataFlow(msrest.serialization.Model): + """Definition of which streams are sent to which destinations. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams for this data flow. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataFlowStreams] + :param destinations: Required. List of destinations for this data flow. + :type destinations: list[str] + """ + + _validation = { + 'streams': {'required': True}, + 'destinations': {'required': True}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownDataFlowStreams"]], + destinations: List[str], + **kwargs + ): + super(DataFlow, self).__init__(**kwargs) + self.streams = streams + self.destinations = destinations + + +class DestinationsSpecAzureMonitorMetrics(AzureMonitorMetricsDestination): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(DestinationsSpecAzureMonitorMetrics, self).__init__(name=name, **kwargs) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """Additional information for common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetails(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorDetailsautogenerated(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsautogenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsautogenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetailsautogenerated, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseautogenerated(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsautogenerated + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsautogenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseautogenerated, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseError(ErrorDetails): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + + +class ErrorResponseErrorautogenerated(ErrorDetailsautogenerated): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsautogenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsautogenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorautogenerated, self).__init__(**kwargs) + + +class ExtensionDataSource(msrest.serialization.Model): + """Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. +Collected from either Windows and Linux machines, depending on which extension is defined. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownExtensionDataSourceStreams] + :param extension_name: Required. The name of the VM extension. + :type extension_name: str + :param extension_settings: The extension settings. The format is specific for particular + extension. + :type extension_settings: object + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'extension_name': {'required': True, 'max_length': 64, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'extension_settings': {'key': 'extensionSettings', 'type': 'object'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownExtensionDataSourceStreams"]], + extension_name: str, + name: str, + extension_settings: Optional[object] = None, + **kwargs + ): + super(ExtensionDataSource, self).__init__(**kwargs) + self.streams = streams + self.extension_name = extension_name + self.extension_settings = extension_settings + self.name = name + + +class LogAnalyticsDestination(msrest.serialization.Model): + """Log Analytics destination. + + All required parameters must be populated in order to send to Azure. + + :param workspace_resource_id: Required. The resource ID of the Log Analytics workspace. + :type workspace_resource_id: str + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'workspace_resource_id': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + workspace_resource_id: str, + name: str, + **kwargs + ): + super(LogAnalyticsDestination, self).__init__(**kwargs) + self.workspace_resource_id = workspace_resource_id + self.name = name + + +class PerfCounterDataSource(msrest.serialization.Model): + """Definition of which performance counters will be collected and how they will be collected by this data collection rule. +Collected from both Windows and Linux machines where the counter is present. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceScheduledTransferPeriod + :param sampling_frequency_in_seconds: Required. The number of seconds between consecutive + counter measurements (samples). + :type sampling_frequency_in_seconds: int + :param counter_specifiers: Required. A list of specifier names of the performance counters you + want to collect. + Use a wildcard (*) to collect a counter for all instances. + To get a list of performance counters on Windows, run the command 'typeperf'. + :type counter_specifiers: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'sampling_frequency_in_seconds': {'required': True, 'maximum': 30, 'minimum': 1}, + 'counter_specifiers': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'sampling_frequency_in_seconds': {'key': 'samplingFrequencyInSeconds', 'type': 'int'}, + 'counter_specifiers': {'key': 'counterSpecifiers', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownPerfCounterDataSourceStreams"]], + scheduled_transfer_period: Union[str, "KnownPerfCounterDataSourceScheduledTransferPeriod"], + sampling_frequency_in_seconds: int, + counter_specifiers: List[str], + name: str, + **kwargs + ): + super(PerfCounterDataSource, self).__init__(**kwargs) + self.streams = streams + self.scheduled_transfer_period = scheduled_transfer_period + self.sampling_frequency_in_seconds = sampling_frequency_in_seconds + self.counter_specifiers = counter_specifiers + self.name = name + + +class ResourceForUpdate(msrest.serialization.Model): + """Definition of ARM tracked top level resource properties for update operation. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ResourceForUpdate, self).__init__(**kwargs) + self.tags = tags + + +class SyslogDataSource(msrest.serialization.Model): + """Definition of which syslog data will be collected and how it will be collected. +Only collected from Linux machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceStreams] + :param facility_names: Required. The list of facility names. + :type facility_names: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceFacilityNames] + :param log_levels: The log levels to collect. + :type log_levels: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceLogLevels] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'facility_names': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'facility_names': {'key': 'facilityNames', 'type': '[str]'}, + 'log_levels': {'key': 'logLevels', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownSyslogDataSourceStreams"]], + facility_names: List[Union[str, "KnownSyslogDataSourceFacilityNames"]], + name: str, + log_levels: Optional[List[Union[str, "KnownSyslogDataSourceLogLevels"]]] = None, + **kwargs + ): + super(SyslogDataSource, self).__init__(**kwargs) + self.streams = streams + self.facility_names = facility_names + self.log_levels = log_levels + self.name = name + + +class WindowsEventLogDataSource(msrest.serialization.Model): + """Definition of which Windows Event Log events will be collected and how they will be collected. +Only collected from Windows machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceScheduledTransferPeriod + :param x_path_queries: Required. A list of Windows Event Log queries in XPATH format. + :type x_path_queries: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'x_path_queries': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'x_path_queries': {'key': 'xPathQueries', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownWindowsEventLogDataSourceStreams"]], + scheduled_transfer_period: Union[str, "KnownWindowsEventLogDataSourceScheduledTransferPeriod"], + x_path_queries: List[str], + name: str, + **kwargs + ): + super(WindowsEventLogDataSource, self).__init__(**kwargs) + self.streams = streams + self.scheduled_transfer_period = scheduled_transfer_period + self.x_path_queries = x_path_queries + self.name = name diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_monitor_client_enums.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_monitor_client_enums.py new file mode 100644 index 00000000000..2308243d3ed --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/models/_monitor_client_enums.py @@ -0,0 +1,161 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class KnownDataCollectionRuleAssociationProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The resource provisioning state. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class KnownDataCollectionRuleProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The resource provisioning state. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class KnownDataFlowStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_ANTI_MALWARE_STATUS = "Microsoft-AntiMalwareStatus" + MICROSOFT_AUDITD = "Microsoft-Auditd" + MICROSOFT_CISCOASA = "Microsoft-CISCOASA" + MICROSOFT_COMMON_SECURITY_LOG = "Microsoft-CommonSecurityLog" + MICROSOFT_COMPUTER_GROUP = "Microsoft-ComputerGroup" + MICROSOFT_EVENT = "Microsoft-Event" + MICROSOFT_FIREWALL_LOG = "Microsoft-FirewallLog" + MICROSOFT_HEALTH_STATE_CHANGE = "Microsoft-HealthStateChange" + MICROSOFT_HEARTBEAT = "Microsoft-Heartbeat" + MICROSOFT_INSIGHTS_METRICS = "Microsoft-InsightsMetrics" + MICROSOFT_OPERATION_LOG = "Microsoft-OperationLog" + MICROSOFT_PERF = "Microsoft-Perf" + MICROSOFT_PROCESS_INVESTIGATOR = "Microsoft-ProcessInvestigator" + MICROSOFT_PROTECTION_STATUS = "Microsoft-ProtectionStatus" + MICROSOFT_ROME_DETECTION_EVENT = "Microsoft-RomeDetectionEvent" + MICROSOFT_SECURITY_BASELINE = "Microsoft-SecurityBaseline" + MICROSOFT_SECURITY_BASELINE_SUMMARY = "Microsoft-SecurityBaselineSummary" + MICROSOFT_SECURITY_EVENT = "Microsoft-SecurityEvent" + MICROSOFT_SYSLOG = "Microsoft-Syslog" + MICROSOFT_WINDOWS_EVENT = "Microsoft-WindowsEvent" + +class KnownExtensionDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_ANTI_MALWARE_STATUS = "Microsoft-AntiMalwareStatus" + MICROSOFT_AUDITD = "Microsoft-Auditd" + MICROSOFT_CISCOASA = "Microsoft-CISCOASA" + MICROSOFT_COMMON_SECURITY_LOG = "Microsoft-CommonSecurityLog" + MICROSOFT_COMPUTER_GROUP = "Microsoft-ComputerGroup" + MICROSOFT_EVENT = "Microsoft-Event" + MICROSOFT_FIREWALL_LOG = "Microsoft-FirewallLog" + MICROSOFT_HEALTH_STATE_CHANGE = "Microsoft-HealthStateChange" + MICROSOFT_HEARTBEAT = "Microsoft-Heartbeat" + MICROSOFT_INSIGHTS_METRICS = "Microsoft-InsightsMetrics" + MICROSOFT_OPERATION_LOG = "Microsoft-OperationLog" + MICROSOFT_PERF = "Microsoft-Perf" + MICROSOFT_PROCESS_INVESTIGATOR = "Microsoft-ProcessInvestigator" + MICROSOFT_PROTECTION_STATUS = "Microsoft-ProtectionStatus" + MICROSOFT_ROME_DETECTION_EVENT = "Microsoft-RomeDetectionEvent" + MICROSOFT_SECURITY_BASELINE = "Microsoft-SecurityBaseline" + MICROSOFT_SECURITY_BASELINE_SUMMARY = "Microsoft-SecurityBaselineSummary" + MICROSOFT_SECURITY_EVENT = "Microsoft-SecurityEvent" + MICROSOFT_SYSLOG = "Microsoft-Syslog" + MICROSOFT_WINDOWS_EVENT = "Microsoft-WindowsEvent" + +class KnownPerfCounterDataSourceScheduledTransferPeriod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The interval between data uploads (scheduled transfers), rounded up to the nearest minute. + """ + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT60_M = "PT60M" + +class KnownPerfCounterDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_PERF = "Microsoft-Perf" + MICROSOFT_INSIGHTS_METRICS = "Microsoft-InsightsMetrics" + +class KnownSyslogDataSourceFacilityNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + AUTH = "auth" + AUTHPRIV = "authpriv" + CRON = "cron" + DAEMON = "daemon" + KERN = "kern" + LPR = "lpr" + MAIL = "mail" + MARK = "mark" + NEWS = "news" + SYSLOG = "syslog" + USER = "user" + UUCP = "UUCP" + LOCAL0 = "local0" + LOCAL1 = "local1" + LOCAL2 = "local2" + LOCAL3 = "local3" + LOCAL4 = "local4" + LOCAL5 = "local5" + LOCAL6 = "local6" + LOCAL7 = "local7" + +class KnownSyslogDataSourceLogLevels(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEBUG = "Debug" + INFO = "Info" + NOTICE = "Notice" + WARNING = "Warning" + ERROR = "Error" + CRITICAL = "Critical" + ALERT = "Alert" + EMERGENCY = "Emergency" + +class KnownSyslogDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_SYSLOG = "Microsoft-Syslog" + +class KnownWindowsEventLogDataSourceScheduledTransferPeriod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The interval between data uploads (scheduled transfers), rounded up to the nearest minute. + """ + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT60_M = "PT60M" + +class KnownWindowsEventLogDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_WINDOWS_EVENT = "Microsoft-WindowsEvent" + MICROSOFT_EVENT = "Microsoft-Event" diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/__init__.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/__init__.py new file mode 100644 index 00000000000..f755a04ab06 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 ._data_collection_rule_associations_operations import DataCollectionRuleAssociationsOperations +from ._data_collection_rules_operations import DataCollectionRulesOperations + +__all__ = [ + 'DataCollectionRuleAssociationsOperations', + 'DataCollectionRulesOperations', +] diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_association_operations.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_association_operations.py new file mode 100644 index 00000000000..5d40155e0c7 --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_association_operations.py @@ -0,0 +1,399 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRuleAssociationOperations(object): + """DataCollectionRuleAssociationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + resource_uri, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + """Lists associations for the specified resource. + + Lists associations for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations'} # type: ignore + + def list_by_rule( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + """Lists associations for the specified data collection rule. + + Lists associations for the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations'} # type: ignore + + def get( + self, + resource_uri, # type: str + association_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleAssociationProxyOnlyResource" + """Returns the specified association. + + Returns the specified association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + def create( + self, + resource_uri, # type: str + association_name, # type: str + description=None, # type: Optional[str] + data_collection_rule_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleAssociationProxyOnlyResource" + """Creates or updates an association. + + Creates or updates an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: The resource ID of the data collection rule that is to be + associated. + :type data_collection_rule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + body = models.DataCollectionRuleAssociationProxyOnlyResource(description=description, data_collection_rule_id=data_collection_rule_id) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleAssociationProxyOnlyResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + def delete( + self, + resource_uri, # type: str + association_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an association. + + Deletes an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_associations_operations.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_associations_operations.py new file mode 100644 index 00000000000..6cd2e8d628a --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_associations_operations.py @@ -0,0 +1,393 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRuleAssociationsOperations(object): + """DataCollectionRuleAssociationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + resource_uri, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + """Lists associations for the specified resource. + + Lists associations for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations'} # type: ignore + + def list_by_rule( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + """Lists associations for the specified data collection rule. + + Lists associations for the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations'} # type: ignore + + def get( + self, + resource_uri, # type: str + association_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleAssociationProxyOnlyResource" + """Returns the specified association. + + Returns the specified association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + def create( + self, + resource_uri, # type: str + association_name, # type: str + body=None, # type: Optional["models.DataCollectionRuleAssociationProxyOnlyResource"] + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleAssociationProxyOnlyResource" + """Creates or updates an association. + + Creates or updates an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleAssociationProxyOnlyResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + def delete( + self, + resource_uri, # type: str + association_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an association. + + Deletes an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_operations.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_operations.py new file mode 100644 index 00000000000..3f3c20d4dac --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rule_operations.py @@ -0,0 +1,496 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRuleOperations(object): + """DataCollectionRuleOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleResourceListResult"] + """Lists all data collection rules in the specified resource group. + + Lists all data collection rules in the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponseautogenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleResourceListResult"] + """Lists all data collection rules in the specified subscription. + + Lists all data collection rules in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponseautogenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleResource" + """Returns the specified data collection rule. + + Returns the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + description=None, # type: Optional[str] + data_flows=None, # type: Optional[List["models.DataFlow"]] + log_analytics=None, # type: Optional[List["models.LogAnalyticsDestination"]] + azure_monitor_metrics=None, # type: Optional["models.AzureMonitorMetricsDestination"] + performance_counters=None, # type: Optional[List["models.PerfCounterDataSource"]] + windows_event_logs=None, # type: Optional[List["models.WindowsEventLogDataSource"]] + syslog=None, # type: Optional[List["models.SyslogDataSource"]] + extensions=None, # type: Optional[List["models.ExtensionDataSource"]] + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleResource" + """Creates or updates a data collection rule. + + Creates or updates a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param location: The geo-location where the resource lives. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param description: Description of the data collection rule. + :type description: str + :param data_flows: The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base-namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base-namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base-namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base-namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base-namespace).v2019_11_01_preview.models.ExtensionDataSource] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + body = models.DataCollectionRuleResource(location=location, tags=tags, description=description, data_flows=data_flows, log_analytics=log_analytics, azure_monitor_metrics=azure_monitor_metrics, performance_counters=performance_counters, windows_event_logs=windows_event_logs, syslog=syslog, extensions=extensions) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleResource" + """Updates part of a data collection rule. + + Updates part of a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + body = models.ResourceForUpdate(tags=tags) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourceForUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a data collection rule. + + Deletes a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rules_operations.py b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rules_operations.py new file mode 100644 index 00000000000..93c1bb0c35c --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/operations/_data_collection_rules_operations.py @@ -0,0 +1,465 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRulesOperations(object): + """DataCollectionRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleResourceListResult"] + """Lists all data collection rules in the specified resource group. + + Lists all data collection rules in the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponseautogenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.DataCollectionRuleResourceListResult"] + """Lists all data collection rules in the specified subscription. + + Lists all data collection rules in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponseautogenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleResource" + """Returns the specified data collection rule. + + Returns the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + body=None, # type: Optional["models.DataCollectionRuleResource"] + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleResource" + """Creates or updates a data collection rule. + + Creates or updates a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + body=None, # type: Optional["models.ResourceForUpdate"] + **kwargs # type: Any + ): + # type: (...) -> "models.DataCollectionRuleResource" + """Updates part of a data collection rule. + + Updates part of a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.ResourceForUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourceForUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a data collection rule. + + Deletes a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponseautogenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore diff --git a/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/py.typed b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/monitor-control-service/azext_amcs/vendored_sdks/amcs/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/monitor-control-service/gen.zip b/src/monitor-control-service/gen.zip new file mode 100644 index 00000000000..5baa5297f9c Binary files /dev/null and b/src/monitor-control-service/gen.zip differ diff --git a/src/monitor-control-service/report.md b/src/monitor-control-service/report.md new file mode 100644 index 00000000000..3519ab35d93 --- /dev/null +++ b/src/monitor-control-service/report.md @@ -0,0 +1,129 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az monitor-control-service|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az monitor-control-service` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az monitor data-collection rule association|DataCollectionRuleAssociations|[commands](#CommandsInDataCollectionRuleAssociations)| +|az monitor data-collection rule|DataCollectionRules|[commands](#CommandsInDataCollectionRules)| + +## COMMANDS +### Commands in `az monitor data-collection rule` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az monitor data-collection rule list](#DataCollectionRulesListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersDataCollectionRulesListByResourceGroup)|[Example](#ExamplesDataCollectionRulesListByResourceGroup)| +|[az monitor data-collection rule list](#DataCollectionRulesListBySubscription)|ListBySubscription|[Parameters](#ParametersDataCollectionRulesListBySubscription)|[Example](#ExamplesDataCollectionRulesListBySubscription)| +|[az monitor data-collection rule show](#DataCollectionRulesGet)|Get|[Parameters](#ParametersDataCollectionRulesGet)|[Example](#ExamplesDataCollectionRulesGet)| +|[az monitor data-collection rule delete](#DataCollectionRulesDelete)|Delete|[Parameters](#ParametersDataCollectionRulesDelete)|[Example](#ExamplesDataCollectionRulesDelete)| + +### Commands in `az monitor data-collection rule association` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az monitor data-collection rule association list](#DataCollectionRuleAssociationsListByRule)|ListByRule|[Parameters](#ParametersDataCollectionRuleAssociationsListByRule)|[Example](#ExamplesDataCollectionRuleAssociationsListByRule)| +|[az monitor data-collection rule association list](#DataCollectionRuleAssociationsListByResource)|ListByResource|[Parameters](#ParametersDataCollectionRuleAssociationsListByResource)|[Example](#ExamplesDataCollectionRuleAssociationsListByResource)| +|[az monitor data-collection rule association show](#DataCollectionRuleAssociationsGet)|Get|[Parameters](#ParametersDataCollectionRuleAssociationsGet)|[Example](#ExamplesDataCollectionRuleAssociationsGet)| +|[az monitor data-collection rule association delete](#DataCollectionRuleAssociationsDelete)|Delete|[Parameters](#ParametersDataCollectionRuleAssociationsDelete)|[Example](#ExamplesDataCollectionRuleAssociationsDelete)| + + +## COMMAND DETAILS + +### group `az monitor data-collection rule` +#### Command `az monitor data-collection rule list` + +##### Example +``` +az monitor data-collection rule list --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| + +#### Command `az monitor data-collection rule list` + +##### Example +``` +az monitor data-collection rule list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az monitor data-collection rule show` + +##### Example +``` +az monitor data-collection rule show --name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--data-collection-rule-name**|string|The name of the data collection rule. The name is case insensitive.|data_collection_rule_name|dataCollectionRuleName| + +#### Command `az monitor data-collection rule delete` + +##### Example +``` +az monitor data-collection rule delete --name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--data-collection-rule-name**|string|The name of the data collection rule. The name is case insensitive.|data_collection_rule_name|dataCollectionRuleName| + +### group `az monitor data-collection rule association` +#### Command `az monitor data-collection rule association list` + +##### Example +``` +az monitor data-collection rule association list --rule-name "myCollectionRule" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--data-collection-rule-name**|string|The name of the data collection rule. The name is case insensitive.|data_collection_rule_name|dataCollectionRuleName| + +#### Command `az monitor data-collection rule association list` + +##### Example +``` +az monitor data-collection rule association list --resource "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourc\ +eGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-uri**|string|The identifier of the resource.|resource_uri|resourceUri| + +#### Command `az monitor data-collection rule association show` + +##### Example +``` +az monitor data-collection rule association show --name "myAssociation" --resource "subscriptions/703362b3-f278-4e4b-91\ +79-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-uri**|string|The identifier of the resource.|resource_uri|resourceUri| +|**--association-name**|string|The name of the association.|association_name|associationName| + +#### Command `az monitor data-collection rule association delete` + +##### Example +``` +az monitor data-collection rule association delete --name "myAssociation" --resource "subscriptions/703362b3-f278-4e4b-\ +9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-uri**|string|The identifier of the resource.|resource_uri|resourceUri| +|**--association-name**|string|The name of the association.|association_name|associationName| diff --git a/src/monitor-control-service/setup.cfg b/src/monitor-control-service/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/monitor-control-service/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/monitor-control-service/setup.py b/src/monitor-control-service/setup.py new file mode 100644 index 00000000000..db8792e9852 --- /dev/null +++ b/src/monitor-control-service/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_amcs.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_amcs.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='monitor_control_service', + version=VERSION, + description='Microsoft Azure Command-Line Tools MonitorClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/monitor-control-service', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_amcs': ['azext_metadata.json']}, +)