diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 428af5bd6c9..473b8d88b85 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -107,3 +107,5 @@ /src/account/ @zikalino /src/datashare/ @fengzhou-msft + +/src/log-analytics-solution/ @zhoxing-ms diff --git a/src/log-analytics-solution/HISTORY.rst b/src/log-analytics-solution/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/log-analytics-solution/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/log-analytics-solution/README.md b/src/log-analytics-solution/README.md new file mode 100644 index 00000000000..52229940ab2 --- /dev/null +++ b/src/log-analytics-solution/README.md @@ -0,0 +1,56 @@ +# Azure CLI log-analytics-solution Extension # +This package is for the 'log-analytics-solution' extension, i.e. 'az monitor log-analytics solution' + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name log-analytics-solution +``` + +### Included Features +#### Log Analytics Solution Management: +Manage Log Analytics Solution: [more info](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/solutions) \ +*Examples:* + +##### Create a log-analytics solution for the plan product of OMSGallery/Containers +``` +az monitor log-analytics solution create \ + --resource-group MyResourceGroup \ + --name Containers({SolutionName}) \ + --plan-publisher Microsoft \ + --plan-product "OMSGallery/Containers" \ + --workspace "/subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/ \ + Microsoft.OperationalInsights/workspaces/{WorkspaceName}" \ + --tags key=value +``` + +##### Update a log-analytics solution +``` + az monitor log-analytics solution update \ + --resource-group MyResourceGroup \ + --name SolutionName \ + --tags key=value +``` + +##### Delete a log-analytics solution +``` +az monitor log-analytics solution delete --resource-group MyResourceGroup --name SolutionName +``` + +##### Get details about the specified log-analytics solution +``` +az monitor log-analytics solution show --resource-group MyResourceGroup --name SolutionName +``` + +##### List all of the log-analytics solutions in the specified subscription or resource group +``` +az monitor log-analytics solution list +``` +``` +az monitor log-analytics solution list --subscription MySubscription +``` +``` +az monitor log-analytics solution list --resource-group MyResourceGroup +``` + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. diff --git a/src/log-analytics-solution/azext_log_analytics_solution/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/__init__.py new file mode 100644 index 00000000000..5b8afb59574 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_log_analytics_solution._help import helps # pylint: disable=unused-import + + +class LogAnalyticsSolutionCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_log_analytics_solution._client_factory import cf_log_analytics_solution + log_analytics_solution_custom = CliCommandType( + operations_tmpl='azext_log_analytics_solution.custom#{}', + client_factory=cf_log_analytics_solution) + super(LogAnalyticsSolutionCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=log_analytics_solution_custom) + + def load_command_table(self, args): + from azext_log_analytics_solution.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_log_analytics_solution._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = LogAnalyticsSolutionCommandsLoader diff --git a/src/log-analytics-solution/azext_log_analytics_solution/_client_factory.py b/src/log-analytics-solution/azext_log_analytics_solution/_client_factory.py new file mode 100644 index 00000000000..ac7c5fb5d98 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/_client_factory.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_log_analytics_solution(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from .vendored_sdks.operationsmanagement import OperationsManagementClient + return get_mgmt_service_client(cli_ctx, OperationsManagementClient, provider_name="Microsoft.OperationsManagement", + resource_type="solutions", resource_name="") + + +def cf_solutions(cli_ctx, *_): + return cf_log_analytics_solution(cli_ctx, *_).solutions diff --git a/src/log-analytics-solution/azext_log_analytics_solution/_help.py b/src/log-analytics-solution/azext_log_analytics_solution/_help.py new file mode 100644 index 00000000000..199887bbf8f --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/_help.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. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=line-too-long +from knack.help_files import helps # pylint: disable=unused-import + + +helps['monitor log-analytics solution'] = """ +type: group +short-summary: Commands to manage monitor log-analytics solution. +""" + +helps['monitor log-analytics solution create'] = """ +type: command +short-summary: Create a log-analytics solution. +examples: + - name: Create a log-analytics solution for the plan product of OMSGallery/Containers + text: |- + az monitor log-analytics solution create --resource-group MyResourceGroup \\ + --name Containers({SolutionName}) --tags key=value \\ + --plan-publisher Microsoft --plan-product "OMSGallery/Containers" \\ + --workspace "/subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/ \\ + Microsoft.OperationalInsights/workspaces/{WorkspaceName}" +""" + +helps['monitor log-analytics solution update'] = """ +type: command +short-summary: Update an existing log-analytics solution. +examples: + - name: Update a log-analytics solution + text: |- + az monitor log-analytics solution update --resource-group MyResourceGroup \\ + --name SolutionName --tags key=value +""" + +helps['monitor log-analytics solution delete'] = """ +type: command +short-summary: Delete a log-analytics solution. +examples: + - name: Delete a log-analytics solution + text: |- + az monitor log-analytics solution delete --resource-group MyResourceGroup --name SolutionName +""" + +helps['monitor log-analytics solution show'] = """ +type: command +short-summary: Get details about the specified log-analytics solution. +examples: + - name: Get a log-analytics solution + text: |- + az monitor log-analytics solution show --resource-group MyResourceGroup --name SolutionName +""" + +helps['monitor log-analytics solution list'] = """ +type: command +short-summary: List all of the log-analytics solutions in the specified subscription or resource group +examples: + - name: List all log-analytics solutions in the current subscription + text: |- + az monitor log-analytics solution list + - name: List all log-analytics solutions in a subscription + text: |- + az monitor log-analytics solution list --subscription MySubscription + - name: List all log-analytics solutions in a resource group + text: |- + az monitor log-analytics solution list --resource-group MyResourceGroup +""" diff --git a/src/log-analytics-solution/azext_log_analytics_solution/_params.py b/src/log-analytics-solution/azext_log_analytics_solution/_params.py new file mode 100644 index 00000000000..75d39488a7c --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/_params.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import tags_type +from knack.arguments import CLIArgumentType +from ._validators import validate_workspace_resource_id + +solution_name = CLIArgumentType(options_list=['--name', '-n'], + help='Name of the log-analytics solution. For Microsoft published solution it ' + 'should be in the format of solutionType(workspaceName). SolutionType part is ' + 'case sensitive. For third party solution, it can be anything.') + + +def load_arguments(self, _): + + with self.argument_context('monitor log-analytics solution create') as c: + c.ignore('location') + c.argument('solution_name', solution_name) + c.argument('tags', tags_type) + c.argument('plan_publisher', help='Publisher name of the plan for solution. For gallery solution, it is Microsoft.') + c.argument('plan_product', help='Product name of the plan for solution. ' + 'For Microsoft published gallery solution it should be in the format of OMSGallery/. This is case sensitive.') + c.argument('workspace_resource_id', options_list=['--workspace', '-w'], + validator=validate_workspace_resource_id, + help='The name or resource ID of the log analytics workspace with which the solution will be linked.') + + with self.argument_context('monitor log-analytics solution update') as c: + c.argument('solution_name', solution_name) + c.argument('tags', tags_type) + + with self.argument_context('monitor log-analytics solution delete') as c: + c.argument('solution_name', solution_name) + + with self.argument_context('monitor log-analytics solution show') as c: + c.argument('solution_name', solution_name) diff --git a/src/log-analytics-solution/azext_log_analytics_solution/_validators.py b/src/log-analytics-solution/azext_log_analytics_solution/_validators.py new file mode 100644 index 00000000000..7dce67e8418 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/_validators.py @@ -0,0 +1,36 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +from msrestazure.tools import is_valid_resource_id, parse_resource_id, resource_id +from knack.util import CLIError +from azure.mgmt.loganalytics import LogAnalyticsManagementClient +from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_subscription_id + + +def validate_workspace_resource_id(cmd, namespace): + + if namespace.workspace_resource_id: + # If the workspace_resource_id is invalid, use it as a workspace name to splice the workspace_resource_id + if not is_valid_resource_id(namespace.workspace_resource_id): + namespace.workspace_resource_id = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='microsoft.OperationalInsights', + type='workspaces', + name=namespace.workspace_resource_id + ) + + if not is_valid_resource_id(namespace.workspace_resource_id): + raise CLIError('usage error: --workspace is invalid, it must be name of resource id of workspace') + + # Determine whether the workspace already exists + workspace_param = parse_resource_id(namespace.workspace_resource_id) + if workspace_param['resource_group'] != namespace.resource_group_name: + raise CLIError('usage error: workspace and solution must be under the same resource group') + + workspaces_client = get_mgmt_service_client(cmd.cli_ctx, LogAnalyticsManagementClient).workspaces + workspaces = workspaces_client.get(workspace_param['resource_group'], workspace_param['resource_name']) + + # The location of solution is the same as the location of the workspace + namespace.location = workspaces.location diff --git a/src/log-analytics-solution/azext_log_analytics_solution/azext_metadata.json b/src/log-analytics-solution/azext_log_analytics_solution/azext_metadata.json new file mode 100644 index 00000000000..707b3ad69f7 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.0" +} \ No newline at end of file diff --git a/src/log-analytics-solution/azext_log_analytics_solution/commands.py b/src/log-analytics-solution/azext_log_analytics_solution/commands.py new file mode 100644 index 00000000000..dbdc428cb58 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/commands.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals +from azure.cli.core.commands import CliCommandType +from ._client_factory import cf_solutions + + +def load_command_table(self, _): + + log_analytics_solution_solutions = CliCommandType( + operations_tmpl='azext_log_analytics_solution.vendored_sdks.operationsmanagement.operations._solutions_operations#SolutionsOperations.{}', + client_factory=cf_solutions) + + with self.command_group('monitor log-analytics solution', log_analytics_solution_solutions, + client_factory=cf_solutions, is_experimental=True) as g: + g.custom_command('create', 'create_monitor_log_analytics_solution', supports_no_wait=True) + g.custom_command('update', 'update_monitor_log_analytics_solution', supports_no_wait=True) + g.custom_command('delete', 'delete_monitor_log_analytics_solution', supports_no_wait=True, confirmation=True) + g.custom_show_command('show', 'get_monitor_log_analytics_solution') + g.custom_command('list', 'list_monitor_log_analytics_solution') diff --git a/src/log-analytics-solution/azext_log_analytics_solution/custom.py b/src/log-analytics-solution/azext_log_analytics_solution/custom.py new file mode 100644 index 00000000000..ce62ff348bd --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/custom.py @@ -0,0 +1,68 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-statements +# pylint: disable=too-many-lines +# pylint: disable=too-many-locals +# pylint: disable=unused-argument + +from azure.cli.core.util import sdk_no_wait + + +def create_monitor_log_analytics_solution(client, + resource_group_name, + solution_name, + plan_publisher, + plan_product, + workspace_resource_id, + location, + tags=None, + no_wait=False): + + body = { + 'location': location, + 'tags': tags, + 'properties': { + "workspace_resource_id": workspace_resource_id + }, + "plan": { + "name": solution_name, + "product": plan_product, + "publisher": plan_publisher, + "promotion_code": "" + } + } + + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group_name, + solution_name=solution_name, parameters=body) + + +def update_monitor_log_analytics_solution(client, + resource_group_name, + solution_name, + tags=None, + no_wait=False): + + return sdk_no_wait(no_wait, client.update, resource_group_name=resource_group_name, + solution_name=solution_name, tags=tags) + + +def delete_monitor_log_analytics_solution(client, + resource_group_name, + solution_name, + no_wait=False): + return sdk_no_wait(no_wait, client.delete, resource_group_name=resource_group_name, solution_name=solution_name) + + +def get_monitor_log_analytics_solution(client, + resource_group_name, + solution_name): + return client.get(resource_group_name=resource_group_name, solution_name=solution_name) + + +def list_monitor_log_analytics_solution(client, resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() diff --git a/src/log-analytics-solution/azext_log_analytics_solution/tests/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/tests/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/tests/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/log_analytics.json b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/log_analytics.json new file mode 100644 index 00000000000..538cbdf9c46 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/log_analytics.json @@ -0,0 +1,11 @@ +{ + "features": { + "legacy": "0", + "searchVersion": "1" + }, + "retentionInDays": "7", + "sku": { + "name": "free" + }, + "source": "Azure" +} \ No newline at end of file diff --git a/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/recordings/test_log_analytics_solution.yaml b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/recordings/test_log_analytics_solution.yaml new file mode 100644 index 00000000000..dbb5f3aba6f --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/recordings/test_log_analytics_solution.yaml @@ -0,0 +1,1504 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --resource-type -p + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights","namespace":"Microsoft.OperationalInsights","authorizations":[{"applicationId":"d2a0a418-0aac-4541-82b2-b3142c89da77","roleDefinitionId":"86695298-2eb9-48a7-9ec3-2fdb38b6878b"},{"applicationId":"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5","roleDefinitionId":"5d5a2e56-9835-44aa-93db-d2f19e155438"}],"resourceTypes":[{"resourceType":"workspaces","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"locations/operationStatuses","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/scopedPrivateLinkProxies","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/query","locations":["West + Central US","Australia Southeast","West Europe","East US","Southeast Asia","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland West","Switzerland North"],"apiVersions":["2017-10-01"],"capabilities":"None"},{"resourceType":"workspaces/dataSources","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/linkedStorageAccounts","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"None"},{"resourceType":"storageInsightConfigs","locations":[],"apiVersions":["2020-03-01-preview","2014-10-10"],"capabilities":"SupportsExtension"},{"resourceType":"workspaces/linkedServices","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"linkTargets","locations":["East + US"],"apiVersions":["2020-03-01-preview","2015-03-20"],"capabilities":"None"},{"resourceType":"operations","locations":[],"apiVersions":["2020-03-01-preview","2015-11-01-preview","2014-11-10"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"clusters","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Switzerland North","Switzerland West","Brazil South"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, + SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' + headers: + cache-control: + - no-cache + content-length: + - '6229' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:22:33 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: '{"location": "westus", "properties": {"features": {"legacy": "0", "searchVersion": + "1"}, "retentionInDays": "7", "sku": {"name": "free"}, "source": "Azure"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource create + Connection: + - keep-alive + Content-Length: + - '157' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -l --resource-type -p + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004?api-version=2015-03-20 + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"f70fe6d6-08c1-410b-ac48-9e5d6cf56aac\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"free\",\r\n \"lastSkuUpdate\": \"Wed, + 29 Apr 2020 09:22:40 GMT\"\r\n },\r\n \"retentionInDays\": 7,\r\n \"features\": + {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": + true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 0.5,\r\n + \ \"quotaNextResetTime\": \"Thu, 30 Apr 2020 07:00:00 GMT\",\r\n \"dataIngestionStatus\": + \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n + \ \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004\",\r\n + \ \"name\": \"workspace000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1019' + content-type: + - application/json + date: + - Wed, 29 Apr 2020 09:22:41 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --resource-type -p + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004?api-version=2015-03-20 + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"f70fe6d6-08c1-410b-ac48-9e5d6cf56aac\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"free\",\r\n \"lastSkuUpdate\": \"Wed, + 29 Apr 2020 09:22:40 GMT\"\r\n },\r\n \"retentionInDays\": 7,\r\n \"features\": + {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": + true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 0.5,\r\n + \ \"quotaNextResetTime\": \"Thu, 30 Apr 2020 07:00:00 GMT\",\r\n \"dataIngestionStatus\": + \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n + \ \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004\",\r\n + \ \"name\": \"workspace000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1020' + content-type: + - application/json + date: + - Wed, 29 Apr 2020 09:23:13 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --plan-publisher --plan-product --workspace --tags + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.5.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"f70fe6d6-08c1-410b-ac48-9e5d6cf56aac\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"free\",\r\n \"lastSkuUpdate\": \"Wed, + 29 Apr 2020 09:22:40 GMT\"\r\n },\r\n \"retentionInDays\": 7,\r\n \"features\": + {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": + true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 0.5,\r\n + \ \"quotaNextResetTime\": \"Thu, 30 Apr 2020 07:00:00 GMT\",\r\n \"dataIngestionStatus\": + \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n + \ \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004\",\r\n + \ \"name\": \"workspace000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1020' + content-type: + - application/json + date: + - Wed, 29 Apr 2020 09:23:16 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "tags": {"key1": "value1"}, "plan": {"name": + "Containers(workspace000004)", "publisher": "Microsoft", "promotionCode": "", + "product": "OMSGallery/Containers"}, "properties": {"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution create + Connection: + - keep-alive + Content-Length: + - '444' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --plan-publisher --plan-product --workspace --tags + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000004%29?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"plan\": {\r\n \"name\": \"Containers(workspace000004)\",\r\n + \ \"publisher\": \"Microsoft\",\r\n \"promotionCode\": \"\",\r\n \"product\": + \"OMSGallery/Containers\"\r\n },\r\n \"properties\": {\r\n \"workspaceResourceId\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"Mon, + 01 Jan 0001 00:00:00 GMT\",\r\n \"lastModifiedTime\": \"Mon, 01 Jan 0001 + 00:00:00 GMT\",\r\n \"containedResources\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004/views/Containers(workspace000004)\"\r\n + \ ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000004)\",\r\n + \ \"name\": \"Containers(workspace000004)\",\r\n \"type\": \"Microsoft.OperationsManagement/solutions\",\r\n + \ \"location\": \"West US\",\r\n \"tags\": {\r\n \"key1\": \"value1\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '1297' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:23:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000004%29?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"plan\": {\r\n \"name\": \"Containers(workspace000004)\",\r\n + \ \"publisher\": \"Microsoft\",\r\n \"promotionCode\": \"\",\r\n \"product\": + \"OMSGallery/Containers\"\r\n },\r\n \"properties\": {\r\n \"workspaceResourceId\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"Wed, + 29 Apr 2020 09:23:22 GMT\",\r\n \"lastModifiedTime\": \"Wed, 29 Apr 2020 + 09:23:22 GMT\",\r\n \"containedResources\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004/views/Containers(workspace000004)\"\r\n + \ ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000004)\",\r\n + \ \"name\": \"Containers(workspace000004)\",\r\n \"type\": \"Microsoft.OperationsManagement/solutions\",\r\n + \ \"location\": \"West US\",\r\n \"tags\": {\r\n \"key1\": \"value1\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '1297' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:23:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key2": "value2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution update + Connection: + - keep-alive + Content-Length: + - '28' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --tags + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000004%29?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"plan\": {\r\n \"name\": \"Containers(workspace000004)\",\r\n + \ \"publisher\": \"Microsoft\",\r\n \"promotionCode\": \"\",\r\n \"product\": + \"OMSGallery/Containers\"\r\n },\r\n \"properties\": {\r\n \"workspaceResourceId\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"Wed, + 29 Apr 2020 09:23:22 GMT\",\r\n \"lastModifiedTime\": \"Wed, 29 Apr 2020 + 09:23:22 GMT\",\r\n \"containedResources\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004/views/Containers(workspace000004)\"\r\n + \ ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000004)\",\r\n + \ \"name\": \"Containers(workspace000004)\",\r\n \"type\": \"Microsoft.OperationsManagement/solutions\",\r\n + \ \"location\": \"West US\",\r\n \"tags\": {\r\n \"key2\": \"value2\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '1297' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:23:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000004%29?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"plan\": {\r\n \"name\": \"Containers(workspace000004)\",\r\n + \ \"publisher\": \"Microsoft\",\r\n \"promotionCode\": \"\",\r\n \"product\": + \"OMSGallery/Containers\"\r\n },\r\n \"properties\": {\r\n \"workspaceResourceId\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"Wed, + 29 Apr 2020 09:23:22 GMT\",\r\n \"lastModifiedTime\": \"Wed, 29 Apr 2020 + 09:23:29 GMT\",\r\n \"containedResources\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004/views/Containers(workspace000004)\"\r\n + \ ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000004)\",\r\n + \ \"name\": \"Containers(workspace000004)\",\r\n \"type\": \"Microsoft.OperationsManagement/solutions\",\r\n + \ \"location\": \"West US\",\r\n \"tags\": {\r\n \"key2\": \"value2\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '1297' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:23:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --resource-type -p + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights","namespace":"Microsoft.OperationalInsights","authorizations":[{"applicationId":"d2a0a418-0aac-4541-82b2-b3142c89da77","roleDefinitionId":"86695298-2eb9-48a7-9ec3-2fdb38b6878b"},{"applicationId":"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5","roleDefinitionId":"5d5a2e56-9835-44aa-93db-d2f19e155438"}],"resourceTypes":[{"resourceType":"workspaces","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"locations/operationStatuses","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/scopedPrivateLinkProxies","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/query","locations":["West + Central US","Australia Southeast","West Europe","East US","Southeast Asia","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland West","Switzerland North"],"apiVersions":["2017-10-01"],"capabilities":"None"},{"resourceType":"workspaces/dataSources","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/linkedStorageAccounts","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"None"},{"resourceType":"storageInsightConfigs","locations":[],"apiVersions":["2020-03-01-preview","2014-10-10"],"capabilities":"SupportsExtension"},{"resourceType":"workspaces/linkedServices","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"linkTargets","locations":["East + US"],"apiVersions":["2020-03-01-preview","2015-03-20"],"capabilities":"None"},{"resourceType":"operations","locations":[],"apiVersions":["2020-03-01-preview","2015-11-01-preview","2014-11-10"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"clusters","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Switzerland North","Switzerland West","Brazil South"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, + SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' + headers: + cache-control: + - no-cache + content-length: + - '6229' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:23:34 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: '{"location": "westus", "properties": {"features": {"legacy": "0", "searchVersion": + "1"}, "retentionInDays": "7", "sku": {"name": "free"}, "source": "Azure"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource create + Connection: + - keep-alive + Content-Length: + - '157' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -l --resource-type -p + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationalInsights/workspaces/workspace000005?api-version=2015-03-20 + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"b2de31a9-8c53-4f5f-a242-2a336aab42f8\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"free\",\r\n \"lastSkuUpdate\": \"Wed, + 29 Apr 2020 09:23:42 GMT\"\r\n },\r\n \"retentionInDays\": 7,\r\n \"features\": + {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": + true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 0.5,\r\n + \ \"quotaNextResetTime\": \"Wed, 29 Apr 2020 22:00:00 GMT\",\r\n \"dataIngestionStatus\": + \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n + \ \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005\",\r\n + \ \"name\": \"workspace000005\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1019' + content-type: + - application/json + date: + - Wed, 29 Apr 2020 09:23:42 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --resource-type -p + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationalInsights/workspaces/workspace000005?api-version=2015-03-20 + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"b2de31a9-8c53-4f5f-a242-2a336aab42f8\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"free\",\r\n \"lastSkuUpdate\": \"Wed, + 29 Apr 2020 09:23:42 GMT\"\r\n },\r\n \"retentionInDays\": 7,\r\n \"features\": + {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": + true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 0.5,\r\n + \ \"quotaNextResetTime\": \"Wed, 29 Apr 2020 22:00:00 GMT\",\r\n \"dataIngestionStatus\": + \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n + \ \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005\",\r\n + \ \"name\": \"workspace000005\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1020' + content-type: + - application/json + date: + - Wed, 29 Apr 2020 09:24:13 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --plan-publisher --plan-product --workspace --tags + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-loganalytics/0.5.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationalInsights/workspaces/workspace000005?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"b2de31a9-8c53-4f5f-a242-2a336aab42f8\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"free\",\r\n \"lastSkuUpdate\": \"Wed, + 29 Apr 2020 09:23:42 GMT\"\r\n },\r\n \"retentionInDays\": 7,\r\n \"features\": + {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": + true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": 0.5,\r\n + \ \"quotaNextResetTime\": \"Wed, 29 Apr 2020 22:00:00 GMT\",\r\n \"dataIngestionStatus\": + \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n + \ \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005\",\r\n + \ \"name\": \"workspace000005\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1020' + content-type: + - application/json + date: + - Wed, 29 Apr 2020 09:24:16 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "tags": {"key3": "value3"}, "plan": {"name": + "Containers(workspace000005)", "publisher": "Microsoft", "promotionCode": "", + "product": "OMSGallery/Containers"}, "properties": {"workspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/microsoft.OperationalInsights/workspaces/workspace000005"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution create + Connection: + - keep-alive + Content-Length: + - '444' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --plan-publisher --plan-product --workspace --tags + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000005%29?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"plan\": {\r\n \"name\": \"Containers(workspace000005)\",\r\n + \ \"publisher\": \"Microsoft\",\r\n \"promotionCode\": \"\",\r\n \"product\": + \"OMSGallery/Containers\"\r\n },\r\n \"properties\": {\r\n \"workspaceResourceId\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/microsoft.OperationalInsights/workspaces/workspace000005\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": \"Mon, + 01 Jan 0001 00:00:00 GMT\",\r\n \"lastModifiedTime\": \"Mon, 01 Jan 0001 + 00:00:00 GMT\",\r\n \"containedResources\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationalInsights/workspaces/workspace000005/views/Containers(workspace000005)\"\r\n + \ ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000005)\",\r\n + \ \"name\": \"Containers(workspace000005)\",\r\n \"type\": \"Microsoft.OperationsManagement/solutions\",\r\n + \ \"location\": \"West US\",\r\n \"tags\": {\r\n \"key3\": \"value3\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '1297' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1179' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution list + Connection: + - keep-alive + ParameterSetName: + - --query + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationsManagement/solutions?api-version=2015-11-01-preview + response: + body: + string: '{"value":[{"plan":{"name":"Containers(zhoxing-test8)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/Containers"},"properties":{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/zhoxing-test/providers/microsoft.operationalinsights/workspaces/zhoxing-test8","provisioningState":"Succeeded","creationTime":"Wed, + 29 Apr 2020 04:57:39 GMT","lastModifiedTime":"Wed, 29 Apr 2020 07:29:13 GMT","containedResources":["/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/zhoxing-test/providers/microsoft.operationalinsights/workspaces/zhoxing-test8/views/Containers(zhoxing-test8)"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/zhoxing-test/providers/Microsoft.OperationsManagement/solutions/Containers(zhoxing-test8)","name":"Containers(zhoxing-test8)","type":"Microsoft.OperationsManagement/solutions","location":"Central + US","tags":{"key":"value"}},{"plan":{"name":"Containers(workspace000005)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/Containers"},"properties":{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005","provisioningState":"Succeeded","creationTime":"Wed, + 29 Apr 2020 09:24:21 GMT","lastModifiedTime":"Wed, 29 Apr 2020 09:24:21 GMT","containedResources":["/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005/views/Containers(workspace000005)"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000005)","name":"Containers(workspace000005)","type":"Microsoft.OperationsManagement/solutions","location":"West + US","tags":{"key3":"value3"}},{"plan":{"name":"Containers(workspace000004)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/Containers"},"properties":{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004","provisioningState":"Succeeded","creationTime":"Wed, + 29 Apr 2020 09:23:22 GMT","lastModifiedTime":"Wed, 29 Apr 2020 09:23:29 GMT","containedResources":["/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.operationalinsights/workspaces/workspace000004/views/Containers(workspace000004)"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000004)","name":"Containers(workspace000004)","type":"Microsoft.OperationsManagement/solutions","location":"West + US","tags":{"key2":"value2"}},{"plan":{"name":"SecurityCenterFree(yu-test-ws1)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/SecurityCenterFree"},"properties":{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-test-scus/providers/microsoft.operationalinsights/workspaces/yu-test-ws1","provisioningState":"Succeeded","creationTime":"Sat, + 25 Apr 2020 01:11:55 GMT","lastModifiedTime":"Sat, 25 Apr 2020 17:12:10 GMT","containedResources":[]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-test-scus/providers/Microsoft.OperationsManagement/solutions/SecurityCenterFree(yu-test-ws1)","name":"SecurityCenterFree(yu-test-ws1)","type":"Microsoft.OperationsManagement/solutions","location":"South + Central US"}]}' + headers: + cache-control: + - no-cache + content-length: + - '4054' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:25 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: + - b4eecfc7-8fb8-4511-bfb8-0e0224d65d90 + - 3d8266be-62d4-46fb-9c4a-56ca18ad323e + - 427ecb9d-19a1-4402-952e-98d5c8a77a98 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --query + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"plan\": {\r\n \"name\": + \"Containers(workspace000005)\",\r\n \"publisher\": \"Microsoft\",\r\n + \ \"promotionCode\": \"\",\r\n \"product\": \"OMSGallery/Containers\"\r\n + \ },\r\n \"properties\": {\r\n \"workspaceResourceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005\",\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"creationTime\": + \"Wed, 29 Apr 2020 09:24:21 GMT\",\r\n \"lastModifiedTime\": \"Wed, + 29 Apr 2020 09:24:21 GMT\",\r\n \"containedResources\": [\r\n \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/microsoft.operationalinsights/workspaces/workspace000005/views/Containers(workspace000005)\"\r\n + \ ]\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions/Containers(workspace000005)\",\r\n + \ \"name\": \"Containers(workspace000005)\",\r\n \"type\": \"Microsoft.OperationsManagement/solutions\",\r\n + \ \"location\": \"West US\",\r\n \"tags\": {\r\n \"key3\": + \"value3\"\r\n }\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '1418' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name -y + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000004%29?api-version=2015-11-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '0' + date: + - Wed, 29 Apr 2020 09:24:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name -y + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions/Containers%28workspace000005%29?api-version=2015-11-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + cachecontrol: + - no-cache + content-length: + - '0' + date: + - Wed, 29 Apr 2020 09:24:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-ams-apiversion: + - WebAPI1.0 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --resource-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights","namespace":"Microsoft.OperationalInsights","authorizations":[{"applicationId":"d2a0a418-0aac-4541-82b2-b3142c89da77","roleDefinitionId":"86695298-2eb9-48a7-9ec3-2fdb38b6878b"},{"applicationId":"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5","roleDefinitionId":"5d5a2e56-9835-44aa-93db-d2f19e155438"}],"resourceTypes":[{"resourceType":"workspaces","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"locations/operationStatuses","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/scopedPrivateLinkProxies","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/query","locations":["West + Central US","Australia Southeast","West Europe","East US","Southeast Asia","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland West","Switzerland North"],"apiVersions":["2017-10-01"],"capabilities":"None"},{"resourceType":"workspaces/dataSources","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/linkedStorageAccounts","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"None"},{"resourceType":"storageInsightConfigs","locations":[],"apiVersions":["2020-03-01-preview","2014-10-10"],"capabilities":"SupportsExtension"},{"resourceType":"workspaces/linkedServices","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"linkTargets","locations":["East + US"],"apiVersions":["2020-03-01-preview","2015-03-20"],"capabilities":"None"},{"resourceType":"operations","locations":[],"apiVersions":["2020-03-01-preview","2015-11-01-preview","2014-11-10"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"clusters","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Switzerland North","Switzerland West","Brazil South"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, + SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' + headers: + cache-control: + - no-cache + content-length: + - '6229' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --resource-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/workspace000004?api-version=2015-03-20 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 29 Apr 2020 09:24:41 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --resource-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationalInsights","namespace":"Microsoft.OperationalInsights","authorizations":[{"applicationId":"d2a0a418-0aac-4541-82b2-b3142c89da77","roleDefinitionId":"86695298-2eb9-48a7-9ec3-2fdb38b6878b"},{"applicationId":"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5","roleDefinitionId":"5d5a2e56-9835-44aa-93db-d2f19e155438"}],"resourceTypes":[{"resourceType":"workspaces","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"locations","locations":[],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"locations/operationStatuses","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2017-04-26-preview","2017-03-15-preview","2017-03-03-preview","2017-01-01-preview","2015-11-01-preview","2015-03-20"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/scopedPrivateLinkProxies","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/query","locations":["West + Central US","Australia Southeast","West Europe","East US","Southeast Asia","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland West","Switzerland North"],"apiVersions":["2017-10-01"],"capabilities":"None"},{"resourceType":"workspaces/dataSources","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"workspaces/linkedStorageAccounts","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"None"},{"resourceType":"storageInsightConfigs","locations":[],"apiVersions":["2020-03-01-preview","2014-10-10"],"capabilities":"SupportsExtension"},{"resourceType":"workspaces/linkedServices","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Brazil South","Switzerland North","Switzerland West"],"apiVersions":["2020-03-01-preview","2019-08-01-preview","2015-11-01-preview"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"linkTargets","locations":["East + US"],"apiVersions":["2020-03-01-preview","2015-03-20"],"capabilities":"None"},{"resourceType":"operations","locations":[],"apiVersions":["2020-03-01-preview","2015-11-01-preview","2014-11-10"],"defaultApiVersion":"2015-11-01-preview","capabilities":"None"},{"resourceType":"clusters","locations":["East + US","West Europe","Southeast Asia","Australia Southeast","West Central US","Japan + East","UK South","Central India","Canada Central","West US 2","Australia Central","Australia + East","France Central","Korea Central","North Europe","Central US","East Asia","East + US 2","South Central US","North Central US","West US","UK West","South Africa + North","Switzerland North","Switzerland West","Brazil South"],"apiVersions":["2020-03-01-preview","2019-08-01-preview"],"defaultApiVersion":"2019-08-01-preview","capabilities":"CrossResourceGroupResourceMove, + CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, + SupportsLocation"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' + headers: + cache-control: + - no-cache + content-length: + - '6229' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - resource delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --resource-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationalInsights/workspaces/workspace000005?api-version=2015-03-20 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 29 Apr 2020 09:24:47 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution list + Connection: + - keep-alive + ParameterSetName: + - --query + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperationsManagement/solutions?api-version=2015-11-01-preview + response: + body: + string: '{"value":[{"plan":{"name":"Containers(zhoxing-test8)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/Containers"},"properties":{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/zhoxing-test/providers/microsoft.operationalinsights/workspaces/zhoxing-test8","provisioningState":"Succeeded","creationTime":"Wed, + 29 Apr 2020 04:57:39 GMT","lastModifiedTime":"Wed, 29 Apr 2020 07:29:13 GMT","containedResources":["/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/zhoxing-test/providers/microsoft.operationalinsights/workspaces/zhoxing-test8/views/Containers(zhoxing-test8)"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/zhoxing-test/providers/Microsoft.OperationsManagement/solutions/Containers(zhoxing-test8)","name":"Containers(zhoxing-test8)","type":"Microsoft.OperationsManagement/solutions","location":"Central + US","tags":{"key":"value"}},{"plan":{"name":"SecurityCenterFree(yu-test-ws1)","publisher":"Microsoft","promotionCode":"","product":"OMSGallery/SecurityCenterFree"},"properties":{"workspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-test-scus/providers/microsoft.operationalinsights/workspaces/yu-test-ws1","provisioningState":"Succeeded","creationTime":"Sat, + 25 Apr 2020 01:11:55 GMT","lastModifiedTime":"Sat, 25 Apr 2020 17:12:10 GMT","containedResources":[]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-test-scus/providers/Microsoft.OperationsManagement/solutions/SecurityCenterFree(yu-test-ws1)","name":"SecurityCenterFree(yu-test-ws1)","type":"Microsoft.OperationsManagement/solutions","location":"South + Central US"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1724' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:50 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: + - c0d91f8d-a4b5-469c-84c8-6e6d8c8da7f1 + - 07dfeb9e-2e31-464c-add0-6f9d89848681 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics solution list + Connection: + - keep-alive + ParameterSetName: + - --resource-group --query + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-operationsmanagement/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000002/providers/Microsoft.OperationsManagement/solutions?api-version=2015-11-01-preview + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 29 Apr 2020 09:24:51 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 +version: 1 diff --git a/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/test_log_analytics_solution_scenario.py b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/test_log_analytics_solution_scenario.py new file mode 100644 index 00000000000..498c75ba96d --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/tests/latest/test_log_analytics_solution_scenario.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from knack.util import CLIError + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class OperationsScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(parameter_name='resource_group_1') + @ResourceGroupPreparer(parameter_name='resource_group_2') + @ResourceGroupPreparer(parameter_name_for_location='location') + def test_log_analytics_solution(self, resource_group_1, resource_group_2, location): + + self.kwargs.update({ + 'loc': location, + 'workspace_name': self.create_random_name('workspace', 20), + 'rg': resource_group_1, + 'rg2': resource_group_2, + 'sub': self.get_subscription_id(), + 'la_prop_path': os.path.join(TEST_DIR, 'log_analytics.json') + }) + self.kwargs['solution_name'] = 'Containers(' + self.kwargs['workspace_name'] + ')' + + workspace = self.cmd('resource create -g {rg} -n {workspace_name} -l {loc} --resource-type ' + 'Microsoft.OperationalInsights/workspaces -p @"{la_prop_path}"').get_output_in_json() + self.kwargs.update({ + 'workspace_resource_id': workspace['id'], + 'wrong_workspace_resource_id': workspace['id'][1:] + }) + + with self.assertRaises(CLIError) as err: + self.cmd('az monitor log-analytics solution create ' + '--resource-group {rg} ' + '--name {solution_name} ' + '--plan-publisher "Microsoft" ' + '--plan-product "OMSGallery/Containers" ' + '--workspace "{wrong_workspace_resource_id}" ') + self.assertTrue("usage error: --workspace is invalid" == err.exception) + + with self.assertRaises(CLIError) as err: + self.cmd('az monitor log-analytics solution create ' + '--resource-group {rg2} ' + '--name {solution_name} ' + '--plan-publisher "Microsoft" ' + '--plan-product "OMSGallery/Containers" ' + '--workspace "{workspace_resource_id}" ') + self.assertTrue("usage error: workspace and solution must be under the same resource group" == err.exception) + + self.cmd('az monitor log-analytics solution create ' + '--resource-group {rg} ' + '--name {solution_name} ' + '--plan-publisher "Microsoft" ' + '--plan-product "OMSGallery/Containers" ' + '--workspace "{workspace_resource_id}" ' + '--tags key1=value1', + checks=[self.check('name', '{solution_name}')]) + + self.cmd('az monitor log-analytics solution show --resource-group {rg} --name {solution_name}', + checks=[self.check('name', '{solution_name}'), + self.check('plan.publisher', 'Microsoft'), + self.check('plan.product', 'OMSGallery/Containers'), + self.check('tags', {'key1': 'value1'})]) + + self.cmd('az monitor log-analytics solution update --resource-group {rg} --name {solution_name} ' + '--tags key2=value2', + checks=[self.check('name', '{solution_name}'), + self.check('tags', {'key2': 'value2'})]) + + self.cmd('az monitor log-analytics solution show --resource-group {rg} --name {solution_name}', + checks=[self.check('name', '{solution_name}'), + self.check('plan.publisher', 'Microsoft'), + self.check('plan.product', 'OMSGallery/Containers'), + self.check('tags', {'key2': 'value2'})]) + + self.kwargs['workspace_name2'] = self.create_random_name('workspace', 20) + self.cmd('resource create -g {rg2} -n {workspace_name2} -l {loc} --resource-type ' + 'Microsoft.OperationalInsights/workspaces -p @"{la_prop_path}"').get_output_in_json() + self.kwargs['solution_name2'] = 'Containers(' + self.kwargs['workspace_name2'] + ')' + + self.cmd('az monitor log-analytics solution create ' + '--resource-group {rg2} ' + '--name {solution_name2} ' + '--plan-publisher "Microsoft" ' + '--plan-product "OMSGallery/Containers" ' + '--workspace "{workspace_name2}" ' + '--tags key3=value3', + checks=[self.check('name', '{solution_name2}')]) + + self.cmd('az monitor log-analytics solution list --query "value[?name==\'{solution_name}\']"', + checks=[self.check('length([])', 1)]) + + self.cmd('az monitor log-analytics solution list --resource-group {rg2} ' + '--query "value[?name==\'{solution_name2}\']" ', + checks=[self.check('length([])', 1)]) + + self.cmd('az monitor log-analytics solution delete --resource-group {rg} --name {solution_name} -y', + checks=[]) + + self.cmd('az monitor log-analytics solution delete --resource-group {rg2} --name {solution_name2} -y', + checks=[]) + + self.cmd('az resource delete -g {rg} -n {workspace_name} --resource-type ' + 'Microsoft.OperationalInsights/workspaces', checks=[]) + + self.cmd('az resource delete -g {rg2} -n {workspace_name2} --resource-type ' + 'Microsoft.OperationalInsights/workspaces', checks=[]) + + self.cmd('az monitor log-analytics solution list --query "value[?name==\'{solution_name}\']"', + checks=[self.check('length([])', 0)]) + + self.cmd('az monitor log-analytics solution list --resource-group {rg2} ' + '--query "value[?name==\'{solution_name2}\']" ', + checks=[self.check('length([])', 0)]) diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/__init__.py new file mode 100644 index 00000000000..a5b81f3bde4 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +__import__('pkg_resources').declare_namespace(__name__) diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/__init__.py new file mode 100644 index 00000000000..35c1a070aa9 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/__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 ._configuration import OperationsManagementClientConfiguration +from ._operations_management_client import OperationsManagementClient +__all__ = ['OperationsManagementClient', 'OperationsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/_configuration.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/_configuration.py new file mode 100644 index 00000000000..9cbd71f615f --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/_configuration.py @@ -0,0 +1,65 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class OperationsManagementClientConfiguration(AzureConfiguration): + """Configuration for OperationsManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param provider_name: Provider name for the parent resource. + :type provider_name: str + :param resource_type: Resource type for the parent resource + :type resource_type: str + :param resource_name: Parent resource name. + :type resource_name: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, provider_name, resource_type, resource_name, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if provider_name is None: + raise ValueError("Parameter 'provider_name' must not be None.") + if resource_type is None: + raise ValueError("Parameter 'resource_type' must not be None.") + if resource_name is None: + raise ValueError("Parameter 'resource_name' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(OperationsManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-operationsmanagement/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + self.provider_name = provider_name + self.resource_type = resource_type + self.resource_name = resource_name diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/_operations_management_client.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/_operations_management_client.py new file mode 100644 index 00000000000..1d7c40270c1 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/_operations_management_client.py @@ -0,0 +1,72 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import OperationsManagementClientConfiguration +from .operations import SolutionsOperations +from .operations import ManagementAssociationsOperations +from .operations import ManagementConfigurationsOperations +from .operations import Operations +from . import models + + +class OperationsManagementClient(SDKClient): + """Operations Management Client + + :ivar config: Configuration for client. + :vartype config: OperationsManagementClientConfiguration + + :ivar solutions: Solutions operations + :vartype solutions: azure.mgmt.operationsmanagement.operations.SolutionsOperations + :ivar management_associations: ManagementAssociations operations + :vartype management_associations: azure.mgmt.operationsmanagement.operations.ManagementAssociationsOperations + :ivar management_configurations: ManagementConfigurations operations + :vartype management_configurations: azure.mgmt.operationsmanagement.operations.ManagementConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.operationsmanagement.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param provider_name: Provider name for the parent resource. + :type provider_name: str + :param resource_type: Resource type for the parent resource + :type resource_type: str + :param resource_name: Parent resource name. + :type resource_name: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, provider_name, resource_type, resource_name, base_url=None): + + self.config = OperationsManagementClientConfiguration(credentials, subscription_id, provider_name, resource_type, resource_name, base_url) + super(OperationsManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2015-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.solutions = SolutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_associations = ManagementAssociationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_configurations = ManagementConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/__init__.py new file mode 100644 index 00000000000..b024f0b3847 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/__init__.py @@ -0,0 +1,66 @@ +# 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 ArmTemplateParameter + from ._models_py3 import CodeMessageError, CodeMessageErrorException + from ._models_py3 import CodeMessageErrorError + from ._models_py3 import ManagementAssociation + from ._models_py3 import ManagementAssociationProperties + from ._models_py3 import ManagementAssociationPropertiesList + from ._models_py3 import ManagementConfiguration + from ._models_py3 import ManagementConfigurationProperties + from ._models_py3 import ManagementConfigurationPropertiesList + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import Solution + from ._models_py3 import SolutionPatch + from ._models_py3 import SolutionPlan + from ._models_py3 import SolutionProperties + from ._models_py3 import SolutionPropertiesList +except (SyntaxError, ImportError): + from ._models import ArmTemplateParameter + from ._models import CodeMessageError, CodeMessageErrorException + from ._models import CodeMessageErrorError + from ._models import ManagementAssociation + from ._models import ManagementAssociationProperties + from ._models import ManagementAssociationPropertiesList + from ._models import ManagementConfiguration + from ._models import ManagementConfigurationProperties + from ._models import ManagementConfigurationPropertiesList + from ._models import Operation + from ._models import OperationDisplay + from ._models import Solution + from ._models import SolutionPatch + from ._models import SolutionPlan + from ._models import SolutionProperties + from ._models import SolutionPropertiesList +from ._paged_models import OperationPaged + +__all__ = [ + 'ArmTemplateParameter', + 'CodeMessageError', 'CodeMessageErrorException', + 'CodeMessageErrorError', + 'ManagementAssociation', + 'ManagementAssociationProperties', + 'ManagementAssociationPropertiesList', + 'ManagementConfiguration', + 'ManagementConfigurationProperties', + 'ManagementConfigurationPropertiesList', + 'Operation', + 'OperationDisplay', + 'Solution', + 'SolutionPatch', + 'SolutionPlan', + 'SolutionProperties', + 'SolutionPropertiesList', + 'OperationPaged', +] diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_models.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_models.py new file mode 100644 index 00000000000..a609b5a9d32 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_models.py @@ -0,0 +1,491 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ArmTemplateParameter(Model): + """Parameter to pass to ARM template. + + :param name: name of the parameter. + :type name: str + :param value: value for the parameter. In Jtoken + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ArmTemplateParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CodeMessageError(Model): + """The error body contract. + + :param error: The error details for a failed request. + :type error: ~azure.mgmt.operationsmanagement.models.CodeMessageErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CodeMessageErrorError'}, + } + + def __init__(self, **kwargs): + super(CodeMessageError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CodeMessageErrorException(HttpOperationError): + """Server responsed with exception of type: 'CodeMessageError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CodeMessageErrorException, self).__init__(deserialize, response, 'CodeMessageError', *args) + + +class CodeMessageErrorError(Model): + """The error details for a failed request. + + :param code: The error type. + :type code: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CodeMessageErrorError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ManagementAssociation(Model): + """The container for solution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param properties: Properties for ManagementAssociation object supported + by the OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.ManagementAssociationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ManagementAssociationProperties'}, + } + + def __init__(self, **kwargs): + super(ManagementAssociation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + + +class ManagementAssociationProperties(Model): + """ManagementAssociation properties supported by the OperationsManagement + resource provider. + + All required parameters must be populated in order to send to Azure. + + :param application_id: Required. The applicationId of the appliance for + this association. + :type application_id: str + """ + + _validation = { + 'application_id': {'required': True}, + } + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagementAssociationProperties, self).__init__(**kwargs) + self.application_id = kwargs.get('application_id', None) + + +class ManagementAssociationPropertiesList(Model): + """the list of ManagementAssociation response. + + :param value: List of Management Association properties within the + subscription. + :type value: + list[~azure.mgmt.operationsmanagement.models.ManagementAssociation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagementAssociation]'}, + } + + def __init__(self, **kwargs): + super(ManagementAssociationPropertiesList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ManagementConfiguration(Model): + """The container for solution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param properties: Properties for ManagementConfiguration object supported + by the OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.ManagementConfigurationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ManagementConfigurationProperties'}, + } + + def __init__(self, **kwargs): + super(ManagementConfiguration, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.properties = kwargs.get('properties', None) + + +class ManagementConfigurationProperties(Model): + """ManagementConfiguration properties supported by the OperationsManagement + resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param application_id: The applicationId of the appliance for this + Management. + :type application_id: str + :param parent_resource_type: Required. The type of the parent resource. + :type parent_resource_type: str + :param parameters: Required. Parameters to run the ARM template + :type parameters: + list[~azure.mgmt.operationsmanagement.models.ArmTemplateParameter] + :ivar provisioning_state: The provisioning state for the + ManagementConfiguration. + :vartype provisioning_state: str + :param template: Required. The Json object containing the ARM template to + deploy + :type template: object + """ + + _validation = { + 'parent_resource_type': {'required': True}, + 'parameters': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'template': {'required': True}, + } + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'parent_resource_type': {'key': 'parentResourceType', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ArmTemplateParameter]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ManagementConfigurationProperties, self).__init__(**kwargs) + self.application_id = kwargs.get('application_id', None) + self.parent_resource_type = kwargs.get('parent_resource_type', None) + self.parameters = kwargs.get('parameters', None) + self.provisioning_state = None + self.template = kwargs.get('template', None) + + +class ManagementConfigurationPropertiesList(Model): + """the list of ManagementConfiguration response. + + :param value: List of Management Configuration properties within the + subscription. + :type value: + list[~azure.mgmt.operationsmanagement.models.ManagementConfiguration] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagementConfiguration]'}, + } + + def __init__(self, **kwargs): + super(ManagementConfigurationPropertiesList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Operation(Model): + """Supported operation of OperationsManagement resource provider. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.operationsmanagement.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft OperationsManagement. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', '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) + + +class Solution(Model): + """The container for solution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Plan for solution object supported by the + OperationsManagement resource provider. + :type plan: ~azure.mgmt.operationsmanagement.models.SolutionPlan + :param properties: Properties for solution object supported by the + OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.SolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'SolutionPlan'}, + 'properties': {'key': 'properties', 'type': 'SolutionProperties'}, + } + + def __init__(self, **kwargs): + super(Solution, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + + +class SolutionPatch(Model): + """The properties of a Solution that can be patched. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SolutionPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class SolutionPlan(Model): + """Plan for solution object supported by the OperationsManagement resource + provider. + + :param name: name of the solution to be created. For Microsoft published + solution it should be in the format of solutionType(workspaceName). + SolutionType part is case sensitive. For third party solution, it can be + anything. + :type name: str + :param publisher: Publisher name. For gallery solution, it is Microsoft. + :type publisher: str + :param promotion_code: promotionCode, Not really used now, can you left as + empty + :type promotion_code: str + :param product: name of the solution to enabled/add. For Microsoft + published gallery solution it should be in the format of + OMSGallery/. This is case sensitive + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SolutionPlan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.product = kwargs.get('product', None) + + +class SolutionProperties(Model): + """Solution properties supported by the OperationsManagement resource + provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param workspace_resource_id: Required. The azure resourceId for the + workspace where the solution will be deployed/enabled. + :type workspace_resource_id: str + :ivar provisioning_state: The provisioning state for the solution. + :vartype provisioning_state: str + :param contained_resources: The azure resources that will be contained + within the solutions. They will be locked and gets deleted automatically + when the solution is deleted. + :type contained_resources: list[str] + :param referenced_resources: The resources that will be referenced from + this solution. Deleting any of those solution out of band will break the + solution. + :type referenced_resources: list[str] + """ + + _validation = { + 'workspace_resource_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'contained_resources': {'key': 'containedResources', 'type': '[str]'}, + 'referenced_resources': {'key': 'referencedResources', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SolutionProperties, self).__init__(**kwargs) + self.workspace_resource_id = kwargs.get('workspace_resource_id', None) + self.provisioning_state = None + self.contained_resources = kwargs.get('contained_resources', None) + self.referenced_resources = kwargs.get('referenced_resources', None) + + +class SolutionPropertiesList(Model): + """the list of solution response. + + :param value: List of solution properties within the subscription. + :type value: list[~azure.mgmt.operationsmanagement.models.Solution] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Solution]'}, + } + + def __init__(self, **kwargs): + super(SolutionPropertiesList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_models_py3.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_models_py3.py new file mode 100644 index 00000000000..7e6e39f9e4f --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_models_py3.py @@ -0,0 +1,491 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ArmTemplateParameter(Model): + """Parameter to pass to ARM template. + + :param name: name of the parameter. + :type name: str + :param value: value for the parameter. In Jtoken + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(ArmTemplateParameter, self).__init__(**kwargs) + self.name = name + self.value = value + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CodeMessageError(Model): + """The error body contract. + + :param error: The error details for a failed request. + :type error: ~azure.mgmt.operationsmanagement.models.CodeMessageErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CodeMessageErrorError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CodeMessageError, self).__init__(**kwargs) + self.error = error + + +class CodeMessageErrorException(HttpOperationError): + """Server responsed with exception of type: 'CodeMessageError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CodeMessageErrorException, self).__init__(deserialize, response, 'CodeMessageError', *args) + + +class CodeMessageErrorError(Model): + """The error details for a failed request. + + :param code: The error type. + :type code: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(CodeMessageErrorError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ManagementAssociation(Model): + """The container for solution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param properties: Properties for ManagementAssociation object supported + by the OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.ManagementAssociationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ManagementAssociationProperties'}, + } + + def __init__(self, *, location: str=None, properties=None, **kwargs) -> None: + super(ManagementAssociation, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.properties = properties + + +class ManagementAssociationProperties(Model): + """ManagementAssociation properties supported by the OperationsManagement + resource provider. + + All required parameters must be populated in order to send to Azure. + + :param application_id: Required. The applicationId of the appliance for + this association. + :type application_id: str + """ + + _validation = { + 'application_id': {'required': True}, + } + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__(self, *, application_id: str, **kwargs) -> None: + super(ManagementAssociationProperties, self).__init__(**kwargs) + self.application_id = application_id + + +class ManagementAssociationPropertiesList(Model): + """the list of ManagementAssociation response. + + :param value: List of Management Association properties within the + subscription. + :type value: + list[~azure.mgmt.operationsmanagement.models.ManagementAssociation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagementAssociation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ManagementAssociationPropertiesList, self).__init__(**kwargs) + self.value = value + + +class ManagementConfiguration(Model): + """The container for solution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param properties: Properties for ManagementConfiguration object supported + by the OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.ManagementConfigurationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ManagementConfigurationProperties'}, + } + + def __init__(self, *, location: str=None, properties=None, **kwargs) -> None: + super(ManagementConfiguration, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.properties = properties + + +class ManagementConfigurationProperties(Model): + """ManagementConfiguration properties supported by the OperationsManagement + resource provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param application_id: The applicationId of the appliance for this + Management. + :type application_id: str + :param parent_resource_type: Required. The type of the parent resource. + :type parent_resource_type: str + :param parameters: Required. Parameters to run the ARM template + :type parameters: + list[~azure.mgmt.operationsmanagement.models.ArmTemplateParameter] + :ivar provisioning_state: The provisioning state for the + ManagementConfiguration. + :vartype provisioning_state: str + :param template: Required. The Json object containing the ARM template to + deploy + :type template: object + """ + + _validation = { + 'parent_resource_type': {'required': True}, + 'parameters': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'template': {'required': True}, + } + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'parent_resource_type': {'key': 'parentResourceType', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ArmTemplateParameter]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'template': {'key': 'template', 'type': 'object'}, + } + + def __init__(self, *, parent_resource_type: str, parameters, template, application_id: str=None, **kwargs) -> None: + super(ManagementConfigurationProperties, self).__init__(**kwargs) + self.application_id = application_id + self.parent_resource_type = parent_resource_type + self.parameters = parameters + self.provisioning_state = None + self.template = template + + +class ManagementConfigurationPropertiesList(Model): + """the list of ManagementConfiguration response. + + :param value: List of Management Configuration properties within the + subscription. + :type value: + list[~azure.mgmt.operationsmanagement.models.ManagementConfiguration] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagementConfiguration]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ManagementConfigurationPropertiesList, self).__init__(**kwargs) + self.value = value + + +class Operation(Model): + """Supported operation of OperationsManagement resource provider. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.operationsmanagement.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft OperationsManagement. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class Solution(Model): + """The container for solution. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param plan: Plan for solution object supported by the + OperationsManagement resource provider. + :type plan: ~azure.mgmt.operationsmanagement.models.SolutionPlan + :param properties: Properties for solution object supported by the + OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.SolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'SolutionPlan'}, + 'properties': {'key': 'properties', 'type': 'SolutionProperties'}, + } + + def __init__(self, *, location: str=None, tags=None, plan=None, properties=None, **kwargs) -> None: + super(Solution, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.plan = plan + self.properties = properties + + +class SolutionPatch(Model): + """The properties of a Solution that can be patched. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(SolutionPatch, self).__init__(**kwargs) + self.tags = tags + + +class SolutionPlan(Model): + """Plan for solution object supported by the OperationsManagement resource + provider. + + :param name: name of the solution to be created. For Microsoft published + solution it should be in the format of solutionType(workspaceName). + SolutionType part is case sensitive. For third party solution, it can be + anything. + :type name: str + :param publisher: Publisher name. For gallery solution, it is Microsoft. + :type publisher: str + :param promotion_code: promotionCode, Not really used now, can you left as + empty + :type promotion_code: str + :param product: name of the solution to enabled/add. For Microsoft + published gallery solution it should be in the format of + OMSGallery/. This is case sensitive + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, publisher: str=None, promotion_code: str=None, product: str=None, **kwargs) -> None: + super(SolutionPlan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.promotion_code = promotion_code + self.product = product + + +class SolutionProperties(Model): + """Solution properties supported by the OperationsManagement resource + provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param workspace_resource_id: Required. The azure resourceId for the + workspace where the solution will be deployed/enabled. + :type workspace_resource_id: str + :ivar provisioning_state: The provisioning state for the solution. + :vartype provisioning_state: str + :param contained_resources: The azure resources that will be contained + within the solutions. They will be locked and gets deleted automatically + when the solution is deleted. + :type contained_resources: list[str] + :param referenced_resources: The resources that will be referenced from + this solution. Deleting any of those solution out of band will break the + solution. + :type referenced_resources: list[str] + """ + + _validation = { + 'workspace_resource_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'contained_resources': {'key': 'containedResources', 'type': '[str]'}, + 'referenced_resources': {'key': 'referencedResources', 'type': '[str]'}, + } + + def __init__(self, *, workspace_resource_id: str, contained_resources=None, referenced_resources=None, **kwargs) -> None: + super(SolutionProperties, self).__init__(**kwargs) + self.workspace_resource_id = workspace_resource_id + self.provisioning_state = None + self.contained_resources = contained_resources + self.referenced_resources = referenced_resources + + +class SolutionPropertiesList(Model): + """the list of solution response. + + :param value: List of solution properties within the subscription. + :type value: list[~azure.mgmt.operationsmanagement.models.Solution] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Solution]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(SolutionPropertiesList, self).__init__(**kwargs) + self.value = value diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_paged_models.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_paged_models.py new file mode 100644 index 00000000000..d933945d04b --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/__init__.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/__init__.py new file mode 100644 index 00000000000..215feff34f6 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/__init__.py @@ -0,0 +1,22 @@ +# 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 ._solutions_operations import SolutionsOperations +from ._management_associations_operations import ManagementAssociationsOperations +from ._management_configurations_operations import ManagementConfigurationsOperations +from ._operations import Operations + +__all__ = [ + 'SolutionsOperations', + 'ManagementAssociationsOperations', + 'ManagementConfigurationsOperations', + 'Operations', +] diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_management_associations_operations.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_management_associations_operations.py new file mode 100644 index 00000000000..0925e2f2e34 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_management_associations_operations.py @@ -0,0 +1,299 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ManagementAssociationsOperations(object): + """ManagementAssociationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-11-01-preview" + + self.config = config + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves the ManagementAssociations list for the subscription. + + Retrieves the ManagementAssociations list. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagementAssociationPropertiesList or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.operationsmanagement.models.ManagementAssociationPropertiesList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.list_by_subscription.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementAssociationPropertiesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementAssociations'} + + def create_or_update( + self, resource_group_name, management_association_name, location=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Create/Update ManagementAssociation. + + Creates or updates the ManagementAssociation. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param management_association_name: User ManagementAssociation Name. + :type management_association_name: str + :param location: Resource location + :type location: str + :param properties: Properties for ManagementAssociation object + supported by the OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.ManagementAssociationProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagementAssociation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.operationsmanagement.models.ManagementAssociation + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + parameters = models.ManagementAssociation(location=location, properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'providerName': self._serialize.url("self.config.provider_name", self.config.provider_name, 'str'), + 'resourceType': self._serialize.url("self.config.resource_type", self.config.resource_type, 'str'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str'), + 'managementAssociationName': self._serialize.url("management_association_name", management_association_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ManagementAssociation') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementAssociation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'} + + def delete( + self, resource_group_name, management_association_name, custom_headers=None, raw=False, **operation_config): + """Deletes the ManagementAssociation. + + Deletes the ManagementAssociation in the subscription. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param management_association_name: User ManagementAssociation Name. + :type management_association_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'providerName': self._serialize.url("self.config.provider_name", self.config.provider_name, 'str'), + 'resourceType': self._serialize.url("self.config.resource_type", self.config.resource_type, 'str'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str'), + 'managementAssociationName': self._serialize.url("management_association_name", management_association_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'} + + def get( + self, resource_group_name, management_association_name, custom_headers=None, raw=False, **operation_config): + """Retrieve ManagementAssociation. + + Retrieves the user ManagementAssociation. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param management_association_name: User ManagementAssociation Name. + :type management_association_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagementAssociation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.operationsmanagement.models.ManagementAssociation + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'providerName': self._serialize.url("self.config.provider_name", self.config.provider_name, 'str'), + 'resourceType': self._serialize.url("self.config.resource_type", self.config.resource_type, 'str'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str'), + 'managementAssociationName': self._serialize.url("management_association_name", management_association_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementAssociation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'} diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_management_configurations_operations.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_management_configurations_operations.py new file mode 100644 index 00000000000..f07bc75b692 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_management_configurations_operations.py @@ -0,0 +1,295 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ManagementConfigurationsOperations(object): + """ManagementConfigurationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-11-01-preview" + + self.config = config + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves the ManagementConfigurations list for the subscription. + + Retrieves the ManagementConfigurations list. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagementConfigurationPropertiesList or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.operationsmanagement.models.ManagementConfigurationPropertiesList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.list_by_subscription.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementConfigurationPropertiesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementConfigurations'} + + def create_or_update( + self, resource_group_name, management_configuration_name, location=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Create/Update ManagementConfiguration. + + Creates or updates the ManagementConfiguration. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param management_configuration_name: User Management Configuration + Name. + :type management_configuration_name: str + :param location: Resource location + :type location: str + :param properties: Properties for ManagementConfiguration object + supported by the OperationsManagement resource provider. + :type properties: + ~azure.mgmt.operationsmanagement.models.ManagementConfigurationProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagementConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.operationsmanagement.models.ManagementConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + parameters = models.ManagementConfiguration(location=location, properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'managementConfigurationName': self._serialize.url("management_configuration_name", management_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ManagementConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'} + + def delete( + self, resource_group_name, management_configuration_name, custom_headers=None, raw=False, **operation_config): + """Deletes the ManagementConfiguration. + + Deletes the ManagementConfiguration in the subscription. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param management_configuration_name: User Management Configuration + Name. + :type management_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'managementConfigurationName': self._serialize.url("management_configuration_name", management_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'} + + def get( + self, resource_group_name, management_configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve ManagementConfiguration. + + Retrieves the user ManagementConfiguration. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param management_configuration_name: User Management Configuration + Name. + :type management_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagementConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.operationsmanagement.models.ManagementConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'managementConfigurationName': self._serialize.url("management_configuration_name", management_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/ManagementConfigurations/{managementConfigurationName}'} diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_operations.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_operations.py new file mode 100644 index 00000000000..781193478d9 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_operations.py @@ -0,0 +1,102 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-11-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available OperationsManagement Rest API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.operationsmanagement.models.OperationPaged[~azure.mgmt.operationsmanagement.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.OperationsManagement/operations'} diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_solutions_operations.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_solutions_operations.py new file mode 100644 index 00000000000..842623cb482 --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/operations/_solutions_operations.py @@ -0,0 +1,509 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SolutionsOperations(object): + """SolutionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-11-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, solution_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Solution') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Solution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, solution_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create/Update Solution. + + Creates or updates the Solution. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param solution_name: User Solution Name. + :type solution_name: str + :param parameters: The parameters required to create OMS Solution. + :type parameters: ~azure.mgmt.operationsmanagement.models.Solution + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Solution or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.operationsmanagement.models.Solution] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.operationsmanagement.models.Solution]] + :raises: + :class:`CodeMessageErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + solution_name=solution_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Solution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'} + + + def _update_initial( + self, resource_group_name, solution_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.SolutionPatch(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SolutionPatch') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Solution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, solution_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch a Solution. + + Patch a Solution. Only updating tags supported. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param solution_name: User Solution Name. + :type solution_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Solution or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.operationsmanagement.models.Solution] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.operationsmanagement.models.Solution]] + :raises: + :class:`CodeMessageErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + solution_name=solution_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Solution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'} + + + def _delete_initial( + self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, solution_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the solution. + + Deletes the solution in the subscription. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param solution_name: User Solution Name. + :type solution_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`CodeMessageErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + solution_name=solution_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'} + + def get( + self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): + """Retrieve solution. + + Retrieves the user solution. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param solution_name: User Solution Name. + :type solution_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Solution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.operationsmanagement.models.Solution or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'solutionName': self._serialize.url("solution_name", solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Solution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions/{solutionName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieves the solution list for the subscription. + + Retrieves the solution list. It will retrieve both first party and + third party solutions. + + :param resource_group_name: The name of the resource group to get. The + name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SolutionPropertiesList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.operationsmanagement.models.SolutionPropertiesList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.list_by_resource_group.metadata['url'] + 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SolutionPropertiesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationsManagement/solutions'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves the solution list for the subscription. + + Retrieves the solution list. It will retrieve both first party and + third party solutions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SolutionPropertiesList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.operationsmanagement.models.SolutionPropertiesList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CodeMessageErrorException` + """ + # Construct URL + url = self.list_by_subscription.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.CodeMessageErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SolutionPropertiesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/solutions'} diff --git a/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/version.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/version.py new file mode 100644 index 00000000000..e0ec669828c --- /dev/null +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/version.py @@ -0,0 +1,13 @@ +# 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 = "0.1.0" + diff --git a/src/log-analytics-solution/setup.cfg b/src/log-analytics-solution/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/log-analytics-solution/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/log-analytics-solution/setup.py b/src/log-analytics-solution/setup.py new file mode 100644 index 00000000000..94770e009cf --- /dev/null +++ b/src/log-analytics-solution/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 +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# 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.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +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='log_analytics_solution', + version=VERSION, + description='Microsoft Azure Command-Line Tools Operations Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_log_analytics_solution': ['azext_metadata.json']}, +)