From 215720ae3c4e9b8eb109cfff90988cca5dd931e8 Mon Sep 17 00:00:00 2001 From: "Kerwin(Kaihui) Sun" Date: Thu, 21 Oct 2021 15:40:25 +0800 Subject: [PATCH] [Elastic] Initial GA Elastic (#3921) * first generation * regen the elastic extension * fix sytle * fix recording * add codeowners * rename commands * update readme --- .github/CODEOWNERS | 2 + src/elastic/HISTORY.rst | 8 + src/elastic/README.md | 77 + src/elastic/azext_elastic/__init__.py | 53 + src/elastic/azext_elastic/_help.py | 20 + src/elastic/azext_elastic/action.py | 20 + src/elastic/azext_elastic/azext_metadata.json | 4 + src/elastic/azext_elastic/custom.py | 20 + .../azext_elastic/generated/__init__.py | 12 + .../generated/_client_factory.py | 44 + src/elastic/azext_elastic/generated/_help.py | 225 +++ .../azext_elastic/generated/_params.py | 158 ++ .../azext_elastic/generated/_validators.py | 9 + src/elastic/azext_elastic/generated/action.py | 55 + .../azext_elastic/generated/commands.py | 69 + src/elastic/azext_elastic/generated/custom.py | 214 +++ src/elastic/azext_elastic/manual/__init__.py | 12 + src/elastic/azext_elastic/manual/_params.py | 17 + src/elastic/azext_elastic/manual/custom.py | 55 + src/elastic/azext_elastic/tests/__init__.py | 116 ++ .../azext_elastic/tests/latest/__init__.py | 12 + .../tests/latest/example_steps.py | 199 +++ .../recordings/test_elastic_Scenario.yaml | 1343 +++++++++++++++++ .../tests/latest/test_elastic_scenario.py | 109 ++ .../latest/test_elastic_scenario_coverage.md | 16 + .../azext_elastic/vendored_sdks/__init__.py | 12 + .../vendored_sdks/elastic/__init__.py | 19 + .../vendored_sdks/elastic/_configuration.py | 71 + .../elastic/_microsoft_elastic.py | 105 ++ .../vendored_sdks/elastic/_version.py | 9 + .../vendored_sdks/elastic/aio/__init__.py | 10 + .../elastic/aio/_configuration.py | 67 + .../elastic/aio/_microsoft_elastic.py | 99 ++ .../elastic/aio/operations/__init__.py | 27 + .../operations/_deployment_info_operations.py | 104 ++ .../_monitored_resources_operations.py | 120 ++ .../aio/operations/_monitors_operations.py | 569 +++++++ .../elastic/aio/operations/_operations.py | 107 ++ .../aio/operations/_tag_rules_operations.py | 384 +++++ .../operations/_vm_collection_operations.py | 111 ++ .../aio/operations/_vm_host_operations.py | 120 ++ .../operations/_vm_ingestion_operations.py | 103 ++ .../vendored_sdks/elastic/models/__init__.py | 121 ++ .../models/_microsoft_elastic_enums.py | 96 ++ .../vendored_sdks/elastic/models/_models.py | 941 ++++++++++++ .../elastic/models/_models_py3.py | 1041 +++++++++++++ .../elastic/operations/__init__.py | 27 + .../operations/_deployment_info_operations.py | 109 ++ .../_monitored_resources_operations.py | 125 ++ .../operations/_monitors_operations.py | 581 +++++++ .../elastic/operations/_operations.py | 112 ++ .../operations/_tag_rules_operations.py | 393 +++++ .../operations/_vm_collection_operations.py | 116 ++ .../elastic/operations/_vm_host_operations.py | 125 ++ .../operations/_vm_ingestion_operations.py | 108 ++ .../vendored_sdks/elastic/py.typed | 1 + src/elastic/report.md | 261 ++++ src/elastic/setup.cfg | 1 + src/elastic/setup.py | 58 + src/service_name.json | 5 + 60 files changed, 9127 insertions(+) create mode 100644 src/elastic/HISTORY.rst create mode 100644 src/elastic/README.md create mode 100644 src/elastic/azext_elastic/__init__.py create mode 100644 src/elastic/azext_elastic/_help.py create mode 100644 src/elastic/azext_elastic/action.py create mode 100644 src/elastic/azext_elastic/azext_metadata.json create mode 100644 src/elastic/azext_elastic/custom.py create mode 100644 src/elastic/azext_elastic/generated/__init__.py create mode 100644 src/elastic/azext_elastic/generated/_client_factory.py create mode 100644 src/elastic/azext_elastic/generated/_help.py create mode 100644 src/elastic/azext_elastic/generated/_params.py create mode 100644 src/elastic/azext_elastic/generated/_validators.py create mode 100644 src/elastic/azext_elastic/generated/action.py create mode 100644 src/elastic/azext_elastic/generated/commands.py create mode 100644 src/elastic/azext_elastic/generated/custom.py create mode 100644 src/elastic/azext_elastic/manual/__init__.py create mode 100644 src/elastic/azext_elastic/manual/_params.py create mode 100644 src/elastic/azext_elastic/manual/custom.py create mode 100644 src/elastic/azext_elastic/tests/__init__.py create mode 100644 src/elastic/azext_elastic/tests/latest/__init__.py create mode 100644 src/elastic/azext_elastic/tests/latest/example_steps.py create mode 100644 src/elastic/azext_elastic/tests/latest/recordings/test_elastic_Scenario.yaml create mode 100644 src/elastic/azext_elastic/tests/latest/test_elastic_scenario.py create mode 100644 src/elastic/azext_elastic/tests/latest/test_elastic_scenario_coverage.md create mode 100644 src/elastic/azext_elastic/vendored_sdks/__init__.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/__init__.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/_configuration.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/_microsoft_elastic.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/_version.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/__init__.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/_configuration.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/_microsoft_elastic.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/__init__.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_deployment_info_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitored_resources_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitors_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_tag_rules_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_collection_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_host_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_ingestion_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/models/__init__.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/models/_microsoft_elastic_enums.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/models/_models.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/models/_models_py3.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/__init__.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_deployment_info_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitored_resources_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitors_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_tag_rules_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_collection_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_host_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_ingestion_operations.py create mode 100644 src/elastic/azext_elastic/vendored_sdks/elastic/py.typed create mode 100644 src/elastic/report.md create mode 100644 src/elastic/setup.cfg create mode 100644 src/elastic/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b1a3a29b3d6..b4ce09a94c6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -207,3 +207,5 @@ /src/authV2/ @mkarmark /src/purview/ @kairu-ms @jsntcy + +/src/elastic/ @kairu-ms @jsntcy diff --git a/src/elastic/HISTORY.rst b/src/elastic/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/elastic/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/elastic/README.md b/src/elastic/README.md new file mode 100644 index 00000000000..6df5aaf89b0 --- /dev/null +++ b/src/elastic/README.md @@ -0,0 +1,77 @@ +# Azure CLI elastic Extension # +This is the extension for elastic + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name elastic +``` + +### Included Features ### +#### elastic monitor #### +##### Create ##### +``` +az elastic monitor create --monitor-name "myMonitor" --name "myMonitor" --location "West US 2" \ + --user-info "{\\"companyInfo\\":{\\"business\\":\\"Technology\\",\\"country\\":\\"US\\",\\"domain\\":\\"microsoft.com\\",\\"employeeNumber\\":\\"10000\\",\\"state\\":\\"WA\\"},\\"companyName\\":\\"Microsoft\\",\\"emailAddress\\":\\"alice@microsoft.com\\",\\"firstName\\":\\"Alice\\",\\"lastName\\":\\"Bob\\"}" \ + --sku "free_Monthly" --tags Environment="Dev" --resource-group "myResourceGroup" + +az elastic monitor wait --created --monitor-name "{myMonitor}" --resource-group "{rg}" +``` +##### Show ##### +``` +az elastic monitor show --name "myMonitor" --resource-group "myResourceGroup" +``` +##### List ##### +``` +az elastic monitor list --resource-group "myResourceGroup" +``` +##### Update ##### +``` +az elastic monitor update --name "myMonitor" --tags Environment="Dev" --resource-group "myResourceGroup" +``` +##### Delete ##### +``` +az elastic monitor delete --name "myMonitor" --resource-group "myResourceGroup" +``` +##### List Resource ##### +``` +az elastic monitor list-resource --name "myMonitor" --resource-group "myResourceGroup" +``` +##### List Deployment Info ##### +``` +az elastic monitor list-deployment-info --name "myMonitor" --resource-group "myResourceGroup" +``` +##### List VM Host ##### +``` +az elastic monitor list-vm-host --name "myMonitor" --resource-group "myResourceGroup" +``` +##### List VM Ingestion Detail ##### +``` +az elastic monitor list-vm-ingestion-detail --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Update VM Collection ##### +``` +az elastic monitor update-vm-collection --name "myMonitor" --operation-name "Add" --vm-resource-id \ +"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtual\ +machines/myVM" --resource-group "myResourceGroup" +``` +#### elastic monitor tag-rule #### +##### Create ##### +``` +az elastic monitor tag-rule create --monitor-name "myMonitor" \ + --filtering-tags name="Environment" action="Include" value="Prod" \ + --filtering-tags name="Environment" action="Exclude" value="Dev" --send-aad-logs false --send-activity-logs true \ + --send-subscription-logs true --resource-group "myResourceGroup" --rule-set-name "default" +``` +##### Show ##### +``` +az monitor elastic tag-rule show --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default" +``` +##### List ##### +``` +az monitor elastic tag-rule list --monitor-name "myMonitor" --resource-group "myResourceGroup" +``` +##### Delete ##### +``` +az monitor elastic tag-rule delete --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name "default" +``` \ No newline at end of file diff --git a/src/elastic/azext_elastic/__init__.py b/src/elastic/azext_elastic/__init__.py new file mode 100644 index 00000000000..10a2548b2f3 --- /dev/null +++ b/src/elastic/azext_elastic/__init__.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------- +# 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=unused-import + +import azext_elastic._help +from azure.cli.core import AzCommandsLoader + + +class MicrosoftElasticCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_elastic.generated._client_factory import cf_elastic_cl + elastic_custom = CliCommandType( + operations_tmpl='azext_elastic.custom#{}', + client_factory=cf_elastic_cl) + parent = super(MicrosoftElasticCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=elastic_custom) + + def load_command_table(self, args): + from azext_elastic.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_elastic.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError as e: + if e.name.endswith('manual.commands'): + pass + else: + raise e + return self.command_table + + def load_arguments(self, command): + from azext_elastic.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_elastic.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError as e: + if e.name.endswith('manual._params'): + pass + else: + raise e + + +COMMAND_LOADER_CLS = MicrosoftElasticCommandsLoader diff --git a/src/elastic/azext_elastic/_help.py b/src/elastic/azext_elastic/_help.py new file mode 100644 index 00000000000..9b93f87a6e9 --- /dev/null +++ b/src/elastic/azext_elastic/_help.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# 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 +# pylint: disable=unused-import +from .generated._help import helps # pylint: disable=reimported +try: + from .manual._help import helps # pylint: disable=reimported +except ImportError as e: + if e.name.endswith('manual._help'): + pass + else: + raise e diff --git a/src/elastic/azext_elastic/action.py b/src/elastic/azext_elastic/action.py new file mode 100644 index 00000000000..9b3d0a8a78c --- /dev/null +++ b/src/elastic/azext_elastic/action.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# 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 as e: + if e.name.endswith('manual.action'): + pass + else: + raise e diff --git a/src/elastic/azext_elastic/azext_metadata.json b/src/elastic/azext_elastic/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/elastic/azext_elastic/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/elastic/azext_elastic/custom.py b/src/elastic/azext_elastic/custom.py new file mode 100644 index 00000000000..885447229d6 --- /dev/null +++ b/src/elastic/azext_elastic/custom.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------- +# 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 as e: + if e.name.endswith('manual.custom'): + pass + else: + raise e diff --git a/src/elastic/azext_elastic/generated/__init__.py b/src/elastic/azext_elastic/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/elastic/azext_elastic/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/elastic/azext_elastic/generated/_client_factory.py b/src/elastic/azext_elastic/generated/_client_factory.py new file mode 100644 index 00000000000..704a4567ef4 --- /dev/null +++ b/src/elastic/azext_elastic/generated/_client_factory.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------- +# 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_elastic_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_elastic.vendored_sdks.elastic import MicrosoftElastic + return get_mgmt_service_client(cli_ctx, + MicrosoftElastic) + + +def cf_monitor(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).monitors + + +def cf_monitored_resource(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).monitored_resources + + +def cf_deployment_info(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).deployment_info + + +def cf_tag_rule(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).tag_rules + + +def cf_vm_host(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).vm_host + + +def cf_vm_ingestion(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).vm_ingestion + + +def cf_vm_collection(cli_ctx, *_): + return cf_elastic_cl(cli_ctx).vm_collection diff --git a/src/elastic/azext_elastic/generated/_help.py b/src/elastic/azext_elastic/generated/_help.py new file mode 100644 index 00000000000..098252c244d --- /dev/null +++ b/src/elastic/azext_elastic/generated/_help.py @@ -0,0 +1,225 @@ +# -------------------------------------------------------------------------- +# 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['elastic'] = ''' + type: group + short-summary: Manage Microsoft Elastic +''' + +helps['elastic monitor'] = """ + type: group + short-summary: Manage monitor with elastic +""" + +helps['elastic monitor list'] = """ + type: command + short-summary: "List all monitors under the specified resource group. And List all monitors under the specified \ +subscription." + examples: + - name: Monitors_ListByResourceGroup + text: |- + az elastic monitor list --resource-group "myResourceGroup" + - name: Monitors_List + text: |- + az elastic monitor list +""" + +helps['elastic monitor show'] = """ + type: command + short-summary: "Get the properties of a specific monitor resource." + examples: + - name: Monitors_Get + text: |- + az elastic monitor show --name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor create'] = """ + type: command + short-summary: "Create a monitor resource." + examples: + - name: Monitors_Create + text: |- + az elastic monitor create --name "myMonitor" --location "West US 2" --user-info \ +"{\\"companyInfo\\":{\\"business\\":\\"Technology\\",\\"country\\":\\"US\\",\\"domain\\":\\"microsoft.com\\",\\"employe\ +eNumber\\":\\"10000\\",\\"state\\":\\"WA\\"},\\"companyName\\":\\"Microsoft\\",\\"emailAddress\\":\\"alice@microsoft.co\ +m\\",\\"firstName\\":\\"Alice\\",\\"lastName\\":\\"Bob\\"}" --sku "free_Monthly" --tags Environment="Dev" \ +--resource-group "myResourceGroup" +""" + +helps['elastic monitor update'] = """ + type: command + short-summary: "Update a monitor resource." + examples: + - name: Monitors_Update + text: |- + az elastic monitor update --name "myMonitor" --tags Environment="Dev" --resource-group \ +"myResourceGroup" +""" + +helps['elastic monitor delete'] = """ + type: command + short-summary: "Delete a monitor resource." + examples: + - name: Monitors_Delete + text: |- + az elastic monitor delete --name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor list-deployment-info'] = """ + type: command + short-summary: "Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor \ +resource." + examples: + - name: DeploymentInfo_List + text: |- + az elastic monitor list-deployment-info --name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor list-resource'] = """ + type: command + short-summary: "List the resources currently being monitored by the Elastic monitor resource." + examples: + - name: MonitoredResources_List + text: |- + az elastic monitor list-resource --name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor list-vm-host'] = """ + type: command + short-summary: "List the vm resources currently being monitored by the Elastic monitor resource." + examples: + - name: VMHost_List + text: |- + az elastic monitor list-vm-host --name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor list-vm-ingestion-detail'] = """ + type: command + short-summary: "List the vm ingestion details that will be monitored by the Elastic monitor resource." + examples: + - name: VMIngestion_Details + text: |- + az elastic monitor list-vm-ingestion-detail --name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor update-vm-collection'] = """ + type: command + short-summary: "Update the vm details that will be monitored by the Elastic monitor resource." + examples: + - name: VMCollection_Update + text: |- + az elastic monitor update-vm-collection --name "myMonitor" --operation-name "Add" --vm-resource-id \ +"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtual\ +machines/myVM" --resource-group "myResourceGroup" +""" + +helps['elastic monitor wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the elastic monitor is met. + examples: + - name: Pause executing next line of CLI script until the elastic monitor is successfully created. + text: |- + az elastic monitor wait --name "myMonitor" --resource-group "myResourceGroup" --created + - name: Pause executing next line of CLI script until the elastic monitor is successfully deleted. + text: |- + az elastic monitor wait --name "myMonitor" --resource-group "myResourceGroup" --deleted +""" + +helps['elastic monitor tag-rule'] = """ + type: group + short-summary: Manage tag rule with elastic +""" + +helps['elastic monitor tag-rule list'] = """ + type: command + short-summary: "List the tag rules for a given monitor resource." + examples: + - name: TagRules_List + text: |- + az elastic monitor tag-rule list --monitor-name "myMonitor" --resource-group "myResourceGroup" +""" + +helps['elastic monitor tag-rule show'] = """ + type: command + short-summary: "Get a tag rule set for a given monitor resource." + examples: + - name: TagRules_Get + text: |- + az elastic monitor tag-rule show --monitor-name "myMonitor" --resource-group "myResourceGroup" \ +--rule-set-name "default" +""" + +helps['elastic monitor tag-rule create'] = """ + type: command + short-summary: "Create a tag rule set for a given monitor resource." + parameters: + - name: --filtering-tags + short-summary: "List of filtering tags to be used for capturing logs. This only takes effect if \ +SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the \ +rules will apply to the list of all available resources. If Include actions are specified, the rules will only include \ +resources with the associated tags." + long-summary: | + Usage: --filtering-tags name=XX value=XX action=XX + + name: The name (also known as the key) of the tag. + value: The value of the tag. + action: Valid actions for a filtering tag. + + Multiple actions can be specified by using more than one --filtering-tags argument. + examples: + - name: TagRules_CreateOrUpdate + text: |- + az elastic monitor tag-rule create --monitor-name "myMonitor" --filtering-tags name="Environment" \ +action="Include" value="Prod" --filtering-tags name="Environment" action="Exclude" value="Dev" --send-aad-logs false \ +--send-activity-logs true --send-subscription-logs true --resource-group "myResourceGroup" --rule-set-name "default" +""" + +helps['elastic monitor tag-rule update'] = """ + type: command + short-summary: "Update a tag rule set for a given monitor resource." + parameters: + - name: --filtering-tags + short-summary: "List of filtering tags to be used for capturing logs. This only takes effect if \ +SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the \ +rules will apply to the list of all available resources. If Include actions are specified, the rules will only include \ +resources with the associated tags." + long-summary: | + Usage: --filtering-tags name=XX value=XX action=XX + + name: The name (also known as the key) of the tag. + value: The value of the tag. + action: Valid actions for a filtering tag. + + Multiple actions can be specified by using more than one --filtering-tags argument. +""" + +helps['elastic monitor tag-rule delete'] = """ + type: command + short-summary: "Delete a tag rule set for a given monitor resource." + examples: + - name: TagRules_Delete + text: |- + az elastic monitor tag-rule delete --monitor-name "myMonitor" --resource-group "myResourceGroup" \ +--rule-set-name "default" +""" + +helps['elastic monitor tag-rule wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the elastic monitor tag-rule is met. + examples: + - name: Pause executing next line of CLI script until the elastic monitor tag-rule is successfully deleted. + text: |- + az elastic monitor tag-rule wait --monitor-name "myMonitor" --resource-group "myResourceGroup" \ +--rule-set-name "default" --deleted +""" diff --git a/src/elastic/azext_elastic/generated/_params.py b/src/elastic/azext_elastic/generated/_params.py new file mode 100644 index 00000000000..dfefde92b20 --- /dev/null +++ b/src/elastic/azext_elastic/generated/_params.py @@ -0,0 +1,158 @@ +# -------------------------------------------------------------------------- +# 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 ( + tags_type, + get_three_state_flag, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_elastic.action import AddFilteringTags + + +def load_arguments(self, _): + + with self.argument_context('elastic monitor list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('elastic monitor show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name', id_part='name') + + with self.argument_context('elastic monitor create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('provisioning_state', arg_type=get_enum_type(['Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'NotSpecified']), help='Provisioning state of the ' + 'monitor resource.') + c.argument('monitoring_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Flag specifying if the ' + 'resource monitoring is enabled or disabled.') + c.argument('elastic_properties', type=validate_file_or_dict, help='Elastic cloud properties. Expected value: ' + 'json-string/json-file/@json-file.') + c.argument('user_info', type=validate_file_or_dict, help='User information. Expected value: ' + 'json-string/json-file/@json-file.') + c.argument('sku', type=str, help='Name of the SKU.', arg_group='Sku') + + with self.argument_context('elastic monitor update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('elastic monitor delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name', id_part='name') + + with self.argument_context('elastic monitor list-deployment-info') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name') + + with self.argument_context('elastic monitor list-resource') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name') + + with self.argument_context('elastic monitor list-vm-host') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name') + + with self.argument_context('elastic monitor list-vm-ingestion-detail') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name') + + with self.argument_context('elastic monitor update-vm-collection') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name', id_part='name') + c.argument('vm_resource_id', type=str, help='ARM id of the VM resource.') + c.argument('operation_name', arg_type=get_enum_type(['Add', 'Delete']), help='Operation to be performed for ' + 'given VM.') + + with self.argument_context('elastic monitor wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource ' + 'name', id_part='name') + + with self.argument_context('elastic monitor tag-rule list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', type=str, help='Monitor resource name') + + with self.argument_context('elastic monitor tag-rule show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', type=str, help='Monitor resource name', id_part='name') + c.argument('rule_set_name', type=str, help='Tag Rule Set resource name', id_part='child_name_1') + + with self.argument_context('elastic monitor tag-rule create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', type=str, help='Monitor resource name') + c.argument('rule_set_name', type=str, help='Tag Rule Set resource name') + c.argument('provisioning_state', arg_type=get_enum_type(['Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'NotSpecified']), help='Provisioning state of the ' + 'monitoring tag rules.') + c.argument('send_aad_logs', arg_type=get_three_state_flag(), help='Flag specifying if AAD logs should be sent ' + 'for the Monitor resource.', arg_group='Log Rules') + c.argument('send_subscription_logs', arg_type=get_three_state_flag(), help='Flag specifying if subscription ' + 'logs should be sent for the Monitor resource.', arg_group='Log Rules') + c.argument('send_activity_logs', arg_type=get_three_state_flag(), help='Flag specifying if activity logs from ' + 'Azure resources should be sent for the Monitor resource.', arg_group='Log Rules') + c.argument('filtering_tags', action=AddFilteringTags, nargs='+', help='List of filtering tags to be used for ' + 'capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all ' + 'resources will be captured. If only Exclude action is specified, the rules will apply to the list ' + 'of all available resources. If Include actions are specified, the rules will only include ' + 'resources with the associated tags.', arg_group='Log Rules') + + with self.argument_context('elastic monitor tag-rule update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', type=str, help='Monitor resource name', id_part='name') + c.argument('rule_set_name', type=str, help='Tag Rule Set resource name', id_part='child_name_1') + c.argument('provisioning_state', arg_type=get_enum_type(['Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', + 'NotSpecified']), help='Provisioning state of the ' + 'monitoring tag rules.') + c.argument('send_aad_logs', arg_type=get_three_state_flag(), help='Flag specifying if AAD logs should be sent ' + 'for the Monitor resource.', arg_group='Log Rules') + c.argument('send_subscription_logs', arg_type=get_three_state_flag(), help='Flag specifying if subscription ' + 'logs should be sent for the Monitor resource.', arg_group='Log Rules') + c.argument('send_activity_logs', arg_type=get_three_state_flag(), help='Flag specifying if activity logs from ' + 'Azure resources should be sent for the Monitor resource.', arg_group='Log Rules') + c.argument('filtering_tags', action=AddFilteringTags, nargs='+', help='List of filtering tags to be used for ' + 'capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all ' + 'resources will be captured. If only Exclude action is specified, the rules will apply to the list ' + 'of all available resources. If Include actions are specified, the rules will only include ' + 'resources with the associated tags.', arg_group='Log Rules') + c.ignore('body') + + with self.argument_context('elastic monitor tag-rule delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', type=str, help='Monitor resource name', id_part='name') + c.argument('rule_set_name', type=str, help='Tag Rule Set resource name', id_part='child_name_1') + + with self.argument_context('elastic monitor tag-rule wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('monitor_name', type=str, help='Monitor resource name', id_part='name') + c.argument('rule_set_name', type=str, help='Tag Rule Set resource name', id_part='child_name_1') diff --git a/src/elastic/azext_elastic/generated/_validators.py b/src/elastic/azext_elastic/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/elastic/azext_elastic/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/elastic/azext_elastic/generated/action.py b/src/elastic/azext_elastic/generated/action.py new file mode 100644 index 00000000000..cc5041ddbda --- /dev/null +++ b/src/elastic/azext_elastic/generated/action.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=protected-access + +# pylint: disable=no-self-use + + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddFilteringTags(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddFilteringTags, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): + 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 CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + + if kl == 'name': + d['name'] = v[0] + + elif kl == 'value': + d['value'] = v[0] + + elif kl == 'action': + d['action'] = v[0] + + else: + raise CLIError( + 'Unsupported Key {} is provided for parameter filtering-tags. All possible keys are: name, value,' + ' action'.format(k) + ) + + return d diff --git a/src/elastic/azext_elastic/generated/commands.py b/src/elastic/azext_elastic/generated/commands.py new file mode 100644 index 00000000000..a00bb3ce2fa --- /dev/null +++ b/src/elastic/azext_elastic/generated/commands.py @@ -0,0 +1,69 @@ +# -------------------------------------------------------------------------- +# 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 +# pylint: disable=bad-continuation +# pylint: disable=line-too-long + +from azure.cli.core.commands import CliCommandType +from azext_elastic.generated._client_factory import ( + cf_monitor, + cf_monitored_resource, + cf_deployment_info, + cf_tag_rule, + cf_vm_host, + cf_vm_ingestion, + cf_vm_collection, +) + + +elastic_monitor = CliCommandType( + operations_tmpl='azext_elastic.vendored_sdks.elastic.operations._monitors_operations#MonitorsOperations.{}', + client_factory=cf_monitor, +) + + +elastic_tag_rule = CliCommandType( + operations_tmpl='azext_elastic.vendored_sdks.elastic.operations._tag_rules_operations#TagRulesOperations.{}', + client_factory=cf_tag_rule, +) + + +def load_command_table(self, _): + + with self.command_group('elastic monitor', elastic_monitor, client_factory=cf_monitor) as g: + g.custom_command('list', 'elastic_monitor_list') + g.custom_show_command('show', 'elastic_monitor_show') + g.custom_command('create', 'elastic_monitor_create', supports_no_wait=True) + g.custom_command('update', 'elastic_monitor_update') + g.custom_command('delete', 'elastic_monitor_delete', supports_no_wait=True, confirmation=True) + g.custom_command( + 'list-deployment-info', 'elastic_monitor_list_deployment_info', client_factory=cf_deployment_info + ) + g.custom_command('list-resource', 'elastic_monitor_list_resource', client_factory=cf_monitored_resource) + g.custom_command('list-vm-host', 'elastic_monitor_list_vm_host', client_factory=cf_vm_host) + g.custom_command( + 'list-vm-ingestion-detail', 'elastic_monitor_list_vm_ingestion_detail', client_factory=cf_vm_ingestion + ) + g.custom_command( + 'update-vm-collection', 'elastic_monitor_update_vm_collection', client_factory=cf_vm_collection + ) + g.custom_wait_command('wait', 'elastic_monitor_show') + + with self.command_group('elastic monitor tag-rule', elastic_tag_rule, client_factory=cf_tag_rule) as g: + g.custom_command('list', 'elastic_monitor_tag_rule_list') + g.custom_show_command('show', 'elastic_monitor_tag_rule_show') + g.custom_command('create', 'elastic_monitor_tag_rule_create') + g.generic_update_command('update', custom_func_name='elastic_monitor_tag_rule_update', setter_arg_name='body') + g.custom_command('delete', 'elastic_monitor_tag_rule_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'elastic_monitor_tag_rule_show') + + with self.command_group('elastic', is_experimental=True): + pass diff --git a/src/elastic/azext_elastic/generated/custom.py b/src/elastic/azext_elastic/generated/custom.py new file mode 100644 index 00000000000..5bcc1f42648 --- /dev/null +++ b/src/elastic/azext_elastic/generated/custom.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + +from azure.cli.core.util import sdk_no_wait + + +def elastic_monitor_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() + + +def elastic_monitor_show(client, + resource_group_name, + monitor_name): + return client.get(resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_create(client, + resource_group_name, + monitor_name, + location, + tags=None, + provisioning_state=None, + monitoring_status=None, + elastic_properties=None, + user_info=None, + sku=None, + no_wait=False): + body = {} + if tags is not None: + body['tags'] = tags + body['location'] = location + body['identity'] = {} + body['identity']['type'] = "SystemAssigned" + if len(body['identity']) == 0: + del body['identity'] + body['properties'] = {} + if provisioning_state is not None: + body['properties']['provisioning_state'] = provisioning_state + if monitoring_status is not None: + body['properties']['monitoring_status'] = monitoring_status + if elastic_properties is not None: + body['properties']['elastic_properties'] = elastic_properties + if user_info is not None: + body['properties']['user_info'] = user_info + if len(body['properties']) == 0: + del body['properties'] + body['sku'] = {} + if sku is not None: + body['sku']['name'] = sku + if len(body['sku']) == 0: + del body['sku'] + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body) + + +def elastic_monitor_update(client, + resource_group_name, + monitor_name, + tags=None): + body = {} + if tags is not None: + body['tags'] = tags + return client.update(resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body) + + +def elastic_monitor_delete(client, + resource_group_name, + monitor_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_list_deployment_info(client, + resource_group_name, + monitor_name): + return client.list(resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_list_resource(client, + resource_group_name, + monitor_name): + return client.list(resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_list_vm_host(client, + resource_group_name, + monitor_name): + return client.list(resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_list_vm_ingestion_detail(client, + resource_group_name, + monitor_name): + return client.details(resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_update_vm_collection(client, + resource_group_name, + monitor_name, + vm_resource_id=None, + operation_name=None): + body = {} + if vm_resource_id is not None: + body['vm_resource_id'] = vm_resource_id + if operation_name is not None: + body['operation_name'] = operation_name + return client.update(resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body) + + +def elastic_monitor_tag_rule_list(client, + resource_group_name, + monitor_name): + return client.list(resource_group_name=resource_group_name, + monitor_name=monitor_name) + + +def elastic_monitor_tag_rule_show(client, + resource_group_name, + monitor_name, + rule_set_name): + return client.get(resource_group_name=resource_group_name, + monitor_name=monitor_name, + rule_set_name=rule_set_name) + + +def elastic_monitor_tag_rule_create(client, + resource_group_name, + monitor_name, + rule_set_name, + provisioning_state=None, + send_aad_logs=None, + send_subscription_logs=None, + send_activity_logs=None, + filtering_tags=None): + body = {} + body['properties'] = {} + if provisioning_state is not None: + body['properties']['provisioning_state'] = provisioning_state + body['properties']['log_rules'] = {} + if send_aad_logs is not None: + body['properties']['log_rules']['send_aad_logs'] = send_aad_logs + if send_subscription_logs is not None: + body['properties']['log_rules']['send_subscription_logs'] = send_subscription_logs + if send_activity_logs is not None: + body['properties']['log_rules']['send_activity_logs'] = send_activity_logs + if filtering_tags is not None: + body['properties']['log_rules']['filtering_tags'] = filtering_tags + if len(body['properties']['log_rules']) == 0: + del body['properties']['log_rules'] + return client.create_or_update(resource_group_name=resource_group_name, + monitor_name=monitor_name, + rule_set_name=rule_set_name, + body=body) + + +def elastic_monitor_tag_rule_update(instance, + resource_group_name, + monitor_name, + rule_set_name, + provisioning_state=None, + send_aad_logs=None, + send_subscription_logs=None, + send_activity_logs=None, + filtering_tags=None): + if provisioning_state is not None: + instance.properties.provisioning_state = provisioning_state + if send_aad_logs is not None: + instance.properties.log_rules.send_aad_logs = send_aad_logs + if send_subscription_logs is not None: + instance.properties.log_rules.send_subscription_logs = send_subscription_logs + if send_activity_logs is not None: + instance.properties.log_rules.send_activity_logs = send_activity_logs + if filtering_tags is not None: + instance.properties.log_rules.filtering_tags = filtering_tags + return instance + + +def elastic_monitor_tag_rule_delete(client, + resource_group_name, + monitor_name, + rule_set_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + monitor_name=monitor_name, + rule_set_name=rule_set_name) diff --git a/src/elastic/azext_elastic/manual/__init__.py b/src/elastic/azext_elastic/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/elastic/azext_elastic/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/elastic/azext_elastic/manual/_params.py b/src/elastic/azext_elastic/manual/_params.py new file mode 100644 index 00000000000..e694f374e03 --- /dev/null +++ b/src/elastic/azext_elastic/manual/_params.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=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): + + with self.argument_context('elastic monitor create') as c: + c.argument('identity', type=str, help='Identity of the monitor.') diff --git a/src/elastic/azext_elastic/manual/custom.py b/src/elastic/azext_elastic/manual/custom.py new file mode 100644 index 00000000000..5b09f399175 --- /dev/null +++ b/src/elastic/azext_elastic/manual/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 +# pylint: disable=unused-argument + +from azure.cli.core.util import sdk_no_wait + + +def elastic_monitor_create(client, + resource_group_name, + monitor_name, + location, + tags=None, + provisioning_state=None, + monitoring_status=None, + elastic_properties=None, + user_info=None, + sku=None, + identity=None, + no_wait=False): + body = {} + if tags is not None: + body['tags'] = tags + body['location'] = location + body['properties'] = {} + if identity is not None: + body['identity'] = {} + body['identity']['type'] = identity + if provisioning_state is not None: + body['properties']['provisioning_state'] = provisioning_state + if monitoring_status is not None: + body['properties']['monitoring_status'] = monitoring_status + if elastic_properties is not None: + body['properties']['elastic_properties'] = elastic_properties + if user_info is not None: + body['properties']['user_info'] = user_info + if len(body['properties']) == 0: + del body['properties'] + body['sku'] = {} + if sku is not None: + body['sku']['name'] = sku + if len(body['sku']) == 0: + del body['sku'] + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body) diff --git a/src/elastic/azext_elastic/tests/__init__.py b/src/elastic/azext_elastic/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/elastic/azext_elastic/tests/__init__.py @@ -0,0 +1,116 @@ +# 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).lower() + module_path = __path__[0].lower() + 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) + 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: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + 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/elastic/azext_elastic/tests/latest/__init__.py b/src/elastic/azext_elastic/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/elastic/azext_elastic/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/elastic/azext_elastic/tests/latest/example_steps.py b/src/elastic/azext_elastic/tests/latest/example_steps.py new file mode 100644 index 00000000000..c02aab790f2 --- /dev/null +++ b/src/elastic/azext_elastic/tests/latest/example_steps.py @@ -0,0 +1,199 @@ +# -------------------------------------------------------------------------- +# 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: /Monitors/put/Monitors_Create +@try_manual +def step_monitor_create(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor create ' + '--name "{myMonitor}" ' + '--location "West US 2" ' + '--user-info "{{\\"companyInfo\\":{{\\"business\\":\\"Technology\\",\\"country\\":\\"US\\",\\"domain\\":\\' + '"microsoft.com\\",\\"employeeNumber\\":\\"10000\\",\\"state\\":\\"WA\\"}},\\"companyName\\":\\"Microsoft' + '\\",\\"emailAddress\\":\\"alice@microsoft.com\\",\\"firstName\\":\\"Alice\\",\\"lastName\\":\\"Bob\\"}}" ' + '' + '--sku "ess-monthly-consumption_Monthly" ' + '--tags Environment="Dev" ' + '--resource-group "{rg}"', + checks=checks) + + test.cmd('az elastic monitor wait --created ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Monitors/get/Monitors_Get +@try_manual +def step_monitor_show(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor show ' + '--name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Monitors/get/Monitors_List +@try_manual +def step_monitor_list(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /Monitors/get/Monitors_ListByResourceGroup +@try_manual +def step_monitor_list2(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Monitors/patch/Monitors_Update +@try_manual +def step_monitor_update(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor update ' + '--name "{myMonitor}" ' + '--tags Environment="Dev" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /DeploymentInfo/post/DeploymentInfo_List +@try_manual +def step_deployment_info_list(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor list-deployment-info ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /MonitoredResources/post/MonitoredResources_List +@try_manual +def step_monitored_resource_list(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor list-resource ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /TagRules/put/TagRules_CreateOrUpdate +@try_manual +def step_tag_rule_create(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor tag-rule create ' + '--monitor-name "{myMonitor}" ' + '--filtering-tags name="Environment" action="Include" value="Prod" ' + '--filtering-tags name="Environment" action="Exclude" value="Dev" ' + '--send-aad-logs false ' + '--send-activity-logs true ' + '--send-subscription-logs true ' + '--resource-group "{rg}" ' + '--rule-set-name "default"', + checks=checks) + + +# EXAMPLE: /TagRules/get/TagRules_Get +@try_manual +def step_tag_rule_show(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor tag-rule show ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}" ' + '--rule-set-name "default"', + checks=checks) + + +# EXAMPLE: /TagRules/get/TagRules_List +@try_manual +def step_tag_rule_list(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor tag-rule list ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /TagRules/delete/TagRules_Delete +@try_manual +def step_tag_rule_delete(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor tag-rule delete -y ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}" ' + '--rule-set-name "default"', + checks=checks) + + +# EXAMPLE: /VMCollection/post/VMCollection_Update +@try_manual +def step_vm_collection_update(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor update-vm-collection ' + '--monitor-name "{myMonitor}" ' + '--operation-name "Add" ' + '--vm-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Compute/virtua' + 'lmachines/myVM" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VMHost/post/VMHost_List +@try_manual +def step_vm_host_list(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor list-vm-host ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VMIngestion/post/VMIngestion_Details +@try_manual +def step_vm_ingestion_detail(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor list-vm-ingestion-detail ' + '--monitor-name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Monitors/delete/Monitors_Delete +@try_manual +def step_monitor_delete(test, checks=None): + if checks is None: + checks = [] + test.cmd('az elastic monitor delete -y ' + '--name "{myMonitor}" ' + '--resource-group "{rg}"', + checks=checks) diff --git a/src/elastic/azext_elastic/tests/latest/recordings/test_elastic_Scenario.yaml b/src/elastic/azext_elastic/tests/latest/recordings/test_elastic_Scenario.yaml new file mode 100644 index 00000000000..22900ea3eb9 --- /dev/null +++ b/src/elastic/azext_elastic/tests/latest/recordings/test_elastic_Scenario.yaml @@ -0,0 +1,1343 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account list + Connection: + - keep-alive + ParameterSetName: + - --query -o + User-Agent: + - AZURECLI/2.28.0 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 + response: + body: + string: "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\",\"name\":\"eastus\",\"displayName\":\"East + US\",\"regionalDisplayName\":\"(US) East US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\",\"name\":\"eastus2\",\"displayName\":\"East + US 2\",\"regionalDisplayName\":\"(US) East US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"centralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\",\"name\":\"southcentralus\",\"displayName\":\"South + Central US\",\"regionalDisplayName\":\"(US) South Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"northcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\",\"name\":\"westus2\",\"displayName\":\"West + US 2\",\"regionalDisplayName\":\"(US) West US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-119.852\",\"latitude\":\"47.233\",\"physicalLocation\":\"Washington\",\"pairedRegion\":[{\"name\":\"westcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus3\",\"name\":\"westus3\",\"displayName\":\"West + US 3\",\"regionalDisplayName\":\"(US) West US 3\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-112.074036\",\"latitude\":\"33.448376\",\"physicalLocation\":\"Phoenix\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\",\"name\":\"australiaeast\",\"displayName\":\"Australia + East\",\"regionalDisplayName\":\"(Asia Pacific) Australia East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"151.2094\",\"latitude\":\"-33.86\",\"physicalLocation\":\"New + South Wales\",\"pairedRegion\":[{\"name\":\"australiasoutheast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\",\"name\":\"southeastasia\",\"displayName\":\"Southeast + Asia\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"103.833\",\"latitude\":\"1.283\",\"physicalLocation\":\"Singapore\",\"pairedRegion\":[{\"name\":\"eastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\",\"name\":\"northeurope\",\"displayName\":\"North + Europe\",\"regionalDisplayName\":\"(Europe) North Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-6.2597\",\"latitude\":\"53.3478\",\"physicalLocation\":\"Ireland\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\",\"name\":\"swedencentral\",\"displayName\":\"Sweden + Central\",\"regionalDisplayName\":\"(Europe) Sweden Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"17.14127\",\"latitude\":\"60.67488\",\"physicalLocation\":\"G\xE4vle\",\"pairedRegion\":[{\"name\":\"swedensouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\",\"name\":\"uksouth\",\"displayName\":\"UK + South\",\"regionalDisplayName\":\"(Europe) UK South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-0.799\",\"latitude\":\"50.941\",\"physicalLocation\":\"London\",\"pairedRegion\":[{\"name\":\"ukwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\",\"name\":\"westeurope\",\"displayName\":\"West + Europe\",\"regionalDisplayName\":\"(Europe) West Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"4.9\",\"latitude\":\"52.3667\",\"physicalLocation\":\"Netherlands\",\"pairedRegion\":[{\"name\":\"northeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\",\"name\":\"centralus\",\"displayName\":\"Central + US\",\"regionalDisplayName\":\"(US) Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\":\"41.5908\",\"physicalLocation\":\"Iowa\",\"pairedRegion\":[{\"name\":\"eastus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North + Central US\",\"regionalDisplayName\":\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\":\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\",\"name\":\"westus\",\"displayName\":\"West + US\",\"regionalDisplayName\":\"(US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\":\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\",\"name\":\"southafricanorth\",\"displayName\":\"South + Africa North\",\"regionalDisplayName\":\"(Africa) South Africa North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Africa\",\"longitude\":\"28.218370\",\"latitude\":\"-25.731340\",\"physicalLocation\":\"Johannesburg\",\"pairedRegion\":[{\"name\":\"southafricawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\",\"name\":\"centralindia\",\"displayName\":\"Central + India\",\"regionalDisplayName\":\"(Asia Pacific) Central India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"73.9197\",\"latitude\":\"18.5822\",\"physicalLocation\":\"Pune\",\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\",\"name\":\"eastasia\",\"displayName\":\"East + Asia\",\"regionalDisplayName\":\"(Asia Pacific) East Asia\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"114.188\",\"latitude\":\"22.267\",\"physicalLocation\":\"Hong + Kong\",\"pairedRegion\":[{\"name\":\"southeastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\",\"name\":\"japaneast\",\"displayName\":\"Japan + East\",\"regionalDisplayName\":\"(Asia Pacific) Japan East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"139.77\",\"latitude\":\"35.68\",\"physicalLocation\":\"Tokyo, + Saitama\",\"pairedRegion\":[{\"name\":\"japanwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\",\"name\":\"jioindiawest\",\"displayName\":\"Jio + India West\",\"regionalDisplayName\":\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"70.05773\",\"latitude\":\"22.470701\",\"physicalLocation\":\"Jamnagar\",\"pairedRegion\":[{\"name\":\"jioindiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\",\"name\":\"koreacentral\",\"displayName\":\"Korea + Central\",\"regionalDisplayName\":\"(Asia Pacific) Korea Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"126.9780\",\"latitude\":\"37.5665\",\"physicalLocation\":\"Seoul\",\"pairedRegion\":[{\"name\":\"koreasouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\",\"name\":\"canadacentral\",\"displayName\":\"Canada + Central\",\"regionalDisplayName\":\"(Canada) Canada Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Canada\",\"longitude\":\"-79.383\",\"latitude\":\"43.653\",\"physicalLocation\":\"Toronto\",\"pairedRegion\":[{\"name\":\"canadaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\",\"name\":\"francecentral\",\"displayName\":\"France + Central\",\"regionalDisplayName\":\"(Europe) France Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.3730\",\"latitude\":\"46.3772\",\"physicalLocation\":\"Paris\",\"pairedRegion\":[{\"name\":\"francesouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\",\"name\":\"germanywestcentral\",\"displayName\":\"Germany + West Central\",\"regionalDisplayName\":\"(Europe) Germany West Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.682127\",\"latitude\":\"50.110924\",\"physicalLocation\":\"Frankfurt\",\"pairedRegion\":[{\"name\":\"germanynorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\",\"name\":\"norwayeast\",\"displayName\":\"Norway + East\",\"regionalDisplayName\":\"(Europe) Norway East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"10.752245\",\"latitude\":\"59.913868\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\":\"norwaywest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\",\"name\":\"switzerlandnorth\",\"displayName\":\"Switzerland + North\",\"regionalDisplayName\":\"(Europe) Switzerland North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.564572\",\"latitude\":\"47.451542\",\"physicalLocation\":\"Zurich\",\"pairedRegion\":[{\"name\":\"switzerlandwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\",\"name\":\"uaenorth\",\"displayName\":\"UAE + North\",\"regionalDisplayName\":\"(Middle East) UAE North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"55.316666\",\"latitude\":\"25.266666\",\"physicalLocation\":\"Dubai\",\"pairedRegion\":[{\"name\":\"uaecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\",\"name\":\"brazilsouth\",\"displayName\":\"Brazil + South\",\"regionalDisplayName\":\"(South America) Brazil South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"South + America\",\"longitude\":\"-46.633\",\"latitude\":\"-23.55\",\"physicalLocation\":\"Sao + Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central + US (Stage)\",\"regionalDisplayName\":\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\",\"name\":\"eastusstage\",\"displayName\":\"East + US (Stage)\",\"regionalDisplayName\":\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\",\"name\":\"eastus2stage\",\"displayName\":\"East + US 2 (Stage)\",\"regionalDisplayName\":\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\",\"name\":\"northcentralusstage\",\"displayName\":\"North + Central US (Stage)\",\"regionalDisplayName\":\"(US) North Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstage\",\"name\":\"southcentralusstage\",\"displayName\":\"South + Central US (Stage)\",\"regionalDisplayName\":\"(US) South Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westusstage\",\"name\":\"westusstage\",\"displayName\":\"West + US (Stage)\",\"regionalDisplayName\":\"(US) West US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2stage\",\"name\":\"westus2stage\",\"displayName\":\"West + US 2 (Stage)\",\"regionalDisplayName\":\"(US) West US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asia\",\"name\":\"asia\",\"displayName\":\"Asia\",\"regionalDisplayName\":\"Asia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asiapacific\",\"name\":\"asiapacific\",\"displayName\":\"Asia + Pacific\",\"regionalDisplayName\":\"Asia Pacific\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australia\",\"name\":\"australia\",\"displayName\":\"Australia\",\"regionalDisplayName\":\"Australia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazil\",\"name\":\"brazil\",\"displayName\":\"Brazil\",\"regionalDisplayName\":\"Brazil\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canada\",\"name\":\"canada\",\"displayName\":\"Canada\",\"regionalDisplayName\":\"Canada\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/europe\",\"name\":\"europe\",\"displayName\":\"Europe\",\"regionalDisplayName\":\"Europe\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/france\",\"name\":\"france\",\"displayName\":\"France\",\"regionalDisplayName\":\"France\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germany\",\"name\":\"germany\",\"displayName\":\"Germany\",\"regionalDisplayName\":\"Germany\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/global\",\"name\":\"global\",\"displayName\":\"Global\",\"regionalDisplayName\":\"Global\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/india\",\"name\":\"india\",\"displayName\":\"India\",\"regionalDisplayName\":\"India\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japan\",\"name\":\"japan\",\"displayName\":\"Japan\",\"regionalDisplayName\":\"Japan\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/korea\",\"name\":\"korea\",\"displayName\":\"Korea\",\"regionalDisplayName\":\"Korea\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norway\",\"name\":\"norway\",\"displayName\":\"Norway\",\"regionalDisplayName\":\"Norway\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafrica\",\"name\":\"southafrica\",\"displayName\":\"South + Africa\",\"regionalDisplayName\":\"South Africa\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerland\",\"name\":\"switzerland\",\"displayName\":\"Switzerland\",\"regionalDisplayName\":\"Switzerland\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uae\",\"name\":\"uae\",\"displayName\":\"United + Arab Emirates\",\"regionalDisplayName\":\"United Arab Emirates\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uk\",\"name\":\"uk\",\"displayName\":\"United + Kingdom\",\"regionalDisplayName\":\"United Kingdom\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstates\",\"name\":\"unitedstates\",\"displayName\":\"United + States\",\"regionalDisplayName\":\"United States\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasiastage\",\"name\":\"eastasiastage\",\"displayName\":\"East + Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) East Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\",\"name\":\"southeastasiastage\",\"displayName\":\"Southeast + Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\",\"name\":\"centraluseuap\",\"displayName\":\"Central + US EUAP\",\"regionalDisplayName\":\"(US) Central US EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\":\"41.5908\",\"pairedRegion\":[{\"name\":\"eastus2euap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\",\"name\":\"eastus2euap\",\"displayName\":\"East + US 2 EUAP\",\"regionalDisplayName\":\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"pairedRegion\":[{\"name\":\"centraluseuap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\",\"name\":\"westcentralus\",\"displayName\":\"West + Central US\",\"regionalDisplayName\":\"(US) West Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-110.234\",\"latitude\":\"40.890\",\"physicalLocation\":\"Wyoming\",\"pairedRegion\":[{\"name\":\"westus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\",\"name\":\"southafricawest\",\"displayName\":\"South + Africa West\",\"regionalDisplayName\":\"(Africa) South Africa West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Africa\",\"longitude\":\"18.843266\",\"latitude\":\"-34.075691\",\"physicalLocation\":\"Cape + Town\",\"pairedRegion\":[{\"name\":\"southafricanorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\",\"name\":\"australiacentral\",\"displayName\":\"Australia + Central\",\"regionalDisplayName\":\"(Asia Pacific) Australia Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\",\"name\":\"australiacentral2\",\"displayName\":\"Australia + Central 2\",\"regionalDisplayName\":\"(Asia Pacific) Australia Central 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\",\"name\":\"australiasoutheast\",\"displayName\":\"Australia + Southeast\",\"regionalDisplayName\":\"(Asia Pacific) Australia Southeast\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"144.9631\",\"latitude\":\"-37.8136\",\"physicalLocation\":\"Victoria\",\"pairedRegion\":[{\"name\":\"australiaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\",\"name\":\"japanwest\",\"displayName\":\"Japan + West\",\"regionalDisplayName\":\"(Asia Pacific) Japan West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"135.5022\",\"latitude\":\"34.6939\",\"physicalLocation\":\"Osaka\",\"pairedRegion\":[{\"name\":\"japaneast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\",\"name\":\"jioindiacentral\",\"displayName\":\"Jio + India Central\",\"regionalDisplayName\":\"(Asia Pacific) Jio India Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"79.08886\",\"latitude\":\"21.146633\",\"physicalLocation\":\"Nagpur\",\"pairedRegion\":[{\"name\":\"jioindiawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\",\"name\":\"koreasouth\",\"displayName\":\"Korea + South\",\"regionalDisplayName\":\"(Asia Pacific) Korea South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"129.0756\",\"latitude\":\"35.1796\",\"physicalLocation\":\"Busan\",\"pairedRegion\":[{\"name\":\"koreacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\",\"name\":\"southindia\",\"displayName\":\"South + India\",\"regionalDisplayName\":\"(Asia Pacific) South India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"80.1636\",\"latitude\":\"12.9822\",\"physicalLocation\":\"Chennai\",\"pairedRegion\":[{\"name\":\"centralindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia\",\"name\":\"westindia\",\"displayName\":\"West + India\",\"regionalDisplayName\":\"(Asia Pacific) West India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"72.868\",\"latitude\":\"19.088\",\"physicalLocation\":\"Mumbai\",\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\",\"name\":\"canadaeast\",\"displayName\":\"Canada + East\",\"regionalDisplayName\":\"(Canada) Canada East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Canada\",\"longitude\":\"-71.217\",\"latitude\":\"46.817\",\"physicalLocation\":\"Quebec\",\"pairedRegion\":[{\"name\":\"canadacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\",\"name\":\"francesouth\",\"displayName\":\"France + South\",\"regionalDisplayName\":\"(Europe) France South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.1972\",\"latitude\":\"43.8345\",\"physicalLocation\":\"Marseille\",\"pairedRegion\":[{\"name\":\"francecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\",\"name\":\"germanynorth\",\"displayName\":\"Germany + North\",\"regionalDisplayName\":\"(Europe) Germany North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.806422\",\"latitude\":\"53.073635\",\"physicalLocation\":\"Berlin\",\"pairedRegion\":[{\"name\":\"germanywestcentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\",\"name\":\"norwaywest\",\"displayName\":\"Norway + West\",\"regionalDisplayName\":\"(Europe) Norway West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"5.733107\",\"latitude\":\"58.969975\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\":\"norwayeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\",\"name\":\"switzerlandwest\",\"displayName\":\"Switzerland + West\",\"regionalDisplayName\":\"(Europe) Switzerland West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"6.143158\",\"latitude\":\"46.204391\",\"physicalLocation\":\"Geneva\",\"pairedRegion\":[{\"name\":\"switzerlandnorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\",\"name\":\"ukwest\",\"displayName\":\"UK + West\",\"regionalDisplayName\":\"(Europe) UK West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"-3.084\",\"latitude\":\"53.427\",\"physicalLocation\":\"Cardiff\",\"pairedRegion\":[{\"name\":\"uksouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\",\"name\":\"uaecentral\",\"displayName\":\"UAE + Central\",\"regionalDisplayName\":\"(Middle East) UAE Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"54.366669\",\"latitude\":\"24.466667\",\"physicalLocation\":\"Abu + Dhabi\",\"pairedRegion\":[{\"name\":\"uaenorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\",\"name\":\"brazilsoutheast\",\"displayName\":\"Brazil + Southeast\",\"regionalDisplayName\":\"(South America) Brazil Southeast\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"South + America\",\"longitude\":\"-43.2075\",\"latitude\":\"-22.90278\",\"physicalLocation\":\"Rio\",\"pairedRegion\":[{\"name\":\"brazilsouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"}]}}]}" + headers: + cache-control: + - no-cache + content-length: + - '28530' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 07:59:03 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: '{"sku": {"name": "ess-monthly-consumption_Monthly"}, "properties": {"userInfo": + {"firstName": "Alice", "lastName": "Bob", "companyName": "Microsoft", "emailAddress": + "alice@microsoft.com", "companyInfo": {"domain": "microsoft.com", "business": + "Technology", "state": "WA", "country": "US"}}}, "tags": {"Environment": "Dev"}, + "location": "westus2"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + Content-Length: + - '347' + Content-Type: + - application/json + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"v-kaisun@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-27T07:59:08.3604372Z"},"properties":{"provisioningState":"Accepted","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + cache-control: + - no-cache + content-length: + - '821' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 07:59:16 GMT + etag: + - '"3800f7b0-0000-0800-0000-615179d30000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Accepted","startTime":"2021-09-27T07:59:14.5122186Z"}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 07:59:46 GMT + etag: + - '"53006a19-0000-0800-0000-615179d20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Accepted","startTime":"2021-09-27T07:59:14.5122186Z"}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:00:16 GMT + etag: + - '"53006a19-0000-0800-0000-615179d20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Accepted","startTime":"2021-09-27T07:59:14.5122186Z"}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:00:46 GMT + etag: + - '"53006a19-0000-0800-0000-615179d20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Accepted","startTime":"2021-09-27T07:59:14.5122186Z"}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:01:17 GMT + etag: + - '"53006a19-0000-0800-0000-615179d20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Accepted","startTime":"2021-09-27T07:59:14.5122186Z"}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:01:47 GMT + etag: + - '"53006a19-0000-0800-0000-615179d20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Accepted","startTime":"2021-09-27T07:59:14.5122186Z"}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:17 GMT + etag: + - '"53006a19-0000-0800-0000-615179d20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"f189323c-eb98-4d4a-ab85-1298945bb66d*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Succeeded","startTime":"2021-09-27T07:59:14.5122186Z","endTime":"2021-09-27T08:02:27.0109559Z","error":{},"properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '625' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:47 GMT + etag: + - '"53003e29-0000-0800-0000-61517a930000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor create + Connection: + - keep-alive + ParameterSetName: + - --name --location --user-info --sku --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-27T08:02:26.0897983Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"alice@microsoft.com","id":"3894552614","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"myMonitor","deploymentId":"fc965903955147e08debf70ebb3516b7","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://83cb97bf5c5743209e0dd281fc10e210.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://fc0b56b1b7ec4264b4cd7ae12b067206.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3894552614:kibana-mymonitor?acs=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}' + headers: + cache-control: + - no-cache + content-length: + - '1523' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:48 GMT + etag: + - '"380074b5-0000-0800-0000-61517a930000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor wait + Connection: + - keep-alive + ParameterSetName: + - --created --monitor-name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-27T08:02:26.0897983Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"alice@microsoft.com","id":"3894552614","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"myMonitor","deploymentId":"fc965903955147e08debf70ebb3516b7","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://83cb97bf5c5743209e0dd281fc10e210.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://fc0b56b1b7ec4264b4cd7ae12b067206.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3894552614:kibana-mymonitor?acs=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}' + headers: + cache-control: + - no-cache + content-length: + - '1523' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:49 GMT + etag: + - '"380074b5-0000-0800-0000-61517a930000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-27T08:02:26.0897983Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"alice@microsoft.com","id":"3894552614","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"myMonitor","deploymentId":"fc965903955147e08debf70ebb3516b7","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://83cb97bf5c5743209e0dd281fc10e210.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://fc0b56b1b7ec4264b4cd7ae12b067206.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3894552614:kibana-mymonitor?acs=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}' + headers: + cache-control: + - no-cache + content-length: + - '1523' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:51 GMT + etag: + - '"380074b5-0000-0800-0000-61517a930000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Elastic/monitors?api-version=2020-07-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/poshett-rg/providers/Microsoft.Elastic/monitors/poshett-WestUS2-01","name":"poshett-WestUS2-01","type":"microsoft.elastic/monitors","sku":{"name":"staging_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"poshett01testing1006@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-06-24T17:27:05.8458196Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-12T11:48:58.6463445Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"poshett01testing1006@mpliftrelastic20210901outlo.onmicrosoft.com","id":"3263963353","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"poshett-WestUS2-01","deploymentId":"d120b339729e4e8da7bbbd45733c245c","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://87b9201dcfa844749ad25226fa0fe8c8.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://40344f979a1c4fd593277afb49122ca6.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3263963353:kibana-poshett-westus2-01?acs=https://poshett-westus2-01.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://poshett-westus2-01.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-sub/providers/Microsoft.Elastic/monitors/hashahdemo01","name":"hashahdemo01","type":"microsoft.elastic/monitors","sku":{"name":"staging_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"testelasticbilling01@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-06-28T09:47:17.0251312Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-06-28T09:51:09.197567Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"testelasticbilling01@mpliftrelastic20210901outlo.onmicrosoft.com","id":"2179614077","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"hashahdemo01","deploymentId":"d5810b41c7d142c1b263812a25b25f57","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://a8bb5f4af7694b1ba8bbf894273c97e5.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://0b2d9606eae54c6bac5ef3fb37a1a5d8.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:2179614077:kibana-hashahdemo01?acs=https://hashahdemo01.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://hashahdemo01.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsaxena-elastic-rg/providers/Microsoft.Elastic/monitors/secreat-elastic","name":"secreat-elastic","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"sabarishk@microsoft.com","createdByType":"User","createdAt":"2021-08-11T11:49:41.909511Z","lastModifiedBy":"sabarishk@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-11T11:49:41.909511Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bansad-rg/providers/Microsoft.Elastic/monitors/firstrResourceTest","name":"firstrResourceTest","type":"microsoft.elastic/monitors","sku":{"name":"staging_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"dhbansal@microsoft.com","createdByType":"User","createdAt":"2021-08-12T08:49:55.3953845Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-12T08:53:49.4935426Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"dhbansal@microsoft.com","id":"4091865","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"firstrResourceTest","deploymentId":"83ce730187414a429bd4d5df80d172aa","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://e32986888b624be09dfef185b09ed140.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://2d8226478d15483d8fd900bd24454611.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:c5aebef6fff4486c8593c589a7957200:kibana-firstrresourcetest?acs=https://firstrresourcetest.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://firstrresourcetest.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsaxena_rg/providers/Microsoft.Elastic/monitors/hsaxena_lyftR_instance_test","name":"hsaxena_lyftR_instance_test","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"hsaxena@microsoft.com","createdByType":"User","createdAt":"2021-08-12T09:23:28.5226076Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-12T09:27:04.384093Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"hsaxena@microsoft.com","id":"4083745795","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"hsaxena_lyftR_instance_test","deploymentId":"d19ab1d7fc4243b0a8c5e0bbacfa9b36","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://1fe01a19f3914b60ad93bab5d5f8d7e4.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://d305b15c59e94c7da8517e93db0023d4.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:4083745795:kibana-hsaxena-lyftr-instance-test?acs=https://hsaxena-lyftr-instance-test.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://hsaxena-lyftr-instance-test.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsaxena_rg/providers/Microsoft.Elastic/monitors/hsaxena_cluster_elastic","name":"hsaxena_cluster_elastic","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"hsaxena@microsoft.com","createdByType":"User","createdAt":"2021-08-12T10:02:26.9939951Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-12T10:05:49.0727393Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"hsaxena@microsoft.com","id":"4083745795","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"hsaxena_cluster_elastic","deploymentId":"d15f23b03b2a4e179b7e9e5ce6135ea4","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://b424b7324f3f4feb8b866b3598cb4dde.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://291487ae57f44bdab6b5401ef3bb1152.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:4083745795:kibana-hsaxena-cluster-elastic?acs=https://hsaxena-cluster-elastic.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://hsaxena-cluster-elastic.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-sub/providers/Microsoft.Elastic/monitors/hashah-test-001","name":"hashah-test-001","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"hashah@microsoft.com","createdByType":"User","createdAt":"2021-08-12T15:50:16.9018313Z","lastModifiedBy":"hashah@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-12T15:50:16.9018313Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sadaf-rg/providers/Microsoft.Elastic/monitors/sadaf-test1","name":"sadaf-test1","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"v-sadafm@microsoft.com","createdByType":"User","createdAt":"2021-08-18T14:44:36.2247731Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-18T14:48:52.8376881Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"v-sadafm@microsoft.com","id":"1542197625","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"sadaf-test1","deploymentId":"9830d00913214c8dbd6e0bd12100e8a8","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://e2da6bddd29f41f1909bda6c8e1f537b.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://9a7613bdc88a46ada2931309bde87284.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:1542197625:kibana-sadaf-test1?acs=https://sadaf-test1.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://sadaf-test1.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-27T08:02:26.0897983Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"alice@microsoft.com","id":"3894552614","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"myMonitor","deploymentId":"fc965903955147e08debf70ebb3516b7","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://83cb97bf5c5743209e0dd281fc10e210.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://fc0b56b1b7ec4264b4cd7ae12b067206.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3894552614:kibana-mymonitor?acs=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsaxena-elastic-rg/providers/Microsoft.Elastic/monitors/hsaxena_lyftR_instance","name":"hsaxena_lyftR_instance","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"hsaxena@microsoft.com","createdByType":"User","createdAt":"2021-07-15T19:44:02.4267429Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-07-15T19:46:41.2579649Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"hsaxena@microsoft.com","id":"4083745795","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"hsaxena_lyftR_instance","deploymentId":"0b18f5615e75440086165939873dbd69","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://3017eeba987b43aa8c6c3e939deed57f.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://ab3d44bbf1684bdeab61ccd15f058ca3.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:4083745795:kibana-hsaxena-lyftr-instance?acs=https://hsaxena-lyftr-instance.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://hsaxena-lyftr-instance.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/narai-test-rg/providers/Microsoft.Elastic/monitors/naraielastic1","name":"naraielastic1","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"narai@microsoft.com","createdByType":"User","createdAt":"2021-08-03T07:04:15.4939216Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-03T07:08:53.856708Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"narai@microsoft.com","id":"59910989","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"naraielastic1","deploymentId":"ff3776d7e56f4c4495bcd8eed930639b","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://186cb3622aa34f9ebaa3b460ddb1182f.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://c007c494fb7e4896906c361cabb0dd1a.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:963c5a550fba42c4b3f4e73985e3a4d3:kibana-naraielastic1?acs=https://naraielastic1.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://naraielastic1.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sabz-liftr-rg/providers/Microsoft.Elastic/monitors/sabz-liftr","name":"sabz-liftr","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{},"systemData":{"createdBy":"sabarishk@microsoft.com","createdByType":"User","createdAt":"2021-08-06T11:06:32.6657749Z","lastModifiedBy":"sabarishk@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-08-06T11:06:32.6657749Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/poshett-rg/providers/Microsoft.Elastic/monitors/ElasticSUK01","name":"ElasticSUK01","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"uksouth","tags":{},"systemData":{"createdBy":"poshett3007@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-07-30T05:20:48.1511058Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-12T09:03:31.895364Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"poshett3007@mpliftrelastic20210901outlo.onmicrosoft.com","id":"3010413413","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"ElasticSUK01","deploymentId":"7c8591feb0ee41298af66ec6dfb2a734","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-uksouth","elasticsearchServiceUrl":"https://ccaa1ee07e874d1d8d81b2cb65ba5658.uksouth.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://0fe01adf30f748978ec15f0d3b1a951b.uksouth.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:e590732056534fc2955a26b6c1c7b396:kibana-elasticsuk01?acs=https://elasticsuk01.kb.uksouth.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://elasticsuk01.kb.uksouth.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/magottei-test/providers/Microsoft.Elastic/monitors/magottei-test","name":"magottei-test","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"eastus2","tags":{},"systemData":{"createdBy":"matthew.gotteiner@microsoft.com","createdByType":"User","createdAt":"2021-08-09T16:01:03.2824509Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-09T16:05:31.7285363Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"matthew.gotteiner@microsoft.com","id":"1066865791","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"magottei-test","deploymentId":"121d9e9a30df4feaa07fd4de4bb9eac3","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-eastus2","elasticsearchServiceUrl":"https://a381715830a54132bc2493a9e77bf63f.eastus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://bbc94bf741cf45f699c091c932b38d57.eastus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:6c733c64c41a446c93733b5bcbb0ff84:kibana-magottei-test?acs=https://magottei-test.kb.eastus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://magottei-test.kb.eastus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ga_bugbash/providers/Microsoft.Elastic/monitors/eus2_02","name":"eus2_02","type":"microsoft.elastic/monitors","sku":{"name":"staging_Monthly"},"location":"eastus2","tags":{},"systemData":{"createdBy":"poshett_eus@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-08-26T14:07:46.7690375Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-26T14:11:05.2717082Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"poshett_eus@mpliftrelastic20210901outlo.onmicrosoft.com","id":"4081861127","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"eus2_02","deploymentId":"e6698857d50a4608a6fffc2de58c3229","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-eastus2","elasticsearchServiceUrl":"https://0393706cef794b518cca87dd90f5c749.eastus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://f959a7b9a4e348c1834d7c3531db09f3.eastus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:4081861127:kibana-eus2-02?acs=https://eus2-02.kb.eastus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://eus2-02.kb.eastus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/poshett-rg/providers/Microsoft.Elastic/monitors/ponnezhilTestElasticCluster","name":"ponnezhilTestElasticCluster","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"francecentral","tags":{},"systemData":{"createdBy":"testpmp@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-08-27T05:59:40.4509069Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-27T06:03:29.8341386Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"testpmp@mpliftrelastic20210901outlo.onmicrosoft.com","id":"2883862309","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"ponnezhilTestElasticCluster","deploymentId":"a6b7b19f158b404dbb840bb10f48d499","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-francecentral","elasticsearchServiceUrl":"https://f878932cb5d74f668edfe367b632ec94.francecentral.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://28f2eaf734b44a3fb6f851ad7c981673.francecentral.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:2883862309:kibana-ponnezhiltestelasticcluster?acs=https://ponnezhiltestelasticcluster.kb.francecentral.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://ponnezhiltestelasticcluster.kb.francecentral.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testPonnezhil_rg/providers/Microsoft.Elastic/monitors/cusTest_pmp","name":"cusTest_pmp","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"centralus","tags":{},"systemData":{"createdBy":"testpmp@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-09-23T10:07:14.6180172Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-23T10:11:06.8349419Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"testpmp@mpliftrelastic20210901outlo.onmicrosoft.com","id":"2883862309","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"cusTest_pmp","deploymentId":"190ec9c634c1467695ce2c304a234a1f","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-centralus","elasticsearchServiceUrl":"https://dd7a5de69cd34a04a2dd64c6d7ff2f12.centralus.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://5c95f68980e148c8ae88f323841eb78f.centralus.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:2883862309:kibana-custest-pmp?acs=https://custest-pmp.kb.centralus.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://custest-pmp.kb.centralus.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ga_bugbash/providers/Microsoft.Elastic/monitors/seasia_02","name":"seasia_02","type":"microsoft.elastic/monitors","sku":{"name":"staging_Monthly"},"location":"northeurope","tags":{},"systemData":{"createdBy":"poshett_eus@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-08-26T14:47:27.8775679Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-26T14:50:47.6013642Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"poshett_eus@mpliftrelastic20210901outlo.onmicrosoft.com","id":"4081861127","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"seasia_02","deploymentId":"ac3bc0e5d5d644b790cbfb9a3d3ac79c","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-northeurope","elasticsearchServiceUrl":"https://6e874d2fabd448309cb22cd314855bdc.northeurope.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://ea6e2e18774d48b2a622295c5e9beb5d.northeurope.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:4081861127:kibana-seasia-02?acs=https://seasia-02.kb.northeurope.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://seasia-02.kb.northeurope.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-sub/providers/Microsoft.Elastic/monitors/testsub2","name":"testsub2","type":"microsoft.elastic/monitors","sku":{"name":"staging_Monthly"},"location":"eastus2euap","tags":{},"systemData":{"createdBy":"TestSubKK@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-06-17T12:45:20.8518161Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-06-17T14:44:44.9246983Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"TestSubKK@mpliftrelastic20210901outlo.onmicrosoft.com","id":"760563348","elasticCloudSsoDefaultUrl":"https://staging.found.no"},"elasticCloudDeployment":{"name":"testsub2","deploymentId":"b848d3a21dca48db956c3debf51b34b8","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-eastus2","elasticsearchServiceUrl":"https://5abe0fe898fa419395f605e850887b21.eastus2.staging.azure.foundit.no:9243","kibanaServiceUrl":"https://e11a0c4511414e89ac6f070aa91bfaa7.eastus2.staging.azure.foundit.no:9243","kibanaSsoUrl":"/sso/v1/go/ec:760563348:kibana-testsub2?acs=https://testsub2.kb.eastus2.staging.azure.foundit.no:9243/api/security/saml/callback&sp_login_url=https://testsub2.kb.eastus2.staging.azure.foundit.no:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/elastic-obs-team/providers/Microsoft.Elastic/monitors/testclustercanary2","name":"testclustercanary2","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"eastus2euap","tags":{},"systemData":{"createdBy":"mariana@elastic.co","createdByType":"User","createdAt":"2021-08-19T15:23:45.8521076Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-08-19T15:27:46.8867871Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"mariana@elastic.co","id":"277087568","elasticCloudSsoDefaultUrl":"https://staging.found.no"},"elasticCloudDeployment":{"name":"testclustercanary2","deploymentId":"d6047b9a905f4753a4961789444364c3","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-eastus2","elasticsearchServiceUrl":"https://78eefbf712104cbaba4ccf14d59735c7.eastus2.staging.azure.foundit.no:9243","kibanaServiceUrl":"https://479681545e834bcfa91af73f19a6f18e.eastus2.staging.azure.foundit.no:9243","kibanaSsoUrl":"/sso/v1/go/ec:277087568:kibana-testclustercanary2?acs=https://testclustercanary2.kb.eastus2.staging.azure.foundit.no:9243/api/security/saml/callback&sp_login_url=https://testclustercanary2.kb.eastus2.staging.azure.foundit.no:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vakuncha-test-rg/providers/Microsoft.Elastic/monitors/PythonSDKCreate-1632139593","name":"PythonSDKCreate-1632139593","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"eastus2euap","systemData":{"createdBy":"bc3108c6-7184-4b2b-adfc-f8e5632f8609","createdByType":"Application","createdAt":"2021-09-20T12:06:37.2143214Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-20T12:09:46.8537971Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"sdkdemo@mpliftrelastic20210901outlo.onmicrosoft.com","id":"1220222911","elasticCloudSsoDefaultUrl":"https://staging.found.no"},"elasticCloudDeployment":{"name":"PythonSDKCreate-1632139593","deploymentId":"3973119a1f4643dd8c74f5252aef40bf","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-eastus2","elasticsearchServiceUrl":"https://dc80fb88589b47b18075c1908e38c35f.eastus2.staging.azure.foundit.no:9243","kibanaServiceUrl":"https://2393f6bc74db41c7b879b1ae409fdff3.eastus2.staging.azure.foundit.no:9243","kibanaSsoUrl":"/sso/v1/go/ec:1220222911:kibana-pythonsdkcreate-1632139593?acs=https://pythonsdkcreate-1632139593.kb.eastus2.staging.azure.foundit.no:9243/api/security/saml/callback&sp_login_url=https://pythonsdkcreate-1632139593.kb.eastus2.staging.azure.foundit.no:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource36370","name":"liftr-el-ci-resource36370","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-14T14:32:44.7808657Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-14T14:32:44.7808657Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource34861","name":"liftr-el-ci-resource34861","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-15T09:44:45.7499244Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-15T09:44:45.7499244Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource56546","name":"liftr-el-ci-resource56546","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-16T02:50:47.0524046Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-16T02:50:47.0524046Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource65039","name":"liftr-el-ci-resource65039","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-16T14:18:57.1950852Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-16T14:18:57.1950852Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource09839","name":"liftr-el-ci-resource09839","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-17T02:46:08.4575008Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-17T02:46:08.4575008Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/kk-rg-test/providers/Microsoft.Elastic/monitors/kk-elastictest","name":"kk-elastictest","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"centraluseuap","tags":{},"systemData":{"createdBy":"KKTest@mpliftrelastic20210901outlo.onmicrosoft.com","createdByType":"User","createdAt":"2021-06-17T10:53:17.2697091Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-06-17T10:56:09.6913837Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"KKTest@mpliftrelastic20210901outlo.onmicrosoft.com","id":"1530266474","elasticCloudSsoDefaultUrl":"https://staging.found.no"},"elasticCloudDeployment":{"name":"kk-elastictest","deploymentId":"ae1f16c460604062b77a791fce7fa6e8","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-eastus2","elasticsearchServiceUrl":"https://9e4b739e937a4c7bb55f68a3090e6385.eastus2.staging.azure.foundit.no:9243","kibanaServiceUrl":"https://418bd89fc650441f8c026761d360e488.eastus2.staging.azure.foundit.no:9243","kibanaSsoUrl":"/sso/v1/go/ec:1530266474:kibana-kk-elastictest?acs=https://kk-elastictest.kb.eastus2.staging.azure.foundit.no:9243/api/security/saml/callback&sp_login_url=https://kk-elastictest.kb.eastus2.staging.azure.foundit.no:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource75973","name":"liftr-el-ci-resource75973","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-18T02:54:30.1710982Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-18T02:54:30.1710982Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource58243","name":"liftr-el-ci-resource58243","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-19T02:47:57.8613775Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-19T02:47:57.8613775Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource41955","name":"liftr-el-ci-resource41955","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-20T03:00:34.7444093Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-20T03:00:34.7444093Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource40748","name":"liftr-el-ci-resource40748","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-21T02:48:10.1863074Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-21T02:48:10.1863074Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource94750","name":"liftr-el-ci-resource94750","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-22T02:49:05.7853368Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-22T02:49:05.7853368Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource36404","name":"liftr-el-ci-resource36404","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-22T12:36:31.1520049Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-22T12:36:31.1520049Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource07273","name":"liftr-el-ci-resource07273","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-23T02:43:35.8757423Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-23T02:43:35.8757423Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource00256","name":"liftr-el-ci-resource00256","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-23T15:40:37.7380681Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-23T15:40:37.7380681Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource51779","name":"liftr-el-ci-resource51779","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-24T02:50:40.8036841Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-24T02:50:40.8036841Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cloudtest-eltest-failure-rg/providers/Microsoft.Elastic/monitors/liftr-el-ci-resource10954","name":"liftr-el-ci-resource10954","type":"microsoft.elastic/monitors","sku":{"name":"mpCreateFail403_Monthly"},"location":"centraluseuap","tags":{"TestMethod":"d__12","TestClass":"CreateDeleteMarketplaceAccountFailure"},"systemData":{"createdBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","createdByType":"Application","createdAt":"2021-06-24T05:34:35.3085982Z","lastModifiedBy":"0f24ae2c-32b2-42c6-a6c6-8c7376e1e1c0","lastModifiedByType":"Application","lastModifiedAt":"2021-06-24T05:34:35.3085982Z"},"properties":{"provisioningState":"Failed","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":null,"elasticCloudDeployment":null},"userInfo":null,"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}]}' + headers: + cache-control: + - no-cache + content-length: + - '45705' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 2acf3260-4507-4f5e-bae3-7eec05d2e3e6 + - 90d35de4-60db-46c1-b8c7-48df5a6d4b00 + - b80c57a8-d86d-4e51-8d74-3cdca3ce73cb + - 2d3e1ce8-7e3d-449d-8c8a-223584ad47e7 + - 1951269d-5d53-4a11-ab5f-73e847a97140 + - a94a9371-8ca3-437f-b6fc-85be95c04ba2 + - a46ae5d8-86ea-4d12-9599-18ae12b1d258 + - 83e43636-d624-4d11-99a8-fda1c5597c1b + - 7b0725a1-1f94-44e5-98ce-54ba3faeabc9 + - b4f443dd-5d7d-4fab-810d-b2cf4828e28a + - f6d4dc93-0e76-46cd-8542-633d599d7a2c + - fcb2a9a9-b163-4a78-a2db-f3a80f3927be + - 0d2f7ef1-5c77-4df5-bc21-e2e501b6c97e + - 582fb69d-f741-4bf3-9740-93dbbf488c94 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors?api-version=2020-07-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"9d777fa9-b417-43b8-8991-12f8ee2161d2","lastModifiedByType":"Application","lastModifiedAt":"2021-09-27T08:02:26.0897983Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"alice@microsoft.com","id":"3894552614","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"myMonitor","deploymentId":"fc965903955147e08debf70ebb3516b7","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://83cb97bf5c5743209e0dd281fc10e210.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://fc0b56b1b7ec4264b4cd7ae12b067206.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3894552614:kibana-mymonitor?acs=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1535' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:02:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 0231ed82-2c53-42fe-af02-dfdc34f899f1 + - d12d8d2a-4d1e-4cd1-a82a-feb8803d3034 + - 3b38bc33-e103-462a-b141-55e949d6a74c + - 22b089ca-1c15-41bd-91de-885bd5bf3957 + - ff1aafb9-e231-49b4-8343-e5e428e92d50 + - ef137aef-0751-4bc1-934e-2ac6b887f548 + - 731a1369-5b95-442f-81a5-e9d2d11c37cc + - ef800982-3e62-47ae-b0bb-1b1fca25c082 + - 563e095e-4514-443a-b570-0f84b0e97777 + - e74ed5ce-ad25-4799-aacd-c03aab6e486e + - 17438a2e-b013-4b61-a662-b3299a920381 + - 59d1cce4-f147-469e-af1b-4dfb04b2935e + - 44237e61-5fdb-4173-a31c-8c2ed77f8561 + - bdfa7b74-d9ac-40dd-b3fc-e4bf132c9e7c + status: + code: 200 + message: OK +- request: + body: '{"tags": {"Environment": "Dev"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor update + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json + ParameterSetName: + - --name --tags --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","name":"myMonitor","type":"microsoft.elastic/monitors","sku":{"name":"ess-monthly-consumption_Monthly"},"location":"westus2","tags":{"Environment":"Dev"},"systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T07:59:08.3604372Z","lastModifiedBy":"v-kaisun@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-27T08:02:58.009138Z"},"properties":{"provisioningState":"Succeeded","monitoringStatus":"Enabled","elasticProperties":{"elasticCloudUser":{"emailAddress":"alice@microsoft.com","id":"3894552614","elasticCloudSsoDefaultUrl":"https://cloud.elastic.co"},"elasticCloudDeployment":{"name":"myMonitor","deploymentId":"fc965903955147e08debf70ebb3516b7","azureSubscriptionId":"5a611eed-e33a-44e8-92b1-3f6bf835905e","elasticsearchRegion":"azure-westus2","elasticsearchServiceUrl":"https://83cb97bf5c5743209e0dd281fc10e210.westus2.azure.elastic-cloud.com:9243","kibanaServiceUrl":"https://fc0b56b1b7ec4264b4cd7ae12b067206.westus2.azure.elastic-cloud.com:9243","kibanaSsoUrl":"/sso/v1/go/ec:3894552614:kibana-mymonitor?acs=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243/api/security/saml/callback&sp_login_url=https://mymonitor.kb.westus2.azure.elastic-cloud.com:9243"}},"liftrResourceCategory":"MonitorLogs","liftrResourcePreference":0}}' + headers: + cache-control: + - no-cache + content-length: + - '1501' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:00 GMT + etag: + - '"380018b6-0000-0800-0000-61517ab20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic deployment-info list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --monitor-name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/listDeploymentInfo?api-version=2020-07-01 + response: + body: + string: '{"status":"Healthy","version":"7.15.0","memoryCapacity":"16384","diskCapacity":"491520"}' + headers: + cache-control: + - no-cache + content-length: + - '88' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:03 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitored-resource list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --monitor-name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/listMonitoredResources?api-version=2020-07-01 + response: + body: + string: '{"value":[],"nextLink":null}' + headers: + cache-control: + - no-cache + content-length: + - '28' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:04 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"logRules": {"sendAadLogs": false, "sendSubscriptionLogs": + true, "sendActivityLogs": true, "filteringTags": [{"name": "Environment", "value": + "Prod", "action": "Include"}, {"name": "Environment", "value": "Dev", "action": + "Exclude"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic tag-rule create + Connection: + - keep-alive + Content-Length: + - '252' + Content-Type: + - application/json + ParameterSetName: + - --monitor-name --filtering-tags --filtering-tags --send-aad-logs --send-activity-logs + --send-subscription-logs --resource-group --rule-set-name + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/tagRules/default?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/tagRules/default","name":"default","type":"microsoft.elastic/monitors/tagrules","systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T08:03:06.0632337Z","lastModifiedBy":"v-kaisun@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-27T08:03:06.0632337Z"},"properties":{"provisioningState":"Succeeded","logRules":{"sendAadLogs":false,"sendSubscriptionLogs":true,"sendActivityLogs":true,"filteringTags":[{"name":"Environment","value":"Prod","action":"Include"},{"name":"Environment","value":"Dev","action":"Exclude"}]}}}' + headers: + cache-control: + - no-cache + content-length: + - '776' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:06 GMT + etag: + - '"0200254d-0000-0800-0000-61517abb0000"' + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic tag-rule show + Connection: + - keep-alive + ParameterSetName: + - --monitor-name --resource-group --rule-set-name + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/tagRules/default?api-version=2020-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/tagRules/default","name":"default","type":"microsoft.elastic/monitors/tagrules","systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T08:03:06.0632337Z","lastModifiedBy":"v-kaisun@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-27T08:03:06.0632337Z"},"properties":{"provisioningState":"Succeeded","logRules":{"sendAadLogs":false,"sendSubscriptionLogs":true,"sendActivityLogs":true,"filteringTags":[{"name":"Environment","value":"Prod","action":"Include"},{"name":"Environment","value":"Dev","action":"Exclude"}]}}}' + headers: + cache-control: + - no-cache + content-length: + - '776' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:08 GMT + etag: + - '"0200254d-0000-0800-0000-61517abb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic tag-rule list + Connection: + - keep-alive + ParameterSetName: + - --monitor-name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/tagRules?api-version=2020-07-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/tagRules/default","name":"default","type":"microsoft.elastic/monitors/tagrules","systemData":{"createdBy":"v-kaisun@microsoft.com","createdByType":"User","createdAt":"2021-09-27T08:03:06.0632337Z","lastModifiedBy":"v-kaisun@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-09-27T08:03:06.0632337Z"},"properties":{"provisioningState":"Succeeded","logRules":{"sendAadLogs":false,"sendSubscriptionLogs":true,"sendActivityLogs":true,"filteringTags":[{"name":"Environment","value":"Prod","action":"Include"},{"name":"Environment","value":"Dev","action":"Exclude"}]}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '788' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"vmResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualmachines/myVM", + "operationName": "Add"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic vm-collection update + Connection: + - keep-alive + Content-Length: + - '235' + Content-Type: + - application/json + ParameterSetName: + - --monitor-name --operation-name --vm-resource-id --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/vmCollectionUpdate?api-version=2020-07-01 + response: + body: + string: '{"deploymentId":"fc965903955147e08debf70ebb3516b7","vmResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualmachines/myVM","installDate":"2021-09-27T08:03:11.1640338Z"}' + headers: + cache-control: + - no-cache + content-length: + - '305' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:10 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic vm-host list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --monitor-name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/listVMHost?api-version=2020-07-01 + response: + body: + string: '{"value":[{"vmResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/virtualmachines/myVM"}],"nextLink":null}' + headers: + cache-control: + - no-cache + content-length: + - '238' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:12 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic vm-ingestion detail + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --monitor-name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor/vmIngestionDetails?api-version=2020-07-01 + response: + body: + string: '{"cloudId":"myMonitor:d2VzdHVzMi5henVyZS5lbGFzdGljLWNsb3VkLmNvbTo5MjQzJDgzY2I5N2JmNWM1NzQzMjA5ZTBkZDI4MWZjMTBlMjEwJGZjMGI1NmIxYjdlYzQyNjRiNGNkN2FlMTJiMDY3MjA2","ingestionKey":"fake_key"}' + headers: + cache-control: + - no-cache + content-length: + - '222' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:13 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor?api-version=2020-07-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/8159347c-e399-4161-acc1-36471c13d3db*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:16 GMT + etag: + - '"380058b6-0000-0800-0000-61517ac50000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/8159347c-e399-4161-acc1-36471c13d3db*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + pragma: + - no-cache + request-context: + - appId=cid-v1:13f6b276-8851-4983-9417-68bc36807add + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - elastic monitor delete + Connection: + - keep-alive + ParameterSetName: + - -y --name --resource-group + User-Agent: + - AZURECLI/2.28.0 azsdk-python-mgmt-elastic/1.0.0b1 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/8159347c-e399-4161-acc1-36471c13d3db*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F?api-version=2020-07-01 + response: + body: + string: '{"id":"/providers/Microsoft.Elastic/locations/WESTUS2/operationStatuses/8159347c-e399-4161-acc1-36471c13d3db*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","name":"8159347c-e399-4161-acc1-36471c13d3db*B14AA8EE2A8DEF0E99B59FDE41067CD5A2C21A69B0AB59C7D96E941F5527CD7F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Elastic/monitors/myMonitor","status":"Succeeded","startTime":"2021-09-27T08:03:16.5507984Z","endTime":"2021-09-27T08:03:21.1861661Z","error":{},"properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '625' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Sep 2021 08:03:46 GMT + etag: + - '"5300202d-0000-0800-0000-61517ac90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/elastic/azext_elastic/tests/latest/test_elastic_scenario.py b/src/elastic/azext_elastic/tests/latest/test_elastic_scenario.py new file mode 100644 index 00000000000..a19712efdc9 --- /dev/null +++ b/src/elastic/azext_elastic/tests/latest/test_elastic_scenario.py @@ -0,0 +1,109 @@ +# -------------------------------------------------------------------------- +# 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_monitor_create +from .example_steps import step_monitor_show +from .example_steps import step_monitor_list +from .example_steps import step_monitor_list2 +from .example_steps import step_monitor_update +from .example_steps import step_deployment_info_list +from .example_steps import step_monitored_resource_list +from .example_steps import step_tag_rule_create +from .example_steps import step_tag_rule_show +from .example_steps import step_tag_rule_list +from .example_steps import step_tag_rule_delete +from .example_steps import step_vm_collection_update +from .example_steps import step_vm_host_list +from .example_steps import step_vm_ingestion_detail +from .example_steps import step_monitor_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test): + setup_scenario(test) + step_monitor_create(test, checks=[ + test.check("name", "{myMonitor}", case_sensitive=False), + test.check("location", "westus2", case_sensitive=False), + test.check("sku.name", "ess-monthly-consumption_Monthly", case_sensitive=False), + test.check("tags.Environment", "Dev", case_sensitive=False), + ]) + step_monitor_show(test, checks=[ + test.check("name", "{myMonitor}", case_sensitive=False), + test.check("location", "westus2", case_sensitive=False), + test.check("tags.Environment", "Dev", case_sensitive=False), + ]) + step_monitor_list(test, checks=[ + test.check('length(@)', 37), + ]) + step_monitor_list2(test, checks=[ + test.check('length(@)', 1), + ]) + step_monitor_update(test, checks=[ + test.check("name", "{myMonitor}", case_sensitive=False), + test.check("location", "westus2", case_sensitive=False), + test.check("sku.name", "ess-monthly-consumption_Monthly", case_sensitive=False), + test.check("tags.Environment", "Dev", case_sensitive=False), + ]) + step_deployment_info_list(test, checks=[]) + step_monitored_resource_list(test, checks=[]) + step_tag_rule_create(test, checks=[]) + step_tag_rule_show(test, checks=[]) + step_tag_rule_list(test, checks=[]) + # Error (ResourceDeletionFailed) Resource deletion failed as RP returned status code: 'UnprocessableEntity' + # step_tag_rule_delete(test, checks=[]) + step_vm_collection_update(test, checks=[]) + step_vm_host_list(test, checks=[]) + step_vm_ingestion_detail(test, checks=[]) + step_monitor_delete(test, checks=[]) + cleanup_scenario(test) + + +# Test class for Scenario +@try_manual +class ElasticScenarioTest(ScenarioTest): + def __init__(self, *args, **kwargs): + super(ElasticScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myMonitor': 'myMonitor', + }) + + @ResourceGroupPreparer(name_prefix='clitestelastic_myResourceGroup'[:7], key='rg', parameter_name='rg') + def test_elastic_Scenario(self, rg): + call_scenario(self) + calc_coverage(__file__) + raise_if() diff --git a/src/elastic/azext_elastic/tests/latest/test_elastic_scenario_coverage.md b/src/elastic/azext_elastic/tests/latest/test_elastic_scenario_coverage.md new file mode 100644 index 00000000000..3c280ba07f0 --- /dev/null +++ b/src/elastic/azext_elastic/tests/latest/test_elastic_scenario_coverage.md @@ -0,0 +1,16 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_monitor_create|successed||||2021-10-20 03:28:47.955384|2021-10-20 03:28:48.676417| +|step_monitor_show|successed||||2021-10-20 03:28:48.676417|2021-10-20 03:28:48.786417| +|step_monitor_list|successed||||2021-10-20 03:28:48.786417|2021-10-20 03:28:48.923420| +|step_monitor_list2|successed||||2021-10-20 03:28:48.923420|2021-10-20 03:28:49.035408| +|step_monitor_update|successed||||2021-10-20 03:28:49.035408|2021-10-20 03:28:49.147413| +|step_deployment_info_list|successed||||2021-10-20 03:28:49.147413|2021-10-20 03:28:49.259424| +|step_monitored_resource_list|successed||||2021-10-20 03:28:49.260390|2021-10-20 03:28:49.366420| +|step_tag_rule_create|successed||||2021-10-20 03:28:49.366420|2021-10-20 03:28:49.475419| +|step_tag_rule_show|successed||||2021-10-20 03:28:49.475419|2021-10-20 03:28:49.584419| +|step_tag_rule_list|successed||||2021-10-20 03:28:49.584419|2021-10-20 03:28:49.696420| +|step_vm_collection_update|successed||||2021-10-20 03:28:49.696420|2021-10-20 03:28:49.806419| +|step_vm_host_list|successed||||2021-10-20 03:28:49.806419|2021-10-20 03:28:49.915418| +|step_vm_ingestion_detail|successed||||2021-10-20 03:28:49.915418|2021-10-20 03:28:50.027420| +|step_monitor_delete|successed||||2021-10-20 03:28:50.028385|2021-10-20 03:28:50.181385| +Coverage: 14/14 diff --git a/src/elastic/azext_elastic/vendored_sdks/__init__.py b/src/elastic/azext_elastic/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/elastic/azext_elastic/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/elastic/azext_elastic/vendored_sdks/elastic/__init__.py b/src/elastic/azext_elastic/vendored_sdks/elastic/__init__.py new file mode 100644 index 00000000000..4e04609bc42 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/__init__.py @@ -0,0 +1,19 @@ +# 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 ._microsoft_elastic import MicrosoftElastic +from ._version import VERSION + +__version__ = VERSION +__all__ = ['MicrosoftElastic'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/_configuration.py b/src/elastic/azext_elastic/vendored_sdks/elastic/_configuration.py new file mode 100644 index 00000000000..2b71d732abd --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/_configuration.py @@ -0,0 +1,71 @@ +# 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 + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class MicrosoftElasticConfiguration(Configuration): + """Configuration for MicrosoftElastic. + + 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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :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(MicrosoftElasticConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-07-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-elastic/{}'.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/elastic/azext_elastic/vendored_sdks/elastic/_microsoft_elastic.py b/src/elastic/azext_elastic/vendored_sdks/elastic/_microsoft_elastic.py new file mode 100644 index 00000000000..f687bd7c079 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/_microsoft_elastic.py @@ -0,0 +1,105 @@ +# 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 MicrosoftElasticConfiguration +from .operations import Operations +from .operations import MonitorsOperations +from .operations import MonitoredResourcesOperations +from .operations import DeploymentInfoOperations +from .operations import TagRulesOperations +from .operations import VmHostOperations +from .operations import VmIngestionOperations +from .operations import VmCollectionOperations +from . import models + + +class MicrosoftElastic(object): + """MicrosoftElastic. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.elastic.operations.Operations + :ivar monitors: MonitorsOperations operations + :vartype monitors: azure.mgmt.elastic.operations.MonitorsOperations + :ivar monitored_resources: MonitoredResourcesOperations operations + :vartype monitored_resources: azure.mgmt.elastic.operations.MonitoredResourcesOperations + :ivar deployment_info: DeploymentInfoOperations operations + :vartype deployment_info: azure.mgmt.elastic.operations.DeploymentInfoOperations + :ivar tag_rules: TagRulesOperations operations + :vartype tag_rules: azure.mgmt.elastic.operations.TagRulesOperations + :ivar vm_host: VmHostOperations operations + :vartype vm_host: azure.mgmt.elastic.operations.VmHostOperations + :ivar vm_ingestion: VmIngestionOperations operations + :vartype vm_ingestion: azure.mgmt.elastic.operations.VmIngestionOperations + :ivar vm_collection: VmCollectionOperations operations + :vartype vm_collection: azure.mgmt.elastic.operations.VmCollectionOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + 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 = MicrosoftElasticConfiguration(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.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.monitors = MonitorsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitored_resources = MonitoredResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deployment_info = DeploymentInfoOperations( + self._client, self._config, self._serialize, self._deserialize) + self.tag_rules = TagRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vm_host = VmHostOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vm_ingestion = VmIngestionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vm_collection = VmCollectionOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MicrosoftElastic + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/_version.py b/src/elastic/azext_elastic/vendored_sdks/elastic/_version.py new file mode 100644 index 00000000000..e5754a47ce6 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/__init__.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/__init__.py new file mode 100644 index 00000000000..307ea00d41d --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._microsoft_elastic import MicrosoftElastic +__all__ = ['MicrosoftElastic'] diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/_configuration.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/_configuration.py new file mode 100644 index 00000000000..d96b8773a96 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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 Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class MicrosoftElasticConfiguration(Configuration): + """Configuration for MicrosoftElastic. + + 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_async.AsyncTokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> 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(MicrosoftElasticConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-07-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-elastic/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> 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.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/_microsoft_elastic.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/_microsoft_elastic.py new file mode 100644 index 00000000000..64b307dd05b --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/_microsoft_elastic.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. +# 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 Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import MicrosoftElasticConfiguration +from .operations import Operations +from .operations import MonitorsOperations +from .operations import MonitoredResourcesOperations +from .operations import DeploymentInfoOperations +from .operations import TagRulesOperations +from .operations import VmHostOperations +from .operations import VmIngestionOperations +from .operations import VmCollectionOperations +from .. import models + + +class MicrosoftElastic(object): + """MicrosoftElastic. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.elastic.aio.operations.Operations + :ivar monitors: MonitorsOperations operations + :vartype monitors: azure.mgmt.elastic.aio.operations.MonitorsOperations + :ivar monitored_resources: MonitoredResourcesOperations operations + :vartype monitored_resources: azure.mgmt.elastic.aio.operations.MonitoredResourcesOperations + :ivar deployment_info: DeploymentInfoOperations operations + :vartype deployment_info: azure.mgmt.elastic.aio.operations.DeploymentInfoOperations + :ivar tag_rules: TagRulesOperations operations + :vartype tag_rules: azure.mgmt.elastic.aio.operations.TagRulesOperations + :ivar vm_host: VmHostOperations operations + :vartype vm_host: azure.mgmt.elastic.aio.operations.VmHostOperations + :ivar vm_ingestion: VmIngestionOperations operations + :vartype vm_ingestion: azure.mgmt.elastic.aio.operations.VmIngestionOperations + :ivar vm_collection: VmCollectionOperations operations + :vartype vm_collection: azure.mgmt.elastic.aio.operations.VmCollectionOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MicrosoftElasticConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(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.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.monitors = MonitorsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.monitored_resources = MonitoredResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deployment_info = DeploymentInfoOperations( + self._client, self._config, self._serialize, self._deserialize) + self.tag_rules = TagRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vm_host = VmHostOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vm_ingestion = VmIngestionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vm_collection = VmCollectionOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MicrosoftElastic": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/__init__.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/__init__.py new file mode 100644 index 00000000000..b02fb6186c2 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# 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 ._operations import Operations +from ._monitors_operations import MonitorsOperations +from ._monitored_resources_operations import MonitoredResourcesOperations +from ._deployment_info_operations import DeploymentInfoOperations +from ._tag_rules_operations import TagRulesOperations +from ._vm_host_operations import VmHostOperations +from ._vm_ingestion_operations import VmIngestionOperations +from ._vm_collection_operations import VmCollectionOperations + +__all__ = [ + 'Operations', + 'MonitorsOperations', + 'MonitoredResourcesOperations', + 'DeploymentInfoOperations', + 'TagRulesOperations', + 'VmHostOperations', + 'VmIngestionOperations', + 'VmCollectionOperations', +] diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_deployment_info_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_deployment_info_operations.py new file mode 100644 index 00000000000..863908df3ad --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_deployment_info_operations.py @@ -0,0 +1,104 @@ +# 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 Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeploymentInfoOperations: + """DeploymentInfoOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> "models.DeploymentInfoResponse": + """Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. + + Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor + resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentInfoResponse, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.DeploymentInfoResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentInfoResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(url, query_parameters, header_parameters) + pipeline_response = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentInfoResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listDeploymentInfo'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitored_resources_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitored_resources_operations.py new file mode 100644 index 00000000000..4c7a0d882b4 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitored_resources_operations.py @@ -0,0 +1,120 @@ +# 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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitoredResourcesOperations: + """MonitoredResourcesOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> AsyncIterable["models.MonitoredResourceListResponse"]: + """List the resources currently being monitored by the Elastic monitor resource. + + List the resources currently being monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoredResourceListResponse or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.MonitoredResourceListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoredResourceListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(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 + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoredResourceListResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, 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 AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listMonitoredResources'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitors_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitors_operations.py new file mode 100644 index 00000000000..34f4dea0d8a --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_monitors_operations.py @@ -0,0 +1,569 @@ +# 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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MonitorsOperations: + """MonitorsOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.ElasticMonitorResourceListResponse"]: + """List all monitors under the specified subscription. + + List all monitors under 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 ElasticMonitorResourceListResponse or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.ElasticMonitorResourceListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResourceListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + 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 + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ElasticMonitorResourceListResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, 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 AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/monitors'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.ElasticMonitorResourceListResponse"]: + """List all monitors under the specified resource group. + + List all monitors under the specified resource group. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :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 ElasticMonitorResourceListResponse or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.ElasticMonitorResourceListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResourceListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + 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 + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ElasticMonitorResourceListResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, 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 AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors'} # type: ignore + + async def get( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> "models.ElasticMonitorResource": + """Get the properties of a specific monitor resource. + + Get the properties of a specific monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElasticMonitorResource, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.ElasticMonitorResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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 = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + monitor_name: str, + body: Optional["models.ElasticMonitorResource"] = None, + **kwargs + ) -> "models.ElasticMonitorResource": + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 'ElasticMonitorResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + monitor_name: str, + body: Optional["models.ElasticMonitorResource"] = None, + **kwargs + ) -> AsyncLROPoller["models.ElasticMonitorResource"]: + """Create a monitor resource. + + Create a monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param body: Elastic monitor resource model. + :type body: ~azure.mgmt.elastic.models.ElasticMonitorResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ElasticMonitorResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.elastic.models.ElasticMonitorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + monitor_name: str, + body: Optional["models.ElasticMonitorResourceUpdateParameters"] = None, + **kwargs + ) -> "models.ElasticMonitorResource": + """Update a monitor resource. + + Update a monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param body: Elastic resource model update parameters. + :type body: ~azure.mgmt.elastic.models.ElasticMonitorResourceUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElasticMonitorResource, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.ElasticMonitorResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 'ElasticMonitorResourceUpdateParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> None: + 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 = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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 = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a monitor resource. + + Delete a monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_operations.py new file mode 100644 index 00000000000..b6d245e1cb1 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_operations.py @@ -0,0 +1,107 @@ +# 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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.OperationListResult"]: + """List all operations provided by Microsoft.Elastic. + + List all operations provided by Microsoft.Elastic. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + # 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 + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, 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 AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Elastic/operations'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_tag_rules_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_tag_rules_operations.py new file mode 100644 index 00000000000..505165f16be --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_tag_rules_operations.py @@ -0,0 +1,384 @@ +# 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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TagRulesOperations: + """TagRulesOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> AsyncIterable["models.MonitoringTagRulesListResponse"]: + """List the tag rules for a given monitor resource. + + List the tag rules for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringTagRulesListResponse or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.MonitoringTagRulesListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRulesListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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 + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MonitoringTagRulesListResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, 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 AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + monitor_name: str, + rule_set_name: str, + body: Optional["models.MonitoringTagRules"] = None, + **kwargs + ) -> "models.MonitoringTagRules": + """Create or update a tag rule set for a given monitor resource. + + Create or update a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name. + :type rule_set_name: str + :param body: request body of MonitoringTagRules. + :type body: ~azure.mgmt.elastic.models.MonitoringTagRules + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringTagRules, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.MonitoringTagRules + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRules"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + 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, 'MonitoringTagRules') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringTagRules', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + monitor_name: str, + rule_set_name: str, + **kwargs + ) -> "models.MonitoringTagRules": + """Get a tag rule set for a given monitor resource. + + Get a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringTagRules, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.MonitoringTagRules + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRules"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + 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 = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringTagRules', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + monitor_name: str, + rule_set_name: str, + **kwargs + ) -> None: + 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 = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + 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 = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + monitor_name: str, + rule_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a tag rule set for a given monitor resource. + + Delete a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + rule_set_name=rule_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_collection_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_collection_operations.py new file mode 100644 index 00000000000..7eeef121639 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_collection_operations.py @@ -0,0 +1,111 @@ +# 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 Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VmCollectionOperations: + """VmCollectionOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def update( + self, + resource_group_name: str, + monitor_name: str, + body: Optional["models.VmCollectionUpdate"] = None, + **kwargs + ) -> None: + """Update the vm details that will be monitored by the Elastic monitor resource. + + Update the vm details that will be monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param body: VM resource Id. + :type body: ~azure.mgmt.elastic.models.VmCollectionUpdate + :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 = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 'VmCollectionUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmCollectionUpdate'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_host_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_host_operations.py new file mode 100644 index 00000000000..3a3f2a42297 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_host_operations.py @@ -0,0 +1,120 @@ +# 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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VmHostOperations: + """VmHostOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> AsyncIterable["models.VmHostListResponse"]: + """List the vm resources currently being monitored by the Elastic monitor resource. + + List the vm resources currently being monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VmHostListResponse or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.elastic.models.VmHostListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VmHostListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(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 + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VmHostListResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, 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 AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listVMHost'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_ingestion_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_ingestion_operations.py new file mode 100644 index 00000000000..53844816fa5 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/aio/operations/_vm_ingestion_operations.py @@ -0,0 +1,103 @@ +# 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 Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VmIngestionOperations: + """VmIngestionOperations async 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: ~azure.mgmt.elastic.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) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def details( + self, + resource_group_name: str, + monitor_name: str, + **kwargs + ) -> "models.VmIngestionDetailsResponse": + """List the vm ingestion details that will be monitored by the Elastic monitor resource. + + List the vm ingestion details that will be monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VmIngestionDetailsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.VmIngestionDetailsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VmIngestionDetailsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.details.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(url, query_parameters, header_parameters) + pipeline_response = await 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VmIngestionDetailsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmIngestionDetails'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/models/__init__.py b/src/elastic/azext_elastic/vendored_sdks/elastic/models/__init__.py new file mode 100644 index 00000000000..450682ed57c --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/models/__init__.py @@ -0,0 +1,121 @@ +# 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 CompanyInfo + from ._models_py3 import DeploymentInfoResponse + from ._models_py3 import ElasticCloudDeployment + from ._models_py3 import ElasticCloudUser + from ._models_py3 import ElasticMonitorResource + from ._models_py3 import ElasticMonitorResourceListResponse + from ._models_py3 import ElasticMonitorResourceUpdateParameters + from ._models_py3 import ElasticProperties + from ._models_py3 import ErrorResponseBody + from ._models_py3 import FilteringTag + from ._models_py3 import IdentityProperties + from ._models_py3 import LogRules + from ._models_py3 import MonitorProperties + from ._models_py3 import MonitoredResource + from ._models_py3 import MonitoredResourceListResponse + from ._models_py3 import MonitoringTagRules + from ._models_py3 import MonitoringTagRulesListResponse + from ._models_py3 import MonitoringTagRulesProperties + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import OperationResult + from ._models_py3 import ResourceProviderDefaultErrorResponse + from ._models_py3 import ResourceSku + from ._models_py3 import SystemData + from ._models_py3 import UserInfo + from ._models_py3 import VmCollectionUpdate + from ._models_py3 import VmHostListResponse + from ._models_py3 import VmIngestionDetailsResponse + from ._models_py3 import VmResources +except (SyntaxError, ImportError): + from ._models import CompanyInfo # type: ignore + from ._models import DeploymentInfoResponse # type: ignore + from ._models import ElasticCloudDeployment # type: ignore + from ._models import ElasticCloudUser # type: ignore + from ._models import ElasticMonitorResource # type: ignore + from ._models import ElasticMonitorResourceListResponse # type: ignore + from ._models import ElasticMonitorResourceUpdateParameters # type: ignore + from ._models import ElasticProperties # type: ignore + from ._models import ErrorResponseBody # type: ignore + from ._models import FilteringTag # type: ignore + from ._models import IdentityProperties # type: ignore + from ._models import LogRules # type: ignore + from ._models import MonitorProperties # type: ignore + from ._models import MonitoredResource # type: ignore + from ._models import MonitoredResourceListResponse # type: ignore + from ._models import MonitoringTagRules # type: ignore + from ._models import MonitoringTagRulesListResponse # type: ignore + from ._models import MonitoringTagRulesProperties # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OperationResult # type: ignore + from ._models import ResourceProviderDefaultErrorResponse # type: ignore + from ._models import ResourceSku # type: ignore + from ._models import SystemData # type: ignore + from ._models import UserInfo # type: ignore + from ._models import VmCollectionUpdate # type: ignore + from ._models import VmHostListResponse # type: ignore + from ._models import VmIngestionDetailsResponse # type: ignore + from ._models import VmResources # type: ignore + +from ._microsoft_elastic_enums import ( + CreatedByType, + ElasticDeploymentStatus, + LiftrResourceCategories, + ManagedIdentityTypes, + MonitoringStatus, + OperationName, + ProvisioningState, + SendingLogs, + TagAction, +) + +__all__ = [ + 'CompanyInfo', + 'DeploymentInfoResponse', + 'ElasticCloudDeployment', + 'ElasticCloudUser', + 'ElasticMonitorResource', + 'ElasticMonitorResourceListResponse', + 'ElasticMonitorResourceUpdateParameters', + 'ElasticProperties', + 'ErrorResponseBody', + 'FilteringTag', + 'IdentityProperties', + 'LogRules', + 'MonitorProperties', + 'MonitoredResource', + 'MonitoredResourceListResponse', + 'MonitoringTagRules', + 'MonitoringTagRulesListResponse', + 'MonitoringTagRulesProperties', + 'OperationDisplay', + 'OperationListResult', + 'OperationResult', + 'ResourceProviderDefaultErrorResponse', + 'ResourceSku', + 'SystemData', + 'UserInfo', + 'VmCollectionUpdate', + 'VmHostListResponse', + 'VmIngestionDetailsResponse', + 'VmResources', + 'CreatedByType', + 'ElasticDeploymentStatus', + 'LiftrResourceCategories', + 'ManagedIdentityTypes', + 'MonitoringStatus', + 'OperationName', + 'ProvisioningState', + 'SendingLogs', + 'TagAction', +] diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/models/_microsoft_elastic_enums.py b/src/elastic/azext_elastic/vendored_sdks/elastic/models/_microsoft_elastic_enums.py new file mode 100644 index 00000000000..23eb9781ca1 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/models/_microsoft_elastic_enums.py @@ -0,0 +1,96 @@ +# 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 CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class ElasticDeploymentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Flag specifying if the Elastic deployment status is healthy or not. + """ + + HEALTHY = "Healthy" + UNHEALTHY = "Unhealthy" + +class LiftrResourceCategories(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + UNKNOWN = "Unknown" + MONITOR_LOGS = "MonitorLogs" + +class ManagedIdentityTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Managed Identity types. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + +class MonitoringStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Flag specifying if the resource monitoring is enabled or disabled. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class OperationName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operation to be performed on the given vm resource id. + """ + + ADD = "Add" + DELETE = "Delete" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of Elastic resource. + """ + + ACCEPTED = "Accepted" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + DELETED = "Deleted" + NOT_SPECIFIED = "NotSpecified" + +class SendingLogs(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Flag indicating the status of the resource for sending logs operation to Elastic. + """ + + TRUE = "True" + FALSE = "False" + +class TagAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Valid actions for a filtering tag. Exclusion takes priority over inclusion. + """ + + INCLUDE = "Include" + EXCLUDE = "Exclude" diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/models/_models.py b/src/elastic/azext_elastic/vendored_sdks/elastic/models/_models.py new file mode 100644 index 00000000000..7b62d3fb9fd --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/models/_models.py @@ -0,0 +1,941 @@ +# 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 CompanyInfo(msrest.serialization.Model): + """Company information of the user to be passed to partners. + + :param domain: Domain of the company. + :type domain: str + :param business: Business of the company. + :type business: str + :param employees_number: Number of employees in the company. + :type employees_number: str + :param state: State of the company location. + :type state: str + :param country: Country of the company location. + :type country: str + """ + + _validation = { + 'domain': {'max_length': 250, 'min_length': 0}, + 'business': {'max_length': 50, 'min_length': 0}, + 'employees_number': {'max_length': 20, 'min_length': 0}, + 'state': {'max_length': 50, 'min_length': 0}, + 'country': {'max_length': 50, 'min_length': 0}, + } + + _attribute_map = { + 'domain': {'key': 'domain', 'type': 'str'}, + 'business': {'key': 'business', 'type': 'str'}, + 'employees_number': {'key': 'employeesNumber', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CompanyInfo, self).__init__(**kwargs) + self.domain = kwargs.get('domain', None) + self.business = kwargs.get('business', None) + self.employees_number = kwargs.get('employees_number', None) + self.state = kwargs.get('state', None) + self.country = kwargs.get('country', None) + + +class DeploymentInfoResponse(msrest.serialization.Model): + """The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The Elastic deployment status. Possible values include: "Healthy", "Unhealthy". + :vartype status: str or ~azure.mgmt.elastic.models.ElasticDeploymentStatus + :ivar version: Version of the elasticsearch in Elastic cloud deployment. + :vartype version: str + :ivar memory_capacity: RAM capacity of the elasticsearch in Elastic cloud deployment. + :vartype memory_capacity: str + :ivar disk_capacity: Disk capacity of the elasticsearch in Elastic cloud deployment. + :vartype disk_capacity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'version': {'readonly': True}, + 'memory_capacity': {'readonly': True}, + 'disk_capacity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'memory_capacity': {'key': 'memoryCapacity', 'type': 'str'}, + 'disk_capacity': {'key': 'diskCapacity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentInfoResponse, self).__init__(**kwargs) + self.status = None + self.version = None + self.memory_capacity = None + self.disk_capacity = None + + +class ElasticCloudDeployment(msrest.serialization.Model): + """Details of the user's elastic deployment associated with the monitor resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Elastic deployment name. + :vartype name: str + :ivar deployment_id: Elastic deployment Id. + :vartype deployment_id: str + :ivar azure_subscription_id: Associated Azure subscription Id for the elastic deployment. + :vartype azure_subscription_id: str + :ivar elasticsearch_region: Region where Deployment at Elastic side took place. + :vartype elasticsearch_region: str + :ivar elasticsearch_service_url: Elasticsearch ingestion endpoint of the Elastic deployment. + :vartype elasticsearch_service_url: str + :ivar kibana_service_url: Kibana endpoint of the Elastic deployment. + :vartype kibana_service_url: str + :ivar kibana_sso_url: Kibana dashboard sso URL of the Elastic deployment. + :vartype kibana_sso_url: str + """ + + _validation = { + 'name': {'readonly': True}, + 'deployment_id': {'readonly': True}, + 'azure_subscription_id': {'readonly': True}, + 'elasticsearch_region': {'readonly': True}, + 'elasticsearch_service_url': {'readonly': True}, + 'kibana_service_url': {'readonly': True}, + 'kibana_sso_url': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, + 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, + 'elasticsearch_region': {'key': 'elasticsearchRegion', 'type': 'str'}, + 'elasticsearch_service_url': {'key': 'elasticsearchServiceUrl', 'type': 'str'}, + 'kibana_service_url': {'key': 'kibanaServiceUrl', 'type': 'str'}, + 'kibana_sso_url': {'key': 'kibanaSsoUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticCloudDeployment, self).__init__(**kwargs) + self.name = None + self.deployment_id = None + self.azure_subscription_id = None + self.elasticsearch_region = None + self.elasticsearch_service_url = None + self.kibana_service_url = None + self.kibana_sso_url = None + + +class ElasticCloudUser(msrest.serialization.Model): + """Details of the user's elastic account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar email_address: Email of the Elastic User Account. + :vartype email_address: str + :ivar id: User Id of the elastic account of the User. + :vartype id: str + :ivar elastic_cloud_sso_default_url: Elastic cloud default dashboard sso URL of the Elastic + user account. + :vartype elastic_cloud_sso_default_url: str + """ + + _validation = { + 'email_address': {'readonly': True}, + 'id': {'readonly': True}, + 'elastic_cloud_sso_default_url': {'readonly': True}, + } + + _attribute_map = { + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'elastic_cloud_sso_default_url': {'key': 'elasticCloudSsoDefaultUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticCloudUser, self).__init__(**kwargs) + self.email_address = None + self.id = None + self.elastic_cloud_sso_default_url = None + + +class ElasticMonitorResource(msrest.serialization.Model): + """Monitor 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: ARM id of the monitor resource. + :vartype id: str + :ivar name: Name of the monitor resource. + :vartype name: str + :ivar type: The type of the monitor resource. + :vartype type: str + :param sku: SKU of the monitor resource. + :type sku: ~azure.mgmt.elastic.models.ResourceSku + :param properties: Properties of the monitor resource. + :type properties: ~azure.mgmt.elastic.models.MonitorProperties + :param identity: Identity properties of the monitor resource. + :type identity: ~azure.mgmt.elastic.models.IdentityProperties + :param tags: A set of tags. The tags of the monitor resource. + :type tags: dict[str, str] + :param location: Required. The location of the monitor resource. + :type location: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'MonitorProperties'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticMonitorResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.sku = kwargs.get('sku', None) + self.properties = kwargs.get('properties', None) + self.identity = kwargs.get('identity', None) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + self.system_data = None + + +class ElasticMonitorResourceListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.ElasticMonitorResource] + :param next_link: Link to the next set of results, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ElasticMonitorResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticMonitorResourceListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ElasticMonitorResourceUpdateParameters(msrest.serialization.Model): + """Monitor resource update parameters. + + :param tags: A set of tags. elastic monitor resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticMonitorResourceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ElasticProperties(msrest.serialization.Model): + """Elastic Resource Properties. + + :param elastic_cloud_user: Details of the user's elastic account. + :type elastic_cloud_user: ~azure.mgmt.elastic.models.ElasticCloudUser + :param elastic_cloud_deployment: Details of the elastic cloud deployment. + :type elastic_cloud_deployment: ~azure.mgmt.elastic.models.ElasticCloudDeployment + """ + + _attribute_map = { + 'elastic_cloud_user': {'key': 'elasticCloudUser', 'type': 'ElasticCloudUser'}, + 'elastic_cloud_deployment': {'key': 'elasticCloudDeployment', 'type': 'ElasticCloudDeployment'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticProperties, self).__init__(**kwargs) + self.elastic_cloud_user = kwargs.get('elastic_cloud_user', None) + self.elastic_cloud_deployment = kwargs.get('elastic_cloud_deployment', None) + + +class ErrorResponseBody(msrest.serialization.Model): + """Error response body. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :param target: Error target. + :type target: str + :param details: Error details. + :type details: list[~azure.mgmt.elastic.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class FilteringTag(msrest.serialization.Model): + """The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored. + + :param name: The name (also known as the key) of the tag. + :type name: str + :param value: The value of the tag. + :type value: str + :param action: Valid actions for a filtering tag. Possible values include: "Include", + "Exclude". + :type action: str or ~azure.mgmt.elastic.models.TagAction + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FilteringTag, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.action = kwargs.get('action', None) + + +class IdentityProperties(msrest.serialization.Model): + """Identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The identity ID. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Managed identity type. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.elastic.models.ManagedIdentityTypes + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class LogRules(msrest.serialization.Model): + """Set of rules for sending logs for the Monitor resource. + + :param send_aad_logs: Flag specifying if AAD logs should be sent for the Monitor resource. + :type send_aad_logs: bool + :param send_subscription_logs: Flag specifying if subscription logs should be sent for the + Monitor resource. + :type send_subscription_logs: bool + :param send_activity_logs: Flag specifying if activity logs from Azure resources should be sent + for the Monitor resource. + :type send_activity_logs: bool + :param filtering_tags: List of filtering tags to be used for capturing logs. This only takes + effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only + Exclude action is specified, the rules will apply to the list of all available resources. If + Include actions are specified, the rules will only include resources with the associated tags. + :type filtering_tags: list[~azure.mgmt.elastic.models.FilteringTag] + """ + + _attribute_map = { + 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, + 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, + 'send_activity_logs': {'key': 'sendActivityLogs', 'type': 'bool'}, + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__( + self, + **kwargs + ): + super(LogRules, self).__init__(**kwargs) + self.send_aad_logs = kwargs.get('send_aad_logs', None) + self.send_subscription_logs = kwargs.get('send_subscription_logs', None) + self.send_activity_logs = kwargs.get('send_activity_logs', None) + self.filtering_tags = kwargs.get('filtering_tags', None) + + +class MonitoredResource(msrest.serialization.Model): + """The properties of a resource currently being monitored by the Elastic monitor resource. + + :param id: The ARM id of the resource. + :type id: str + :param sending_logs: Flag indicating the status of the resource for sending logs operation to + Elastic. Possible values include: "True", "False". + :type sending_logs: str or ~azure.mgmt.elastic.models.SendingLogs + :param reason_for_logs_status: Reason for why the resource is sending logs (or why it is not + sending). + :type reason_for_logs_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sending_logs': {'key': 'sendingLogs', 'type': 'str'}, + 'reason_for_logs_status': {'key': 'reasonForLogsStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoredResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.sending_logs = kwargs.get('sending_logs', None) + self.reason_for_logs_status = kwargs.get('reason_for_logs_status', None) + + +class MonitoredResourceListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.MonitoredResource] + :param next_link: Link to the next set of results, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoredResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoredResourceListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class MonitoringTagRules(msrest.serialization.Model): + """Capture logs and metrics of Azure resources based on ARM tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the rule set. + :vartype name: str + :ivar id: The id of the rule set. + :vartype id: str + :ivar type: The type of the rule set. + :vartype type: str + :param properties: Properties of the monitoring tag rules. + :type properties: ~azure.mgmt.elastic.models.MonitoringTagRulesProperties + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringTagRules, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = kwargs.get('properties', None) + self.system_data = None + + +class MonitoringTagRulesListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.MonitoringTagRules] + :param next_link: Link to the next set of results, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringTagRules]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringTagRulesListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class MonitoringTagRulesProperties(msrest.serialization.Model): + """Definition of the properties for a TagRules resource. + + :param provisioning_state: Provisioning state of the monitoring tag rules. Possible values + include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", + "Deleted", "NotSpecified". + :type provisioning_state: str or ~azure.mgmt.elastic.models.ProvisioningState + :param log_rules: Rules for sending logs. + :type log_rules: ~azure.mgmt.elastic.models.LogRules + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitoringTagRulesProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.log_rules = kwargs.get('log_rules', None) + + +class MonitorProperties(msrest.serialization.Model): + """Properties specific to the monitor resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param provisioning_state: Provisioning state of the monitor resource. Possible values include: + "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", + "NotSpecified". + :type provisioning_state: str or ~azure.mgmt.elastic.models.ProvisioningState + :param monitoring_status: Flag specifying if the resource monitoring is enabled or disabled. + Possible values include: "Enabled", "Disabled". + :type monitoring_status: str or ~azure.mgmt.elastic.models.MonitoringStatus + :param elastic_properties: Elastic cloud properties. + :type elastic_properties: ~azure.mgmt.elastic.models.ElasticProperties + :param user_info: User information. + :type user_info: ~azure.mgmt.elastic.models.UserInfo + :ivar liftr_resource_category: Possible values include: "Unknown", "MonitorLogs". + :vartype liftr_resource_category: str or ~azure.mgmt.elastic.models.LiftrResourceCategories + :ivar liftr_resource_preference: The priority of the resource. + :vartype liftr_resource_preference: int + """ + + _validation = { + 'liftr_resource_category': {'readonly': True}, + 'liftr_resource_preference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + 'elastic_properties': {'key': 'elasticProperties', 'type': 'ElasticProperties'}, + 'user_info': {'key': 'userInfo', 'type': 'UserInfo'}, + 'liftr_resource_category': {'key': 'liftrResourceCategory', 'type': 'str'}, + 'liftr_resource_preference': {'key': 'liftrResourcePreference', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(MonitorProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.monitoring_status = kwargs.get('monitoring_status', None) + self.elastic_properties = kwargs.get('elastic_properties', None) + self.user_info = kwargs.get('user_info', None) + self.liftr_resource_category = None + self.liftr_resource_preference = None + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider, i.e., Microsoft.Elastic. + :type provider: str + :param resource: Type on which the operation is performed, e.g., 'monitors'. + :type resource: str + :param operation: Operation type, e.g., read, write, delete, etc. + :type operation: str + :param description: Description of the operation, e.g., 'Write monitors'. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationListResult(msrest.serialization.Model): + """Result of GET request to list the Microsoft.Elastic operations. + + :param value: List of operations supported by the Microsoft.Elastic provider. + :type value: list[~azure.mgmt.elastic.models.OperationResult] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OperationResult(msrest.serialization.Model): + """A Microsoft.Elastic REST API operation. + + :param name: Operation name, i.e., {provider}/{resource}/{operation}. + :type name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param display: The object that represents the operation. + :type display: ~azure.mgmt.elastic.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + + +class ResourceProviderDefaultErrorResponse(msrest.serialization.Model): + """RP default error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Response body of Error. + :vartype error: ~azure.mgmt.elastic.models.ErrorResponseBody + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ResourceSku(msrest.serialization.Model): + """Microsoft.Elastic SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSku, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.elastic.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.elastic.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class UserInfo(msrest.serialization.Model): + """User Information to be passed to partners. + + :param first_name: First name of the user. + :type first_name: str + :param last_name: Last name of the user. + :type last_name: str + :param company_name: Company name of the user. + :type company_name: str + :param email_address: Email of the user used by Elastic for contacting them if needed. + :type email_address: str + :param company_info: Company information of the user to be passed to partners. + :type company_info: ~azure.mgmt.elastic.models.CompanyInfo + """ + + _validation = { + 'first_name': {'max_length': 50, 'min_length': 0}, + 'last_name': {'max_length': 50, 'min_length': 0}, + 'company_name': {'max_length': 50, 'min_length': 0}, + 'email_address': {'pattern': r'^([^<>()\[\]\.,;:\s@"]+(\.[^<>()\[\]\.,;:\s@"]+)*)@(([a-zA-Z-_0-9]+\.)+[a-zA-Z]{2,})$'}, + } + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'company_info': {'key': 'companyInfo', 'type': 'CompanyInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(UserInfo, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.company_name = kwargs.get('company_name', None) + self.email_address = kwargs.get('email_address', None) + self.company_info = kwargs.get('company_info', None) + + +class VmCollectionUpdate(msrest.serialization.Model): + """Update VM resource collection. + + :param vm_resource_id: ARM id of the VM resource. + :type vm_resource_id: str + :param operation_name: Operation to be performed for given VM. Possible values include: "Add", + "Delete". + :type operation_name: str or ~azure.mgmt.elastic.models.OperationName + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VmCollectionUpdate, self).__init__(**kwargs) + self.vm_resource_id = kwargs.get('vm_resource_id', None) + self.operation_name = kwargs.get('operation_name', None) + + +class VmHostListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.VmResources] + :param next_link: Link to the next Vm resource Id, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VmResources]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VmHostListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VmIngestionDetailsResponse(msrest.serialization.Model): + """The vm ingestion details to install an agent. + + :param cloud_id: The cloudId of given Elastic monitor resource. + :type cloud_id: str + :param ingestion_key: Ingestion details to install agent on given VM. + :type ingestion_key: str + """ + + _attribute_map = { + 'cloud_id': {'key': 'cloudId', 'type': 'str'}, + 'ingestion_key': {'key': 'ingestionKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VmIngestionDetailsResponse, self).__init__(**kwargs) + self.cloud_id = kwargs.get('cloud_id', None) + self.ingestion_key = kwargs.get('ingestion_key', None) + + +class VmResources(msrest.serialization.Model): + """The vm resource properties that is currently being monitored by the Elastic monitor resource. + + :param vm_resource_id: The ARM id of the VM resource. + :type vm_resource_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VmResources, self).__init__(**kwargs) + self.vm_resource_id = kwargs.get('vm_resource_id', None) diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/models/_models_py3.py b/src/elastic/azext_elastic/vendored_sdks/elastic/models/_models_py3.py new file mode 100644 index 00000000000..b1bd4b9a6bb --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/models/_models_py3.py @@ -0,0 +1,1041 @@ +# 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 datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._microsoft_elastic_enums import * + + +class CompanyInfo(msrest.serialization.Model): + """Company information of the user to be passed to partners. + + :param domain: Domain of the company. + :type domain: str + :param business: Business of the company. + :type business: str + :param employees_number: Number of employees in the company. + :type employees_number: str + :param state: State of the company location. + :type state: str + :param country: Country of the company location. + :type country: str + """ + + _validation = { + 'domain': {'max_length': 250, 'min_length': 0}, + 'business': {'max_length': 50, 'min_length': 0}, + 'employees_number': {'max_length': 20, 'min_length': 0}, + 'state': {'max_length': 50, 'min_length': 0}, + 'country': {'max_length': 50, 'min_length': 0}, + } + + _attribute_map = { + 'domain': {'key': 'domain', 'type': 'str'}, + 'business': {'key': 'business', 'type': 'str'}, + 'employees_number': {'key': 'employeesNumber', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__( + self, + *, + domain: Optional[str] = None, + business: Optional[str] = None, + employees_number: Optional[str] = None, + state: Optional[str] = None, + country: Optional[str] = None, + **kwargs + ): + super(CompanyInfo, self).__init__(**kwargs) + self.domain = domain + self.business = business + self.employees_number = employees_number + self.state = state + self.country = country + + +class DeploymentInfoResponse(msrest.serialization.Model): + """The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The Elastic deployment status. Possible values include: "Healthy", "Unhealthy". + :vartype status: str or ~azure.mgmt.elastic.models.ElasticDeploymentStatus + :ivar version: Version of the elasticsearch in Elastic cloud deployment. + :vartype version: str + :ivar memory_capacity: RAM capacity of the elasticsearch in Elastic cloud deployment. + :vartype memory_capacity: str + :ivar disk_capacity: Disk capacity of the elasticsearch in Elastic cloud deployment. + :vartype disk_capacity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'version': {'readonly': True}, + 'memory_capacity': {'readonly': True}, + 'disk_capacity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'memory_capacity': {'key': 'memoryCapacity', 'type': 'str'}, + 'disk_capacity': {'key': 'diskCapacity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentInfoResponse, self).__init__(**kwargs) + self.status = None + self.version = None + self.memory_capacity = None + self.disk_capacity = None + + +class ElasticCloudDeployment(msrest.serialization.Model): + """Details of the user's elastic deployment associated with the monitor resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Elastic deployment name. + :vartype name: str + :ivar deployment_id: Elastic deployment Id. + :vartype deployment_id: str + :ivar azure_subscription_id: Associated Azure subscription Id for the elastic deployment. + :vartype azure_subscription_id: str + :ivar elasticsearch_region: Region where Deployment at Elastic side took place. + :vartype elasticsearch_region: str + :ivar elasticsearch_service_url: Elasticsearch ingestion endpoint of the Elastic deployment. + :vartype elasticsearch_service_url: str + :ivar kibana_service_url: Kibana endpoint of the Elastic deployment. + :vartype kibana_service_url: str + :ivar kibana_sso_url: Kibana dashboard sso URL of the Elastic deployment. + :vartype kibana_sso_url: str + """ + + _validation = { + 'name': {'readonly': True}, + 'deployment_id': {'readonly': True}, + 'azure_subscription_id': {'readonly': True}, + 'elasticsearch_region': {'readonly': True}, + 'elasticsearch_service_url': {'readonly': True}, + 'kibana_service_url': {'readonly': True}, + 'kibana_sso_url': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, + 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, + 'elasticsearch_region': {'key': 'elasticsearchRegion', 'type': 'str'}, + 'elasticsearch_service_url': {'key': 'elasticsearchServiceUrl', 'type': 'str'}, + 'kibana_service_url': {'key': 'kibanaServiceUrl', 'type': 'str'}, + 'kibana_sso_url': {'key': 'kibanaSsoUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticCloudDeployment, self).__init__(**kwargs) + self.name = None + self.deployment_id = None + self.azure_subscription_id = None + self.elasticsearch_region = None + self.elasticsearch_service_url = None + self.kibana_service_url = None + self.kibana_sso_url = None + + +class ElasticCloudUser(msrest.serialization.Model): + """Details of the user's elastic account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar email_address: Email of the Elastic User Account. + :vartype email_address: str + :ivar id: User Id of the elastic account of the User. + :vartype id: str + :ivar elastic_cloud_sso_default_url: Elastic cloud default dashboard sso URL of the Elastic + user account. + :vartype elastic_cloud_sso_default_url: str + """ + + _validation = { + 'email_address': {'readonly': True}, + 'id': {'readonly': True}, + 'elastic_cloud_sso_default_url': {'readonly': True}, + } + + _attribute_map = { + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'elastic_cloud_sso_default_url': {'key': 'elasticCloudSsoDefaultUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ElasticCloudUser, self).__init__(**kwargs) + self.email_address = None + self.id = None + self.elastic_cloud_sso_default_url = None + + +class ElasticMonitorResource(msrest.serialization.Model): + """Monitor 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: ARM id of the monitor resource. + :vartype id: str + :ivar name: Name of the monitor resource. + :vartype name: str + :ivar type: The type of the monitor resource. + :vartype type: str + :param sku: SKU of the monitor resource. + :type sku: ~azure.mgmt.elastic.models.ResourceSku + :param properties: Properties of the monitor resource. + :type properties: ~azure.mgmt.elastic.models.MonitorProperties + :param identity: Identity properties of the monitor resource. + :type identity: ~azure.mgmt.elastic.models.IdentityProperties + :param tags: A set of tags. The tags of the monitor resource. + :type tags: dict[str, str] + :param location: Required. The location of the monitor resource. + :type location: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'MonitorProperties'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + location: str, + sku: Optional["ResourceSku"] = None, + properties: Optional["MonitorProperties"] = None, + identity: Optional["IdentityProperties"] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ElasticMonitorResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.sku = sku + self.properties = properties + self.identity = identity + self.tags = tags + self.location = location + self.system_data = None + + +class ElasticMonitorResourceListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.ElasticMonitorResource] + :param next_link: Link to the next set of results, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ElasticMonitorResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ElasticMonitorResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ElasticMonitorResourceListResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ElasticMonitorResourceUpdateParameters(msrest.serialization.Model): + """Monitor resource update parameters. + + :param tags: A set of tags. elastic monitor 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(ElasticMonitorResourceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class ElasticProperties(msrest.serialization.Model): + """Elastic Resource Properties. + + :param elastic_cloud_user: Details of the user's elastic account. + :type elastic_cloud_user: ~azure.mgmt.elastic.models.ElasticCloudUser + :param elastic_cloud_deployment: Details of the elastic cloud deployment. + :type elastic_cloud_deployment: ~azure.mgmt.elastic.models.ElasticCloudDeployment + """ + + _attribute_map = { + 'elastic_cloud_user': {'key': 'elasticCloudUser', 'type': 'ElasticCloudUser'}, + 'elastic_cloud_deployment': {'key': 'elasticCloudDeployment', 'type': 'ElasticCloudDeployment'}, + } + + def __init__( + self, + *, + elastic_cloud_user: Optional["ElasticCloudUser"] = None, + elastic_cloud_deployment: Optional["ElasticCloudDeployment"] = None, + **kwargs + ): + super(ElasticProperties, self).__init__(**kwargs) + self.elastic_cloud_user = elastic_cloud_user + self.elastic_cloud_deployment = elastic_cloud_deployment + + +class ErrorResponseBody(msrest.serialization.Model): + """Error response body. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :param target: Error target. + :type target: str + :param details: Error details. + :type details: list[~azure.mgmt.elastic.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ErrorResponseBody"]] = None, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class FilteringTag(msrest.serialization.Model): + """The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from being monitored. + + :param name: The name (also known as the key) of the tag. + :type name: str + :param value: The value of the tag. + :type value: str + :param action: Valid actions for a filtering tag. Possible values include: "Include", + "Exclude". + :type action: str or ~azure.mgmt.elastic.models.TagAction + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + action: Optional[Union[str, "TagAction"]] = None, + **kwargs + ): + super(FilteringTag, self).__init__(**kwargs) + self.name = name + self.value = value + self.action = action + + +class IdentityProperties(msrest.serialization.Model): + """Identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The identity ID. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Managed identity type. Possible values include: "SystemAssigned". + :type type: str or ~azure.mgmt.elastic.models.ManagedIdentityTypes + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ManagedIdentityTypes"]] = None, + **kwargs + ): + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class LogRules(msrest.serialization.Model): + """Set of rules for sending logs for the Monitor resource. + + :param send_aad_logs: Flag specifying if AAD logs should be sent for the Monitor resource. + :type send_aad_logs: bool + :param send_subscription_logs: Flag specifying if subscription logs should be sent for the + Monitor resource. + :type send_subscription_logs: bool + :param send_activity_logs: Flag specifying if activity logs from Azure resources should be sent + for the Monitor resource. + :type send_activity_logs: bool + :param filtering_tags: List of filtering tags to be used for capturing logs. This only takes + effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only + Exclude action is specified, the rules will apply to the list of all available resources. If + Include actions are specified, the rules will only include resources with the associated tags. + :type filtering_tags: list[~azure.mgmt.elastic.models.FilteringTag] + """ + + _attribute_map = { + 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, + 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, + 'send_activity_logs': {'key': 'sendActivityLogs', 'type': 'bool'}, + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__( + self, + *, + send_aad_logs: Optional[bool] = None, + send_subscription_logs: Optional[bool] = None, + send_activity_logs: Optional[bool] = None, + filtering_tags: Optional[List["FilteringTag"]] = None, + **kwargs + ): + super(LogRules, self).__init__(**kwargs) + self.send_aad_logs = send_aad_logs + self.send_subscription_logs = send_subscription_logs + self.send_activity_logs = send_activity_logs + self.filtering_tags = filtering_tags + + +class MonitoredResource(msrest.serialization.Model): + """The properties of a resource currently being monitored by the Elastic monitor resource. + + :param id: The ARM id of the resource. + :type id: str + :param sending_logs: Flag indicating the status of the resource for sending logs operation to + Elastic. Possible values include: "True", "False". + :type sending_logs: str or ~azure.mgmt.elastic.models.SendingLogs + :param reason_for_logs_status: Reason for why the resource is sending logs (or why it is not + sending). + :type reason_for_logs_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sending_logs': {'key': 'sendingLogs', 'type': 'str'}, + 'reason_for_logs_status': {'key': 'reasonForLogsStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + sending_logs: Optional[Union[str, "SendingLogs"]] = None, + reason_for_logs_status: Optional[str] = None, + **kwargs + ): + super(MonitoredResource, self).__init__(**kwargs) + self.id = id + self.sending_logs = sending_logs + self.reason_for_logs_status = reason_for_logs_status + + +class MonitoredResourceListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.MonitoredResource] + :param next_link: Link to the next set of results, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoredResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MonitoredResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(MonitoredResourceListResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class MonitoringTagRules(msrest.serialization.Model): + """Capture logs and metrics of Azure resources based on ARM tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the rule set. + :vartype name: str + :ivar id: The id of the rule set. + :vartype id: str + :ivar type: The type of the rule set. + :vartype type: str + :param properties: Properties of the monitoring tag rules. + :type properties: ~azure.mgmt.elastic.models.MonitoringTagRulesProperties + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + properties: Optional["MonitoringTagRulesProperties"] = None, + **kwargs + ): + super(MonitoringTagRules, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = properties + self.system_data = None + + +class MonitoringTagRulesListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.MonitoringTagRules] + :param next_link: Link to the next set of results, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MonitoringTagRules]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MonitoringTagRules"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(MonitoringTagRulesListResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class MonitoringTagRulesProperties(msrest.serialization.Model): + """Definition of the properties for a TagRules resource. + + :param provisioning_state: Provisioning state of the monitoring tag rules. Possible values + include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", + "Deleted", "NotSpecified". + :type provisioning_state: str or ~azure.mgmt.elastic.models.ProvisioningState + :param log_rules: Rules for sending logs. + :type log_rules: ~azure.mgmt.elastic.models.LogRules + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + log_rules: Optional["LogRules"] = None, + **kwargs + ): + super(MonitoringTagRulesProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.log_rules = log_rules + + +class MonitorProperties(msrest.serialization.Model): + """Properties specific to the monitor resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param provisioning_state: Provisioning state of the monitor resource. Possible values include: + "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", + "NotSpecified". + :type provisioning_state: str or ~azure.mgmt.elastic.models.ProvisioningState + :param monitoring_status: Flag specifying if the resource monitoring is enabled or disabled. + Possible values include: "Enabled", "Disabled". + :type monitoring_status: str or ~azure.mgmt.elastic.models.MonitoringStatus + :param elastic_properties: Elastic cloud properties. + :type elastic_properties: ~azure.mgmt.elastic.models.ElasticProperties + :param user_info: User information. + :type user_info: ~azure.mgmt.elastic.models.UserInfo + :ivar liftr_resource_category: Possible values include: "Unknown", "MonitorLogs". + :vartype liftr_resource_category: str or ~azure.mgmt.elastic.models.LiftrResourceCategories + :ivar liftr_resource_preference: The priority of the resource. + :vartype liftr_resource_preference: int + """ + + _validation = { + 'liftr_resource_category': {'readonly': True}, + 'liftr_resource_preference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + 'elastic_properties': {'key': 'elasticProperties', 'type': 'ElasticProperties'}, + 'user_info': {'key': 'userInfo', 'type': 'UserInfo'}, + 'liftr_resource_category': {'key': 'liftrResourceCategory', 'type': 'str'}, + 'liftr_resource_preference': {'key': 'liftrResourcePreference', 'type': 'int'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + monitoring_status: Optional[Union[str, "MonitoringStatus"]] = None, + elastic_properties: Optional["ElasticProperties"] = None, + user_info: Optional["UserInfo"] = None, + **kwargs + ): + super(MonitorProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.monitoring_status = monitoring_status + self.elastic_properties = elastic_properties + self.user_info = user_info + self.liftr_resource_category = None + self.liftr_resource_preference = None + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider, i.e., Microsoft.Elastic. + :type provider: str + :param resource: Type on which the operation is performed, e.g., 'monitors'. + :type resource: str + :param operation: Operation type, e.g., read, write, delete, etc. + :type operation: str + :param description: Description of the operation, e.g., 'Write monitors'. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of GET request to list the Microsoft.Elastic operations. + + :param value: List of operations supported by the Microsoft.Elastic provider. + :type value: list[~azure.mgmt.elastic.models.OperationResult] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["OperationResult"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationResult(msrest.serialization.Model): + """A Microsoft.Elastic REST API operation. + + :param name: Operation name, i.e., {provider}/{resource}/{operation}. + :type name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param display: The object that represents the operation. + :type display: ~azure.mgmt.elastic.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + **kwargs + ): + super(OperationResult, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + + +class ResourceProviderDefaultErrorResponse(msrest.serialization.Model): + """RP default error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Response body of Error. + :vartype error: ~azure.mgmt.elastic.models.ErrorResponseBody + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ResourceSku(msrest.serialization.Model): + """Microsoft.Elastic SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(ResourceSku, self).__init__(**kwargs) + self.name = name + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.elastic.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.elastic.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class UserInfo(msrest.serialization.Model): + """User Information to be passed to partners. + + :param first_name: First name of the user. + :type first_name: str + :param last_name: Last name of the user. + :type last_name: str + :param company_name: Company name of the user. + :type company_name: str + :param email_address: Email of the user used by Elastic for contacting them if needed. + :type email_address: str + :param company_info: Company information of the user to be passed to partners. + :type company_info: ~azure.mgmt.elastic.models.CompanyInfo + """ + + _validation = { + 'first_name': {'max_length': 50, 'min_length': 0}, + 'last_name': {'max_length': 50, 'min_length': 0}, + 'company_name': {'max_length': 50, 'min_length': 0}, + 'email_address': {'pattern': r'^([^<>()\[\]\.,;:\s@"]+(\.[^<>()\[\]\.,;:\s@"]+)*)@(([a-zA-Z-_0-9]+\.)+[a-zA-Z]{2,})$'}, + } + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'company_info': {'key': 'companyInfo', 'type': 'CompanyInfo'}, + } + + def __init__( + self, + *, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + company_name: Optional[str] = None, + email_address: Optional[str] = None, + company_info: Optional["CompanyInfo"] = None, + **kwargs + ): + super(UserInfo, self).__init__(**kwargs) + self.first_name = first_name + self.last_name = last_name + self.company_name = company_name + self.email_address = email_address + self.company_info = company_info + + +class VmCollectionUpdate(msrest.serialization.Model): + """Update VM resource collection. + + :param vm_resource_id: ARM id of the VM resource. + :type vm_resource_id: str + :param operation_name: Operation to be performed for given VM. Possible values include: "Add", + "Delete". + :type operation_name: str or ~azure.mgmt.elastic.models.OperationName + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_resource_id: Optional[str] = None, + operation_name: Optional[Union[str, "OperationName"]] = None, + **kwargs + ): + super(VmCollectionUpdate, self).__init__(**kwargs) + self.vm_resource_id = vm_resource_id + self.operation_name = operation_name + + +class VmHostListResponse(msrest.serialization.Model): + """Response of a list operation. + + :param value: Results of a list operation. + :type value: list[~azure.mgmt.elastic.models.VmResources] + :param next_link: Link to the next Vm resource Id, if any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VmResources]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VmResources"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VmHostListResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VmIngestionDetailsResponse(msrest.serialization.Model): + """The vm ingestion details to install an agent. + + :param cloud_id: The cloudId of given Elastic monitor resource. + :type cloud_id: str + :param ingestion_key: Ingestion details to install agent on given VM. + :type ingestion_key: str + """ + + _attribute_map = { + 'cloud_id': {'key': 'cloudId', 'type': 'str'}, + 'ingestion_key': {'key': 'ingestionKey', 'type': 'str'}, + } + + def __init__( + self, + *, + cloud_id: Optional[str] = None, + ingestion_key: Optional[str] = None, + **kwargs + ): + super(VmIngestionDetailsResponse, self).__init__(**kwargs) + self.cloud_id = cloud_id + self.ingestion_key = ingestion_key + + +class VmResources(msrest.serialization.Model): + """The vm resource properties that is currently being monitored by the Elastic monitor resource. + + :param vm_resource_id: The ARM id of the VM resource. + :type vm_resource_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_resource_id: Optional[str] = None, + **kwargs + ): + super(VmResources, self).__init__(**kwargs) + self.vm_resource_id = vm_resource_id diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/__init__.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/__init__.py new file mode 100644 index 00000000000..b02fb6186c2 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/__init__.py @@ -0,0 +1,27 @@ +# 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 ._operations import Operations +from ._monitors_operations import MonitorsOperations +from ._monitored_resources_operations import MonitoredResourcesOperations +from ._deployment_info_operations import DeploymentInfoOperations +from ._tag_rules_operations import TagRulesOperations +from ._vm_host_operations import VmHostOperations +from ._vm_ingestion_operations import VmIngestionOperations +from ._vm_collection_operations import VmCollectionOperations + +__all__ = [ + 'Operations', + 'MonitorsOperations', + 'MonitoredResourcesOperations', + 'DeploymentInfoOperations', + 'TagRulesOperations', + 'VmHostOperations', + 'VmIngestionOperations', + 'VmCollectionOperations', +] diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_deployment_info_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_deployment_info_operations.py new file mode 100644 index 00000000000..8762441d82c --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_deployment_info_operations.py @@ -0,0 +1,109 @@ +# 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.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, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DeploymentInfoOperations(object): + """DeploymentInfoOperations 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: ~azure.mgmt.elastic.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( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DeploymentInfoResponse" + """Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. + + Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor + resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentInfoResponse, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.DeploymentInfoResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DeploymentInfoResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentInfoResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listDeploymentInfo'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitored_resources_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitored_resources_operations.py new file mode 100644 index 00000000000..9e07a53275a --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitored_resources_operations.py @@ -0,0 +1,125 @@ +# 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 + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MonitoredResourcesOperations(object): + """MonitoredResourcesOperations 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: ~azure.mgmt.elastic.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( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MonitoredResourceListResponse"] + """List the resources currently being monitored by the Elastic monitor resource. + + List the resources currently being monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoredResourceListResponse or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.MonitoredResourceListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoredResourceListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(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('MonitoredResourceListResponse', 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.ResourceProviderDefaultErrorResponse, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listMonitoredResources'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitors_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitors_operations.py new file mode 100644 index 00000000000..75c61f931a2 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_monitors_operations.py @@ -0,0 +1,581 @@ +# 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.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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 MonitorsOperations(object): + """MonitorsOperations 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: ~azure.mgmt.elastic.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( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ElasticMonitorResourceListResponse"] + """List all monitors under the specified subscription. + + List all monitors under 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 ElasticMonitorResourceListResponse or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.ElasticMonitorResourceListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResourceListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + 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('ElasticMonitorResourceListResponse', 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.ResourceProviderDefaultErrorResponse, 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/monitors'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ElasticMonitorResourceListResponse"] + """List all monitors under the specified resource group. + + List all monitors under the specified resource group. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :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 ElasticMonitorResourceListResponse or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.ElasticMonitorResourceListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResourceListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + 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('ElasticMonitorResourceListResponse', 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.ResourceProviderDefaultErrorResponse, 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.Elastic/monitors'} # type: ignore + + def get( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ElasticMonitorResource" + """Get the properties of a specific monitor resource. + + Get the properties of a specific monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElasticMonitorResource, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.ElasticMonitorResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + monitor_name, # type: str + body=None, # type: Optional["models.ElasticMonitorResource"] + **kwargs # type: Any + ): + # type: (...) -> "models.ElasticMonitorResource" + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 'ElasticMonitorResource') + 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + monitor_name, # type: str + body=None, # type: Optional["models.ElasticMonitorResource"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.ElasticMonitorResource"] + """Create a monitor resource. + + Create a monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param body: Elastic monitor resource model. + :type body: ~azure.mgmt.elastic.models.ElasticMonitorResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ElasticMonitorResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.elastic.models.ElasticMonitorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + monitor_name, # type: str + body=None, # type: Optional["models.ElasticMonitorResourceUpdateParameters"] + **kwargs # type: Any + ): + # type: (...) -> "models.ElasticMonitorResource" + """Update a monitor resource. + + Update a monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param body: Elastic resource model update parameters. + :type body: ~azure.mgmt.elastic.models.ElasticMonitorResourceUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ElasticMonitorResource, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.ElasticMonitorResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ElasticMonitorResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 'ElasticMonitorResourceUpdateParameters') + 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ElasticMonitorResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + 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 = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a monitor resource. + + Delete a monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_operations.py new file mode 100644 index 00000000000..2910d1a59e1 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_operations.py @@ -0,0 +1,112 @@ +# 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 + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations 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: ~azure.mgmt.elastic.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( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] + """List all operations provided by Microsoft.Elastic. + + List all operations provided by Microsoft.Elastic. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + # 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('OperationListResult', 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.ResourceProviderDefaultErrorResponse, 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.metadata = {'url': '/providers/Microsoft.Elastic/operations'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_tag_rules_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_tag_rules_operations.py new file mode 100644 index 00000000000..0e5aeb570af --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_tag_rules_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.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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 TagRulesOperations(object): + """TagRulesOperations 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: ~azure.mgmt.elastic.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( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.MonitoringTagRulesListResponse"] + """List the tag rules for a given monitor resource. + + List the tag rules for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MonitoringTagRulesListResponse or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.MonitoringTagRulesListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRulesListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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('MonitoringTagRulesListResponse', 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.ResourceProviderDefaultErrorResponse, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + monitor_name, # type: str + rule_set_name, # type: str + body=None, # type: Optional["models.MonitoringTagRules"] + **kwargs # type: Any + ): + # type: (...) -> "models.MonitoringTagRules" + """Create or update a tag rule set for a given monitor resource. + + Create or update a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name. + :type rule_set_name: str + :param body: request body of MonitoringTagRules. + :type body: ~azure.mgmt.elastic.models.MonitoringTagRules + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringTagRules, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.MonitoringTagRules + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRules"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + 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, 'MonitoringTagRules') + 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringTagRules', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + monitor_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.MonitoringTagRules" + """Get a tag rule set for a given monitor resource. + + Get a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MonitoringTagRules, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.MonitoringTagRules + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRules"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + 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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MonitoringTagRules', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + monitor_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + 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 = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + 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, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + monitor_name, # type: str + rule_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a tag rule set for a given monitor resource. + + Delete a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name. + :type rule_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + rule_set_name=rule_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_collection_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_collection_operations.py new file mode 100644 index 00000000000..4ea8f86d719 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_collection_operations.py @@ -0,0 +1,116 @@ +# 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.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, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VmCollectionOperations(object): + """VmCollectionOperations 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: ~azure.mgmt.elastic.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 update( + self, + resource_group_name, # type: str + monitor_name, # type: str + body=None, # type: Optional["models.VmCollectionUpdate"] + **kwargs # type: Any + ): + # type: (...) -> None + """Update the vm details that will be monitored by the Elastic monitor resource. + + Update the vm details that will be monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :param body: VM resource Id. + :type body: ~azure.mgmt.elastic.models.VmCollectionUpdate + :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 = "2020-07-01" + 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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, 'VmCollectionUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmCollectionUpdate'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_host_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_host_operations.py new file mode 100644 index 00000000000..35966e102d1 --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_host_operations.py @@ -0,0 +1,125 @@ +# 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 + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VmHostOperations(object): + """VmHostOperations 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: ~azure.mgmt.elastic.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( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VmHostListResponse"] + """List the vm resources currently being monitored by the Elastic monitor resource. + + List the vm resources currently being monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VmHostListResponse or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.elastic.models.VmHostListResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VmHostListResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(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('VmHostListResponse', 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.ResourceProviderDefaultErrorResponse, 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listVMHost'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_ingestion_operations.py b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_ingestion_operations.py new file mode 100644 index 00000000000..626313f218b --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/operations/_vm_ingestion_operations.py @@ -0,0 +1,108 @@ +# 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.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, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VmIngestionOperations(object): + """VmIngestionOperations 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: ~azure.mgmt.elastic.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 details( + self, + resource_group_name, # type: str + monitor_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VmIngestionDetailsResponse" + """List the vm ingestion details that will be monitored by the Elastic monitor resource. + + List the vm ingestion details that will be monitored by the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which the Elastic resource + belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name. + :type monitor_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VmIngestionDetailsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.elastic.models.VmIngestionDetailsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VmIngestionDetailsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01" + accept = "application/json" + + # Construct URL + url = self.details.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + } + 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.post(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.ResourceProviderDefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VmIngestionDetailsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmIngestionDetails'} # type: ignore diff --git a/src/elastic/azext_elastic/vendored_sdks/elastic/py.typed b/src/elastic/azext_elastic/vendored_sdks/elastic/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/elastic/azext_elastic/vendored_sdks/elastic/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/elastic/report.md b/src/elastic/report.md new file mode 100644 index 00000000000..3bb681d5d89 --- /dev/null +++ b/src/elastic/report.md @@ -0,0 +1,261 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az elastic|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az elastic` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az elastic monitor|Monitors|[commands](#CommandsInMonitors)| +|az elastic monitor tag-rule|TagRules|[commands](#CommandsInTagRules)| + +## COMMANDS +### Commands in `az elastic monitor` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az elastic monitor list](#MonitorsListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersMonitorsListByResourceGroup)|[Example](#ExamplesMonitorsListByResourceGroup)| +|[az elastic monitor list](#MonitorsList)|List|[Parameters](#ParametersMonitorsList)|[Example](#ExamplesMonitorsList)| +|[az elastic monitor show](#MonitorsGet)|Get|[Parameters](#ParametersMonitorsGet)|[Example](#ExamplesMonitorsGet)| +|[az elastic monitor create](#MonitorsCreate)|Create|[Parameters](#ParametersMonitorsCreate)|[Example](#ExamplesMonitorsCreate)| +|[az elastic monitor update](#MonitorsUpdate)|Update|[Parameters](#ParametersMonitorsUpdate)|[Example](#ExamplesMonitorsUpdate)| +|[az elastic monitor delete](#MonitorsDelete)|Delete|[Parameters](#ParametersMonitorsDelete)|[Example](#ExamplesMonitorsDelete)| +|[az elastic monitor list-deployment-info](#MonitorsList)|List|[Parameters](#ParametersMonitorsList)|[Example](#ExamplesMonitorsList)| +|[az elastic monitor list-resource](#MonitorsList)|List|[Parameters](#ParametersMonitorsList)|[Example](#ExamplesMonitorsList)| +|[az elastic monitor list-vm-host](#MonitorsList)|List|[Parameters](#ParametersMonitorsList)|[Example](#ExamplesMonitorsList)| +|[az elastic monitor list-vm-ingestion-detail](#MonitorsDetails)|Details|[Parameters](#ParametersMonitorsDetails)|[Example](#ExamplesMonitorsDetails)| +|[az elastic monitor update-vm-collection](#MonitorsUpdate)|Update|[Parameters](#ParametersMonitorsUpdate)|[Example](#ExamplesMonitorsUpdate)| + +### Commands in `az elastic monitor tag-rule` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az elastic monitor tag-rule list](#TagRulesList)|List|[Parameters](#ParametersTagRulesList)|[Example](#ExamplesTagRulesList)| +|[az elastic monitor tag-rule show](#TagRulesGet)|Get|[Parameters](#ParametersTagRulesGet)|[Example](#ExamplesTagRulesGet)| +|[az elastic monitor tag-rule create](#TagRulesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersTagRulesCreateOrUpdate#Create)|[Example](#ExamplesTagRulesCreateOrUpdate#Create)| +|[az elastic monitor tag-rule update](#TagRulesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersTagRulesCreateOrUpdate#Update)|Not Found| +|[az elastic monitor tag-rule delete](#TagRulesDelete)|Delete|[Parameters](#ParametersTagRulesDelete)|[Example](#ExamplesTagRulesDelete)| + + +## COMMAND DETAILS +### group `az elastic monitor` +#### Command `az elastic monitor list` + +##### Example +``` +az elastic monitor list --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| + +#### Command `az elastic monitor list` + +##### Example +``` +az elastic monitor list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| + +#### Command `az elastic monitor show` + +##### Example +``` +az elastic monitor show --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor create` + +##### Example +``` +az elastic monitor create --name "myMonitor" --location "West US 2" --user-info "{\\"companyInfo\\":{\\"business\\":\\"\ +Technology\\",\\"country\\":\\"US\\",\\"domain\\":\\"microsoft.com\\",\\"employeeNumber\\":\\"10000\\",\\"state\\":\\"W\ +A\\"},\\"companyName\\":\\"Microsoft\\",\\"emailAddress\\":\\"alice@microsoft.com\\",\\"firstName\\":\\"Alice\\",\\"las\ +tName\\":\\"Bob\\"}" --sku "free_Monthly" --tags Environment="Dev" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--location**|string|The location of the monitor resource|location|location| +|**--tags**|dictionary|The tags of the monitor resource.|tags|tags| +|**--provisioning-state**|choice|Provisioning state of the monitor resource.|provisioning_state|provisioningState| +|**--monitoring-status**|choice|Flag specifying if the resource monitoring is enabled or disabled.|monitoring_status|monitoringStatus| +|**--elastic-properties**|object|Elastic cloud properties.|elastic_properties|elasticProperties| +|**--user-info**|object|User information.|user_info|userInfo| +|**--sku**|string|Name of the SKU.|sku|name| + +#### Command `az elastic monitor update` + +##### Example +``` +az elastic monitor update --name "myMonitor" --tags Environment="Dev" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--tags**|dictionary|elastic monitor resource tags.|tags|tags| + +#### Command `az elastic monitor delete` + +##### Example +``` +az elastic monitor delete --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor list-deployment-info` + +##### Example +``` +az elastic monitor list-deployment-info --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor list-resource` + +##### Example +``` +az elastic monitor list-resource --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor list-vm-host` + +##### Example +``` +az elastic monitor list-vm-host --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor list-vm-ingestion-detail` + +##### Example +``` +az elastic monitor list-vm-ingestion-detail --name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor update-vm-collection` + +##### Example +``` +az elastic monitor update-vm-collection --name "myMonitor" --operation-name "Add" --vm-resource-id \ +"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtual\ +machines/myVM" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--vm-resource-id**|string|ARM id of the VM resource.|vm_resource_id|vmResourceId| +|**--operation-name**|choice|Operation to be performed for given VM.|operation_name|operationName| + +### group `az elastic monitor tag-rule` +#### Command `az elastic monitor tag-rule list` + +##### Example +``` +az elastic monitor tag-rule list --monitor-name "myMonitor" --resource-group "myResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| + +#### Command `az elastic monitor tag-rule show` + +##### Example +``` +az elastic monitor tag-rule show --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name \ +"default" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--rule-set-name**|string|Tag Rule Set resource name|rule_set_name|ruleSetName| + +#### Command `az elastic monitor tag-rule create` + +##### Example +``` +az elastic monitor tag-rule create --monitor-name "myMonitor" --filtering-tags name="Environment" action="Include" \ +value="Prod" --filtering-tags name="Environment" action="Exclude" value="Dev" --send-aad-logs false \ +--send-activity-logs true --send-subscription-logs true --resource-group "myResourceGroup" --rule-set-name "default" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--rule-set-name**|string|Tag Rule Set resource name|rule_set_name|ruleSetName| +|**--provisioning-state**|choice|Provisioning state of the monitoring tag rules.|provisioning_state|provisioningState| +|**--send-aad-logs**|boolean|Flag specifying if AAD logs should be sent for the Monitor resource.|send_aad_logs|sendAadLogs| +|**--send-subscription-logs**|boolean|Flag specifying if subscription logs should be sent for the Monitor resource.|send_subscription_logs|sendSubscriptionLogs| +|**--send-activity-logs**|boolean|Flag specifying if activity logs from Azure resources should be sent for the Monitor resource.|send_activity_logs|sendActivityLogs| +|**--filtering-tags**|array|List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.|filtering_tags|filteringTags| + +#### Command `az elastic monitor tag-rule update` + + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--rule-set-name**|string|Tag Rule Set resource name|rule_set_name|ruleSetName| +|**--provisioning-state**|choice|Provisioning state of the monitoring tag rules.|provisioning_state|provisioningState| +|**--send-aad-logs**|boolean|Flag specifying if AAD logs should be sent for the Monitor resource.|send_aad_logs|sendAadLogs| +|**--send-subscription-logs**|boolean|Flag specifying if subscription logs should be sent for the Monitor resource.|send_subscription_logs|sendSubscriptionLogs| +|**--send-activity-logs**|boolean|Flag specifying if activity logs from Azure resources should be sent for the Monitor resource.|send_activity_logs|sendActivityLogs| +|**--filtering-tags**|array|List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.|filtering_tags|filteringTags| + +#### Command `az elastic monitor tag-rule delete` + +##### Example +``` +az elastic monitor tag-rule delete --monitor-name "myMonitor" --resource-group "myResourceGroup" --rule-set-name \ +"default" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group to which the Elastic resource belongs.|resource_group_name|resourceGroupName| +|**--monitor-name**|string|Monitor resource name|monitor_name|monitorName| +|**--rule-set-name**|string|Tag Rule Set resource name|rule_set_name|ruleSetName| diff --git a/src/elastic/setup.cfg b/src/elastic/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/elastic/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/elastic/setup.py b/src/elastic/setup.py new file mode 100644 index 00000000000..45f89fa2a22 --- /dev/null +++ b/src/elastic/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_elastic.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_elastic.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='elastic', + version=VERSION, + description='Microsoft Azure Command-Line Tools MicrosoftElastic Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/elastic', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_elastic': ['azext_metadata.json']}, +) diff --git a/src/service_name.json b/src/service_name.json index 84e98f4f131..6243faee830 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -149,6 +149,11 @@ "AzureServiceName": "Azure Digital Twins", "URL": "https://azure.microsoft.com/en-us/services/digital-twins/" }, + { + "Command": "az elastic", + "AzureServiceName": "Azure Elastic", + "URL": "https://docs.microsoft.com/en-us/azure/partner-solutions/elastic/overview" + }, { "Command": "az footprint", "AzureServiceName": "Azure Monitor",